Fedora 18 now uses the DWZ tool to decrease size of debug info: https://fedoraproject.org/wiki/Features/DwarfCompressor http://sourceware.org/git/?p=dwz.git;a=summary This introduces two new forms into DWARF, and .gnu_debugaltlink sections (from either original ELF file or its separate debuginfo file) optionally pointing to an alternate debuginfo file, which is a mere ET_REL file with .debug_{info,str,line,abbrev} sections and .note.gnu.build-id. Reproducible: Always Steps to Reproduce: Grab dwz from the above mentioned repository, build it. Then say cp -a varinfo1{,_1}; cp -a varinfo1{,_2} dwz -m varinfo1.dwz varinfo1_{1,2} and add a /usr/lib/debug/.build-id/xx/yyyyyy...yy.debug symlink (readelf -Wa varinfo1.dwz prints the build-id at the end). Then running valgrind --tool=memcheck --read-var-info=yes -q ./varinfo1_1 will show some of the issues. Note, in F18 rpm's scripts take care of running dwz automatically.
Created attachment 72281 [details] valgrind-dwz-1.patch WIP patch (needs actual handling of the DW_FORM_GNU_ref_alt references and possibly also adding support for DW_TAG_partial_unit and/or DW_TAG_imported_unit).
OT, glibc 2.16 has just been released and Fedora 18 is likely going to use it (if not 2.17), so it would be nice if valgrind 3.8.0 also supported glibc 2.16 out of the box in configury.
Created attachment 72306 [details] valgrind-dwz-2.patch Updated patch. Th emain remaining problem seems to be in that partial units, as the standard allows, aren't self-contained, they usually don't have DW_AT_language attribute, thus the type parsing code sees ->language == '?' and doesn't add the right implicit lower bounds to the array bounds. What perhaps could be done is look through the DW_TAG_imported_unit DW_AT_import references and recursively mark the language kind of the partial units (in the usual case that a partial unit has all (possibly indirect) references from CUs of the same language kind, that language kind could be used, otherwise one would need to defer that decision at the point where a type is actually used. In any case, I think the patch is an incremental progress, at least valgrind won't crash on such debuginfo.
Looks good to me. Will push into trunk in the next few days. If you have any improved version I'll take that too :-)
(In reply to comment #3) > Created attachment 72306 [details] > valgrind-dwz-2.patch Committed, with small fix (removal of inner declaration) to fix this: m_debuginfo/readelf.c: In function ‘vgModuleLocal_read_elf_debug_info’: m_debuginfo/readelf.c:2522: warning: declaration of ‘j’ shadows a previous local m_debuginfo/readelf.c:1317: warning: shadowed declaration is here Thanks for the patch. Do you want to close this bug now and put followup patches on a new bug, or keep this one open?
(In reply to comment #5) > Committed, with small fix (removal of inner declaration) to fix this: r12742, I forgot to mention.
(In reply to comment #2) > OT, glibc 2.16 has just been released and Fedora 18 is likely going to use Can you try with >= r12473 -- this allows the configure script to accept glibc-2.16.
*** Bug 298870 has been marked as a duplicate of this bug. ***