valgrind 1:3.7.0-6+rpi2 missing suppressions for much of libc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
Originally filed with https:/
The package for `valgrind` for Rpi 3 (debian/jessie armf) is missing nearly all suppressions and will through over 4000 errors/warnings related to `Conditional jump or move depends on uninitialised value(s)` for just about every function that allocates or deals with allocated memory, (e.g. `strchr.S:99`, `strlen.S:76`, `__libc_memalign (dl-minimal.c:66)`, `memcpy.S:71`, etc....
I have attempted to update `/usr/lib/
A valgrind check of a simple allocation results in over 2700 lines of warnings/errors:
==12765== Memcheck, a memory error detector
==12765== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==12765== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==12765== Command: ./bin/llwords5
==12765==
==12765== Conditional jump or move depends on uninitialised value(s)
==12765== at 0x4019AB0: index (strchr.S:99)
==12765== by 0x4008653: expand_
==12765== by 0x4009323: _dl_map_object (dl-load.c:2538)
==12765== by 0x4000FD3: map_doit (rtld.c:719)
==12765== by 0x401049F: _dl_catch_error (dl-error.c:187)
==12765== by 0x4000F5B: do_preload (rtld.c:908)
==12765== by 0x4001CA3: handle_ld_preload (rtld.c:1006)
==12765== by 0x40039B3: dl_main (rtld.c:1750)
==12765== by 0x401713B: _dl_sysdep_start (dl-sysdep.c:249)
==12765== by 0x400137B: _dl_start_final (rtld.c:424)
==12765== by 0x400160B: _dl_start (rtld.c:652)
==12765== by 0x4000CAF: ??? (in /lib/arm-
==12765==
==12765== Conditional jump or move depends on uninitialised value(s)
==12765== at 0x4019AB4: index (strchr.S:101)
==12765== by 0x4008653: expand_
==12765== by 0x4009323: _dl_map_object (dl-load.c:2538)
==12765== by 0x4000FD3: map_doit (rtld.c:719)
==12765== by 0x401049F: _dl_catch_error (dl-error.c:187)
==12765== by 0x4000F5B: do_preload (rtld.c:908)
==12765== by 0x4001CA3: handle_ld_preload (rtld.c:1006)
==12765== by 0x40039B3: dl_main (rtld.c:1750)
==12765== by 0x401713B: _dl_sysdep_start (dl-sysdep.c:249)
==12765== by 0x400137B: _dl_start_final (rtld.c:424)
==12765== by 0x400160B: _dl_start (rtld.c:652)
==12765== by 0x4000CAF: ??? (in /lib/arm-
<snip>
==12765== Conditional jump or move depends on uninitialised value(s)
==12765== at 0x49789B0: free_mem (in /lib/arm-
==12765== by 0x49783C3: __libc_freeres (in /lib/arm-
==12765== by 0x4023633: _vgnU_freeres (vg_preloaded.c:61)
==12765== by 0x489DAA7: __run_exit_handlers (exit.c:97)
==12765== by 0x489DAA7: __run_exit_handlers (exit.c:97)
==12765== by 0x489DB3B: exit (exit.c:104)
==12765== by 0x4885297: (below main) (libc-start.c:321)
==12765==
==12765==
==12765== HEAP SUMMARY:
==12765== in use at exit: 0 bytes in 0 blocks
==12765== total heap usage: 33 allocs, 33 frees, 564 bytes allocated
==12765==
==12765== All heap blocks were freed -- no leaks are possible
==12765==
==12765== For counts of detected and suppressed errors, rerun with: -v
==12765== Use --track-origins=yes to see where uninitialised values come from
==12765== ERROR SUMMARY: 4901 errors from 250 contexts (suppressed: 162 from 5)
That makes using `valgrind` almost impossible to use in any meaningful way on Raspberry Pi3. The same code run with proper suppressions, has no warnings or errors (e.g. on openSuSE Leap, Ubuntu, or Archlinux):
$ valgrind ./bin/llwords5
==8415== Memcheck, a memory error detector
==8415== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==8415== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==8415== Command: ./bin/llwords5
==8415==
Enter the name of the file: ../dat/
This is a tale Of Captain Jack Sparrow A Pirate So Brave On the Seven Seas.
==8415==
==8415== HEAP SUMMARY:
==8415== in use at exit: 0 bytes in 0 blocks
==8415== total heap usage: 33 allocs, 33 frees, 884 bytes allocated
==8415==
==8415== All heap blocks were freed -- no leaks are possible
==8415==
==8415== For counts of detected and suppressed errors, rerun with: -v
==8415== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Whatever suppressions are provided for `valgrind` on these distros completely fix this problem so there are no spurious errors or warnings thrown. I suspect the same thing that is done for the `x86/x86_64` build need to be done here.
To the best of my knowlage valgrind upstream doesn't support armv6. Years ago I was pointed to a patch that made it work on armv6 and applied it in raspbian.
Unfortunately that patch fails to apply on more recent versions of Valgrind resulting in valgrind in raspbian being stuck at a very old version.
If someone wants to work on forward-porting the armv6 fixes to recent Valgrind that would be much appreciated.