Gentoo Archives: gentoo-user

From: Andrew Udvare <audvare@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Valgrind not seeing debug symbols
Date: Sun, 19 Aug 2018 16:21:56
Message-Id: cb925eb1-1eba-7ebd-90d7-2c5a70468e99@gmail.com
1 Hi all,
2
3 I have this project https://github.com/Tatsh/gcrud and it uses a very
4 standard build process with CMake, but for some reason Valgrind never
5 sees the debug symbols.
6
7 The debug symbols are definitely there as GDB can see them, but I have
8 not been able to figure out why Valgrind can't. I have the latest
9 version of Valgrind which supports compressed debug symbols.
10
11 I even created an ebuild to see if Portage does the magic I need:
12
13 https://github.com/Tatsh/tatsh-overlay/blob/master/app-portage/gcrud/gcrud-9999.ebuild
14
15 Portage does not generate the debug symbols file I expect to see.
16
17 In all cases I am building with -ggdb. I have FEATURES="splitdebug
18 compressdebug" and still no debug symbols:
19
20 $ valgrind -v --leak-check=full gcrud
21 ...
22 ==16662== 1,120,873 bytes in 16,784 blocks are definitely lost in loss
23 record 41 of 41
24 ==16662== at 0x4C30D6F: realloc (vg_replace_malloc.c:785)
25 ==16662== by 0x5266BA5: __vasprintf_chk (vasprintf_chk.c:88)
26 ==16662== by 0x4ECA438: vasprintf (stdio2.h:210)
27 ==16662== by 0x4ECA438: g_vasprintf (gprintf.c:316)
28 ==16662== by 0x4EA482C: g_strdup_vprintf (gstrfuncs.c:514)
29 ==16662== by 0x4EA48F0: g_strdup_printf (gstrfuncs.c:540)
30 ==16662== by 0x10AB1A: ??? (in /usr/bin/gcrud)
31 ==16662== by 0x10C5B9: ??? (in /usr/bin/gcrud)
32 ==16662==
33 ==16662== LEAK SUMMARY:
34 ==16662== definitely lost: 1,919,735 bytes in 30,221 blocks
35
36 I can tell it's a call to g_strdup_printf() but I sure would like to
37 know what line number since there are a few times it's called.
38
39 I also tried the same build process but with Clang. Tried -gdwarf-4/5
40 and -Og -ggdb. I also don't understand why other libraries are working fine.
41
42 Appreciate any help. Thanks
43
44 --
45 Andrew

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: Valgrind not seeing debug symbols Andrew Udvare <audvare@×××××.com>