Bug 1733019

Summary: bash memory leaks
Product: [Fedora] Fedora Reporter: 1014938109
Component: bashAssignee: Siteshwar Vashisht <svashisht>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 31CC: admiller, gabriel, kasal, kdudka, nman64, svashisht
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-24 18:45:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
detected memory leak by asan none

Description 1014938109 2019-07-25 03:01:07 UTC
Created attachment 1593276 [details]
detected memory leak by asan

Description of problem:


Memory leaks of bash:


How reproducible:


Steps to Reproduce:
1.Memory leaks detected by using the asan

we also used the valgrind to detect the memory leaks

Actual results:

==7878==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0xffff8cbe21db in __interceptor_malloc (/lib64/libasan.so.4+0xd31db)
    #1 0xaaaab977aaf3 in xmalloc (/usr/bin/bash+0x165af3)
    #2 0xaaaab969fe7f  (/usr/bin/bash+0x8ae7f)
    #3 0xaaaab96d9677 in execute_command_internal (/usr/bin/bash+0xc4677)
    #4 0xaaaab96a2cf3  (/usr/bin/bash+0x8dcf3)
    #5 0xaaaab96dacb3 in execute_command_internal (/usr/bin/bash+0xc5cb3)
    #6 0xaaaab9788443 in parse_and_execute (/usr/bin/bash+0x173443)
    #7 0xaaaab971d52f in command_substitute (/usr/bin/bash+0x10852f)
    #8 0xaaaab9728a17  (/usr/bin/bash+0x113a17)
    #9 0xaaaab972bbb7  (/usr/bin/bash+0x116bb7)
    #10 0xaaaab9735887  (/usr/bin/bash+0x120887)
    #11 0xaaaab96a0627  (/usr/bin/bash+0x8b627)
    #12 0xaaaab96d9677 in execute_command_internal (/usr/bin/bash+0xc4677)
    #13 0xaaaab96da6e3 in execute_command_internal (/usr/bin/bash+0xc56e3)
    #14 0xaaaab96de5c3 in execute_command (/usr/bin/bash+0xc95c3)
    #15 0xaaaab96da61f in execute_command_internal (/usr/bin/bash+0xc561f)
    #16 0xaaaab96de5c3 in execute_command (/usr/bin/bash+0xc95c3)
    #17 0xaaaab96da61f in execute_command_internal (/usr/bin/bash+0xc561f)
    #18 0xaaaab96d9a27 in execute_command_internal (/usr/bin/bash+0xc4a27)
    #19 0xaaaab96e04ff  (/usr/bin/bash+0xcb4ff)
    #20 0xaaaab96a1477  (/usr/bin/bash+0x8c477)
    #21 0xaaaab96d9677 in execute_command_internal (/usr/bin/bash+0xc4677)
    #22 0xaaaab9788443 in parse_and_execute (/usr/bin/bash+0x173443)
    #23 0xaaaab96c2fdb in execute_variable_command (/usr/bin/bash+0xadfdb)
    #24 0xaaaab96aa9ab in parse_command (/usr/bin/bash+0x959ab)
    #25 0xaaaab96aabb7 in read_command (/usr/bin/bash+0x95bb7)
    #26 0xaaaab96ab21b in reader_loop (/usr/bin/bash+0x9621b)
    #27 0xaaaab96a71af in main (/usr/bin/bash+0x921af)
    #28 0xffff8c947adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
    #29 0xaaaab96a995b  (/usr/bin/bash+0x9495b)


==15303== HEAP SUMMARY:
==15303==     in use at exit: 449,533 bytes in 19,621 blocks
==15303==   total heap usage: 35,820 allocs, 16,199 frees, 921,773 bytes allocated
==15303== 
==15303== 5 bytes in 1 blocks are indirectly lost in loss record 51 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14555B: read_token_word (parse.y:5085)
==15303==    by 0x14555B: read_token.constprop.8 (parse.y:3297)
==15303==    by 0x14784F: yylex (parse.y:2676)
==15303==    by 0x14784F: yyparse (y.tab.c:1835)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 16 bytes in 1 blocks are indirectly lost in loss record 241 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C5CF: alloc_word_desc (make_cmd.c:96)
==15303==    by 0x145547: read_token_word (parse.y:5084)
==15303==    by 0x145547: read_token.constprop.8 (parse.y:3297)
==15303==    by 0x14784F: yylex (parse.y:2676)
==15303==    by 0x14784F: yyparse (y.tab.c:1835)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 16 bytes in 1 blocks are indirectly lost in loss record 242 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C87B: make_word_list (make_cmd.c:183)
==15303==    by 0x14D03B: make_simple_command (make_cmd.c:557)
==15303==    by 0x148DEF: yyparse (parse.y:733)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 16 bytes in 1 blocks are indirectly lost in loss record 243 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C87B: make_word_list (make_cmd.c:183)
==15303==    by 0x14D03B: make_simple_command (make_cmd.c:557)
==15303==    by 0x148E0F: yyparse (parse.y:735)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 32 bytes in 1 blocks are indirectly lost in loss record 1,040 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14CDC3: make_if_command (make_cmd.c:413)
==15303==    by 0x148583: yyparse (parse.y:1003)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 64 bytes in 2 blocks are indirectly lost in loss record 1,363 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C92B: command_connect (make_cmd.c:212)
==15303==    by 0x149ACB: yyparse (parse.y:1112)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 64 bytes in 2 blocks are indirectly lost in loss record 1,364 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C8EB: make_command (make_cmd.c:197)
==15303==    by 0x149ACB: yyparse (parse.y:1112)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 96 bytes in 4 blocks are indirectly lost in loss record 2,001 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14CF87: make_bare_simple_command (make_cmd.c:525)
==15303==    by 0x14D06F: make_simple_command (make_cmd.c:551)
==15303==    by 0x148DEF: yyparse (parse.y:733)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 128 bytes in 4 blocks are indirectly lost in loss record 2,051 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14CF7B: make_bare_simple_command (make_cmd.c:524)
==15303==    by 0x14D06F: make_simple_command (make_cmd.c:551)
==15303==    by 0x148DEF: yyparse (parse.y:733)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== 469 (32 direct, 437 indirect) bytes in 1 blocks are definitely lost in loss record 2,498 of 2,659
==15303==    at 0x4866BC0: malloc (vg_replace_malloc.c:299)
==15303==    by 0x1964D3: xmalloc (xmalloc.c:112)
==15303==    by 0x14C8EB: make_command (make_cmd.c:197)
==15303==    by 0x148583: yyparse (parse.y:1003)
==15303==    by 0x13E2DF: parse_command (eval.c:262)
==15303==    by 0x13E41B: read_command (eval.c:306)
==15303==    by 0x13E693: reader_loop (eval.c:150)
==15303==    by 0x13D15B: main (shell.c:802)
==15303== 
==15303== LEAK SUMMARY:
==15303==    definitely lost: 32 bytes in 1 blocks
==15303==    indirectly lost: 437 bytes in 17 blocks
==15303==      possibly lost: 0 bytes in 0 blocks
==15303==    still reachable: 449,064 bytes in 19,603 blocks
==15303==         suppressed: 0 bytes in 0 blocks
==15303== Reachable blocks (those to which a pointer was found) are not shown.
==15303== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==15303== 
==15303== For counts of detected and suppressed errors, rerun with: -v
==15303== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Expected results:


Additional info:

Comment 1 Ben Cotton 2020-11-03 16:47:09 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Ben Cotton 2020-11-24 18:45:53 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.