[Bug lto/48384] lto, linker-plugin and optimization clutter the stack trace
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 31 10:43:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48384
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-31 10:28:07 UTC ---
Hm. I get
> LD_LIBRARY_PATH=. gdb ./t_hltog
GNU gdb (GDB) SUSE (7.2.50.20110206-67.1)
...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ff87eb in foo (h=0x0) at foo.cc:6
6 return *h +1;
(gdb) bt
#0 0x00007ffff7ff87eb in foo (h=0x0) at foo.cc:6
#1 0x00007ffff7ff8709 in go (j=2001, h=0x0) at go.cc:5
#2 0x000000000040063d in main (argc=1) at main.cc:7
> LD_LIBRARY_PATH=. gdb ./t_hltog2
GNU gdb (GDB) SUSE (7.2.50.20110206-67.1)
...
Program received signal SIGSEGV, Segmentation fault.
go (j=Cannot access memory at address 0x0
) at go.cc:5
5 j+= foo(h);
(gdb) bt
#0 go (j=Cannot access memory at address 0x0
) at go.cc:5
#1 0x000000000040062d in main (argc=<optimized out>) at main.cc:7
> LD_LIBRARY_PATH=. gdb ./t_hlto
GNU gdb (GDB) SUSE (7.2.50.20110206-67.1)
...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ff874b in go(int, int const*) () from ./libfoo_hlto.so
(gdb) bt
#0 0x00007ffff7ff874b in go(int, int const*) () from ./libfoo_hlto.so
#1 0x000000000040062d in main ()
which looks reasonable.
As I can't reproduce the issue at hand I didn't try to investigate
what debuginfo parts may be off. The assembly of the shared library
shows that foo is inlined into go which appearantly didn't happen for
you? I don't have any foo symbol in the shared library. So maybe
gdb is confused by bogus debug information about inlines.
More information about the Gcc-bugs
mailing list