bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Leak detected when using bash arrays as local variable in a f


From: Chet Ramey
Subject: Re: Memory Leak detected when using bash arrays as local variable in a function
Date: Tue, 5 Jul 2016 21:14:59 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 7/5/16 3:29 PM, remi salard wrote:

> Bash Version: 4.3
> Patch Level: 30
> Release Status: release
> 
> Description:
>       Hello,
> 
>         I observed a memory leak when a bash array is created as a local 
> variable inside a function.
> 
>       Regards,
> 
>       RĂ©mi
> 
> Repeat-By:
> 
>         The following code (from 
> http://bug-bash.gnu.narkive.com/DaBdE5P0/memory-leak-on-arrays-in-functions) 
> shows this 
> regression:
> 
> #!/bin/bash
> run() { local -a A=(); local -a A=(); }
> while :; do run; done

Thanks for the report.  This was reported and fixed a year ago (a different
issue from the one in the link, but with the same reproducer).  The fix is
in the devel branch and all prereleases of bash-4.4.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]