bug-bash
[Top][All Lists]
Advanced

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

Re: Memory leaks in bash-4.4.0


From: Chet Ramey
Subject: Re: Memory leaks in bash-4.4.0
Date: Mon, 30 Jan 2017 10:33:48 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 1/29/17 6:48 PM, Bruce Dubbs wrote:

> Bash Version: 4.4
> Patch Level: 0
> Release Status: release
> 
> Description:
> 
>    When running regression tests on libinput, I get two different leaks
> identified by valgrind. The files below are not a part of libinput but are
> a part of bash.

What is libinput?

>    ==10733== 11 bytes in 1 blocks are definitely lost in loss record 81 of 290
>    ==10733==    at 0x4C2AACD: malloc (vg_replace_malloc.c:299)
>    ==10733==    by 0x46F7BD: xmalloc (xmalloc.c:112)
>    ==10733==    by 0x469598: set_default_locale (locale.c:81)
>    ==10733==    by 0x419950: main (shell.c:411)
>    ==10733==

http://lists.gnu.org/archive/html/bug-bash/2015-07/msg00073.html

>    ==10733== 17 bytes in 1 blocks are definitely lost in loss record 112 of
> 290
>    ==10733==    at 0x4C2AACD: malloc (vg_replace_malloc.c:299)
>    ==10733==    by 0x46F7BD: xmalloc (xmalloc.c:112)
>    ==10733==    by 0x4524EA: make_dev_fd_filename (subst.c:5692)
>    ==10733==    by 0x4524EA: process_substitute (subst.c:5751)
>    ==10733==    by 0x4524EA: expand_word_internal (subst.c:9172)
>    ==10733==    by 0x454E33: shell_expand_word_list (subst.c:10565)
>    ==10733==    by 0x454E33: expand_word_list_internal (subst.c:10688)
>    ==10733==    by 0x42F14E: execute_simple_command (execute_cmd.c:4153)
>    ==10733==    by 0x43134B: execute_command_internal (execute_cmd.c:802)
>    ==10733==    by 0x432BDD: execute_command (execute_cmd.c:405)
>    ==10733==    by 0x41BD51: reader_loop (eval.c:180)
>    ==10733==    by 0x41AAAA: main (shell.c:792)

It would help if there were a short reproducer for this, so I can verify
it.

> I was not able to trace everything through, but xmalloc.c:112 does:
> 
>   temp = malloc (bytes);
> 
> and as best I can tell, temp is never freed.

xmalloc is a malloc wrapper, and `temp' is the return value from the
function.

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



reply via email to

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