https://bugs.kde.org/show_bug.cgi?id=378732

            Bug ID: 378732
           Summary: False positive on recent versions of bash
           Product: valgrind
           Version: 3.12.0
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: r...@sc3d.org
  Target Milestone: ---

Running bash 4.3 as shipped in Ubuntu 16.04, or bash 4.4 or current git master
head compiled from source on Ubuntu 16.04, I get:

$ valgrind bash -c 'exit 0'
==30344== Memcheck, a memory error detector
==30344== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==30344== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==30344== Command: bash -c exit\ 0
==30344== 
==30344== Invalid free() / delete / delete[] / realloc()
==30344==    at 0x4C2ED5B: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30344==    by 0x45E1D0: unwind_frame_run_internal.constprop.3
(unwind_prot.c:301)
==30344==    by 0x45E37F: without_interrupts (unwind_prot.c:107)
==30344==    by 0x45E37F: run_unwind_frame (unwind_prot.c:135)
==30344==    by 0x47B664: parse_and_execute (evalstring.c:421)
==30344==    by 0x4209D6: run_one_command (shell.c:1348)
==30344==    by 0x41F893: main (shell.c:695)
==30344==  Address 0x423b6e8 is in the brk data segment 0x4228000-0x423bfff
==30344== 
==30344== 
==30344== HEAP SUMMARY:
==30344==     in use at exit: 0 bytes in 0 blocks
==30344==   total heap usage: 66 allocs, 67 frees, 10,915 bytes allocated
==30344== 
==30344== All heap blocks were freed -- no leaks are possible
==30344== 
==30344== For counts of detected and suppressed errors, rerun with: -v
==30344== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

See https://lists.gnu.org/archive/html/bug-bash/2017-04/msg00042.html for an
analysis by bash's maintainer. I confirmed this by adding printfs to show that
the malloced address is the same one that valgrind later complains about.

It would be nice to get this fixed, as it causes problems for test suites of
other programs (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=849517 )

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to