== Comment: #0 - Andreas Arnez <email address hidden> - 2016-04-01 12:23:20 ==
It seems that some Ubuntu debug packages are built with compressed debug info, which is not supported by Valgrind. In particular I've seen that this even applies to the dynamic loader (when libc6-dbg is installed):
$ ./vg-in-place /bin/true
==5907== Memcheck, a memory error detector
==5907== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==5907== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==5907== Command: /bin/true
==5907==
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/ld-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/ld-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/ld-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/ld-2.23.so:
--5907-- Last block truncated in .debug_info; ignoring
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/ld-2.23.so:
--5907-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/libc-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/libc-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/libc-2.23.so:
--5907-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/libc-2.23.so:
--5907-- Last block truncated in .debug_info; ignoring
--5907-- WARNING: Serious error when reading debug info
--5907-- When reading debug info from /lib/s390x-linux-gnu/libc-2.23.so:
--5907-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
==5907==
==5907== HEAP SUMMARY:
==5907== in use at exit: 0 bytes in 0 blocks
==5907== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==5907==
==5907== All heap blocks were freed -- no leaks are possible
==5907==
==5907== For counts of detected and suppressed errors, rerun with: -v
==5907== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
== Comment: #1 - Andreas Arnez <email address hidden> - 2016-04-01 12:26:28 ==
Note that this issue should apply to all platforms. It has already been reported for upstream Valgrind, and a patch has been proposed:
https://bugs.kde.org/show_bug.cgi?id=303877
for compressed debuginfo valgrind doesn't display source/line info.
Reproducible: Always
Steps to Reproduce:
$ cat t.cpp
int* p = 0;
int main()
{
*p = 0;
}
$ gcc t.cpp -gdwarf-4 -g2 -o t
$ valgrind ./t
==10551== Invalid write of size 4
==10551== at 0x4004F7: main (t.cpp:4)
$ objcopy --compress- debug-sections ./t
$ valgrind ./t pawels/ bugs/t)
==10568== Invalid write of size 4
==10568== at 0x4004F7: main (in /home/users/