Bug 278313 - Fedora 15/x64: err read debug info with --read-var-info=yes flag
Summary: Fedora 15/x64: err read debug info with --read-var-info=yes flag
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7 SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-23 08:54 UTC by Dmitry Djachenko
Modified: 2012-07-09 12:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
full output from V (10.77 KB, text/plain)
2011-07-23 08:54 UTC, Dmitry Djachenko
Details
Proposed fix (976 bytes, patch)
2012-01-16 09:50 UTC, Bart Van Assche
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Djachenko 2011-07-23 08:54:16 UTC
Created attachment 62107 [details]
full output from V

Version:           3.7 SVN
OS:                Linux

valgrind version 11906, VEX 2182

10 messages "warning: addVar: unknown size (...)"
172 "chase_cuOff: no entry for ....."
1 ": Invalid cuOff = ..."

--21150-- WARNING: Serious error when reading debug info
--21150-- When reading debug info from /usr/lib64/libstdc++.so.6.0.16:
--21150-- resolve_variable_types: cuOff does not refer to a known type

Reproducible: Always

Steps to Reproduce:
$ cat tst.cpp
#include <vector>
int main()
{
    std::vector<int> v;
    return 0;
}
$ g++ -Wall -O0 -g tst.cpp
$ valgrind --tool=memcheck --read-var-info=yes --log-file=a ./a.out

Actual Results:  
==21969== Memcheck, a memory error detector
==21969== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==21969== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright info
==21969== Command: ./a.out
==21969== Parent PID: 1327
==21969==
--21969--
--21969-- Valgrind options:
--21969--    --tool=memcheck
--21969--    --read-var-info=yes
--21969--    -v
--21969--    --log-file=a
--21969-- Contents of /proc/version:
--21969--   Linux version 2.6.38.8-35.fc15.x86_64 (mockbuild@x86-09.phx2.fedoraproject.org) (gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC) ) #1 SMP Wed Jul 6 13:58:54 UTC 2011
--21969-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--21969-- Page sizes: currently 4096, max supported 4096
--21969-- Valgrind library directory: /usr/lib/valgrind
--21969-- Reading syms from /dailybuilds/a.out (0x400000)
--21969-- warning: addVar: unknown size (__position)
--21969-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--21969--    object doesn't have a dynamic symbol table
--21969-- warning: addVar: unknown size (rx)
--21969-- warning: addVar: unknown size (rw)
--21969-- warning: addVar: unknown size (kwds)
--21969-- warning: addVar: unknown size (buf)
--21969-- warning: addVar: unknown size (buf)
--21969-- warning: addVar: unknown size (buf)
--21969-- warning: addVar: unknown size (buf)
--21969-- warning: addVar: unknown size (subs)
--21969-- warning: addVar: unknown size (subs)
--21969-- Reading syms from /lib64/ld-2.14.so (0x3f57400000)
--21969--   Considering /usr/lib/debug/.build-id/38/1b4d1a68920ac7d5ce745f1eb2b324bb90dc03.debug ..
--21969--   .. build-id is valid
--21969-- Reading suppressions file: /usr/lib/valgrind/default.supp
==21969== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-21969
==21969== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-21969
==21969== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-21969

[...]

--21969-- Reading syms from /usr/lib64/libstdc++.so.6.0.16 (0x3f61000000)
--21969--   Considering /usr/lib/debug/.build-id/30/3926dc74f883beaf7ebcd1c32ec9f5f0bd2861.debug ..
--21969--   .. build-id is valid
chase_cuOff: no entry for 0x01099
chase_cuOff: no entry for 0x20812
chase_cuOff: no entry for 0x3bbbe
chase_cuOff: no entry for 0x41a82
chase_cuOff: no entry for 0x4b530
chase_cuOff: no entry for 0x8d348
chase_cuOff: no entry for 0x9b83f
chase_cuOff: no entry for 0x9d43b
chase_cuOff: no entry for 0xa5a6e
chase_cuOff: no entry for 0xa96a2
chase_cuOff: no entry for 0xab66f
chase_cuOff: no entry for 0xaf7de

[...]

: Invalid cuOff = 0x41a82
--21969-- WARNING: Serious error when reading debug info
--21969-- When reading debug info from /usr/lib64/libstdc++.so.6.0.16:
--21969-- resolve_variable_types: cuOff does not refer to a known type


Expected Results:  
no such messages
Comment 1 Bart Van Assche 2012-01-15 18:58:06 UTC
Same problem on openSUSE 12.1 (amd64) after having installed the glibc-debuginfo and libstdc++46-debuginfo packages:

$ ./vg-in-place --tool=none --read-var-info=yes drd/tests/annotate_smart_pointer
==788== Nulgrind, the minimal Valgrind tool
==788== Copyright (C) 2002-2011, and GNU GPL'd, by Nicholas Nethercote.
==788== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==788== Command: drd/tests/annotate_smart_pointer
==788== 
chase_cuOff: no entry for 0x010d4
chase_cuOff: no entry for 0x20701
[ ... ]
Comment 2 Bart Van Assche 2012-01-16 09:50:52 UTC
Created attachment 67881 [details]
Proposed fix

Does the attached patch help ?
Comment 3 Bart Van Assche 2012-01-16 17:16:36 UTC
Committed the attached patch as r12338 on the trunk. Feedback is still welcome though.
Comment 4 Dmitry Djachenko 2012-01-17 19:24:43 UTC
sorry for delay and thank You for fix!

1) with r12337 i can reproduce "./vg-in-place --tool=none --read-var-info=yes drd/tests/annotate_smart_pointer"

2) with r12340 there are no errs
Comment 5 Dmitry Djachenko 2012-02-01 11:03:39 UTC
problem return :)

1. Fedora 16/x64 updated yesterday
2. install glibc-debuginfo and libstdc++-debuginfo
3. gcc-4.6.2
4. latest valgrind from trunk

[dimhen@dim valgrind]$ ./vg-in-place --tool=none --read-var-info=yes drd/tests/annotate_smart_pointer
==13379== Nulgrind, the minimal Valgrind tool
==13379== Copyright (C) 2002-2011, and GNU GPL'd, by Nicholas Nethercote.
==13379== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==13379== Command: drd/tests/annotate_smart_pointer
==13379== 
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658
chase_cuOff: no entry for 0x1a5e70
chase_cuOff: no entry for 0x1e7658

: Invalid cuOff = 0x0100c
--13379-- WARNING: Serious error when reading debug info
--13379-- When reading debug info from /usr/lib64/libstdc++.so.6.0.16:
--13379-- resolve_variable_types: cuOff does not refer to a known type
Comment 6 Bart Van Assche 2012-02-01 18:53:34 UTC
(In reply to comment #5)
> : Invalid cuOff = 0x0100c
> --13379-- WARNING: Serious error when reading debug info
> --13379-- When reading debug info from /usr/lib64/libstdc++.so.6.0.16:
> --13379-- resolve_variable_types: cuOff does not refer to a known type

Actually this is another issue than the issue mentioned in #1, namely that debug information for rvalue references wasn't understood yet by Valgrind. Support for that kind of debug information has been added in r12362.

Note: there is still an issue that remains on Fedora 16 (see below). Not sure yet what's causing this.

$ ./vg-in-place --read-var-info=yes drd/tests/annotate_smart_pointer
==1861== Memcheck, a memory error detector
==1861== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==1861== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==1861== Command: drd/tests/annotate_smart_pointer
==1861== 
--1861-- WARNING: Serious error when reading debug info
--1861-- When reading debug info from /lib/ld-2.14.90.so:
--1861-- negative range in .debug_loc section
Done.
==1861== 
==1861== HEAP SUMMARY:
==1861==     in use at exit: 0 bytes in 0 blocks
==1861==   total heap usage: 4 allocs, 4 frees, 184 bytes allocated
==1861== 
==1861== All heap blocks were freed -- no leaks are possible
==1861== 
==1861== For counts of detected and suppressed errors, rerun with: -v
==1861== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Comment 7 Dmitry Djachenko 2012-02-02 07:42:56 UTC
You see this with x86?

x64 has no such messages

$ ./vg-in-place --read-var-info=yes drd/tests/annotate_smart_pointer
==23002== Memcheck, a memory error detector
==23002== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==23002== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==23002== Command: drd/tests/annotate_smart_pointer
==23002== 
Done.
==23002== 
==23002== HEAP SUMMARY:
==23002==     in use at exit: 0 bytes in 0 blocks
==23002==   total heap usage: 4 allocs, 4 frees, 356 bytes allocated
==23002== 
==23002== All heap blocks were freed -- no leaks are possible
==23002== 
==23002== For counts of detected and suppressed errors, rerun with: -v
==23002== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Comment 8 Bart Van Assche 2012-02-02 18:53:52 UTC
(In reply to comment #7)
> You see this with x86?

Yes, that message was observed on a 32-bit system.
Comment 9 Julian Seward 2012-07-04 18:28:27 UTC
(In reply to comment #5)
> problem return :)

Dmitry, can you try the svn trunk and let us know if this bug
is still present ?
Comment 10 Dmitry Djachenko 2012-07-04 20:26:51 UTC
Julian, there are no errs :) Thank You!

Fedora 17/x86_64
gcc-4.7.0
with & w/o glibc/libstdc++ debuginfo
original test PASS, test from #c1 PASS