On startup with sgcheck the current svn HEAD version (revision 13027) WARNING: Serious error when reading debug info --18990-- When reading debug info from /home/alexander/src/cppcheck/head/cppcheck: --18990-- negative range in .debug_loc section --18990-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0x93 --18990-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0x93 --18990-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0x93 --18990-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0x93 While the latter seems to be a known issue (Bug 185801 ,etc) I could not see the first warning mentioned here as well. Reproducible: Always Steps to Reproduce: 1. Just launch the tool on the given executable 2. 3. Actual Results: The tool seems to work afterwards, or more precisely: no additional warning or error messages appear. Expected Results: Do not issue warning ;-) The executable was built on OpenSuse 12.1 using g++ 4.6.2. ldd says: linux-vdso.so.1 => (0x00007fff7efff000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f0d210ea000) libm.so.6 => /lib64/libm.so.6 (0x00007f0d20e93000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0d20c7d000) libc.so.6 => /lib64/libc.so.6 (0x00007f0d208ed000) /lib64/ld-linux-x86-64.so.2 (0x00007f0d213f4000)
Created attachment 74387 [details] Verbose log of valgrind -v output of valgrind for the given example.
I had the same some time ago on s390. It was a gcc bug back then: e.g. http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01219.html Your gcc seems newer. Anyway valgrind should probably just continue instead of ignoring the other debug info. This hack would disable the warning and continue to use the exisiting debug information. Index: valgrind-3.6/coregrind/m_debuginfo/readdwarf3.c =================================================================== --- valgrind-3.6.orig/coregrind/m_debuginfo/readdwarf3.c +++ valgrind-3.6/coregrind/m_debuginfo/readdwarf3.c @@ -590,12 +590,13 @@ static GExpr* make_general_GX ( CUConst* /* else enumerate [w1+base, w2+base) */ /* w2 is 1 past end of range, as per D3 defn for "DW_AT_high_pc" (sec 2.17.2) */ - if (w1 > w2) { +// this happens with some gcc versions. +/* if (w1 > w2) { TRACE_D3("negative range is for .debug_loc expr at " "file offset %lu\n", debug_loc_offset); cc->barf( "negative range in .debug_loc section" ); - } + }*/ /* ignore zero length ranges */ acquire = w1 < w2;
Well, I've found the gcc bug tracked on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45939 Seems, the analysis "The problem could not be reproduced with head" (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45939#c2) was wrong - given head was older than my 4.6.2. Maybe I should re-open that bug or file a follow-up.
It is very likely a different bug, so please double check the debugloc section with readelf and open a new bug against gcc if appropriate.
I'm confused. Do we need to do anything about this for V 3.9, or can this bug be closed now?
If you can provide the information requested in comment #5, please add it.
The exp-sgcheck tool isn't part of valgrind anymore and the warning was correct, it was a gcc bug.