Bug 18129 - Segfault when reading symbols
Summary: Segfault when reading symbols
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.8
: P2 normal
Target Milestone: 7.10.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-15 07:56 UTC by Cem Kalyoncu
Modified: 2016-08-09 13:25 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cem Kalyoncu 2015-03-15 07:56:06 UTC
I am experiencing segmentation fault while reading symbols. Bug #8773 is quite similar, but I suspect different origin. This crash is not present in 7.6.50 You may access the project from BitBucket: https://bitbucket.org/darkgazeorg/gorgon-game-engine/overview Compilation requires cmake and opengl. You may try any unit tests in Testing/Tests/Unit folder after compilation. 

Following is the output of the program and trying to to invoke gdb.

[cemkalyoncu@localhost Unit]$ ./UnitTest-Geometry
All tests passed (344 assertions in 13 test cases)

[cemkalyoncu@localhost Unit]$ gdb ./UnitTest-Geometry
GNU gdb (GDB) Fedora 7.8.2-38.fc21
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.                                                            
Find the GDB manual and other documentation resources online at:                                    
<http://www.gnu.org/software/gdb/documentation/>.                                                   
For help, type "help".                                                                              
Type "apropos word" to search for commands related to "word"...                                     
Reading symbols from ./UnitTest-Geometry...Segmentation fault (core dumped)
Comment 1 Cem Kalyoncu 2015-03-15 08:10:58 UTC
There few more information about this, I compile for 32 bits on 64 bit linux (Fedora 21). However, I remember trying to debug 64 build with the same crash.
Comment 2 Keith Seitz 2015-03-17 16:30:52 UTC
I've downloaded and built your executable from the mercurial sources listed on the bitbucket.org link to sourceforge. Since I do not read Turkish, the only language the build instructions are in, I had to blindly build the library with the build.sh script. Fortunately, that eventually spit out a library, libGGE.a, in the "build" directory.

You say, "You may try any unit tests in Testing/Tests/Unit folder after compilation." This directory does not exit anywhere in the tree. "Unit" does not exist, either.

I built Tests/test.cpp, though:

$ g++ -g -m32 test.cpp -o gge-test -L../build -lGGE -lcpptest

Running this on Fedora 21 gdb, I get:

$ /usr/bin/gdb -nx -readnow test-gge
GNU gdb (GDB) Fedora 7.8.2-38.fc21
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gge-test...expanding to full symbols...done.
(gdb) start
Temporary breakpoint 1 at 0x8049b6e: file test.cpp, line 173.
Starting program: /home/keiths/gorgon-ge-code/Tests/gge-test 
Missing separate debuginfos, use: debuginfo-install glibc-2.20-8.fc21.i686

Temporary breakpoint 1, main (argc=1, argv=0xffffcd04) at test.cpp:173
173			Test::Suite ts;
Missing separate debuginfos, use: debuginfo-install cpptest-1.1.2-3.fc21.i686 libgcc-4.9.2-6.fc21.i686 libstdc++-4.9.2-6.fc21.i686
(gdb) f
#0  main (argc=1, argv=0xffffcd04) at test.cpp:173
173			Test::Suite ts;

and I can "n" all the way through the program.

My advice: *attach* your executable to this bug report and/or run gdb under gdb and provide a stack backtrace.
Comment 3 Cem Kalyoncu 2015-03-17 19:19:05 UTC
I am so sorry for the confusion. We are currently working for the new version in another branch, which has the reported problem. Branch name is gscript.

Instructions:
hg clone http://bitbucket.org/darkgazeorg/gorgon-game-engine gge
cd gge
hg up gscript
mkdir build
cd build
cmake ..
make -j8
cd ../Testing/Tests/Unit
./UnitTest-Geometry
gdb ./UnitTest-Geometry
Comment 4 Cem Kalyoncu 2015-03-17 19:31:12 UTC
I have switched to another computer to get gdb in gdb for backtrace. Here is the result. It seems like a stack overflow. This gdb version is different: GNU gdb (GDB) Fedora 7.7.1-21.fc20

...
Reading symbols from ./UnitTest-Scripting...
Program received signal SIGSEGV, Segmentation fault.
0x084bc860 in d_print_comp_inner ()
gdb) bt
#0  0x084bc860 in d_print_comp_inner ()
#1  0x084c122f in d_print_subexpr ()
#2  0x084bc8e9 in d_print_comp_inner ()
#3  0x084bfd22 in d_print_comp ()
#4  0x084be9b5 in d_print_comp_inner ()
#5  0x084bfd22 in d_print_comp ()
#6  0x084bdeaf in d_print_comp_inner ()
#7  0x084bfd22 in d_print_comp ()
#8  0x084be075 in d_print_comp_inner ()
#9  0x084c0ec4 in d_print_cast.isra ()
#10 0x084bf10c in d_print_comp_inner ()
#11 0x084bfd22 in d_print_comp ()
#12 0x084bd60e in d_print_comp_inner ()
#13 0x084c12a3 in d_print_subexpr ()
#14 0x084bc92b in d_print_comp_inner ()
#15 0x084bfd22 in d_print_comp ()
#16 0x084be9b5 in d_print_comp_inner ()
#17 0x084bfd22 in d_print_comp ()
#18 0x084bdeaf in d_print_comp_inner ()
#19 0x084bfd22 in d_print_comp ()
#20 0x084be075 in d_print_comp_inner ()
#21 0x084c0ec4 in d_print_cast.isra ()
#22 0x084bf10c in d_print_comp_inner ()
#23 0x084bfd22 in d_print_comp ()
#24 0x084bd60e in d_print_comp_inner ()
#25 0x084c12a3 in d_print_subexpr ()
#26 0x084bc92b in d_print_comp_inner ()
#27 0x084bfd22 in d_print_comp ()
#28 0x084be9b5 in d_print_comp_inner ()
#29 0x084bfd22 in d_print_comp ()
#30 0x084bdeaf in d_print_comp_inner ()
#31 0x084bfd22 in d_print_comp ()
#32 0x084be075 in d_print_comp_inner ()
#33 0x084c0ec4 in d_print_cast.isra ()
#34 0x084bf10c in d_print_comp_inner ()
#35 0x084bfd22 in d_print_comp ()
#36 0x084bd60e in d_print_comp_inner ()
#37 0x084c12a3 in d_print_subexpr ()
#38 0x084bc92b in d_print_comp_inner ()
#39 0x084bfd22 in d_print_comp ()
---Type <return> to continue, or q <return> to quit---
#40 0x084be9b5 in d_print_comp_inner ()
#41 0x084bfd22 in d_print_comp ()
#42 0x084bdeaf in d_print_comp_inner ()
#43 0x084bfd22 in d_print_comp ()
....
Comment 5 Keith Seitz 2015-03-17 20:46:47 UTC
Thanks -- that does it for me.

This is another demangler bug, on the symbol:

_ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs

Fedora 21 gdb:
(gdb) set lang c++
(gdb) maint demangle _ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs
Segmentation fault (core dumped)

HEAD:
(gdb) set lang c++
(gdb) demangle _ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs
../../src/gdb/cp-support.c:1593: demangler-warning: unable to demangle '_ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs' (demangler failed with signal 11)

c++filt 2.24:
$ c++filt _ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs
std::enable_if<(!std::is_constructible<float<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value)&&(!decltype (gorgon__enum_trait_locator((float)()))::isupgradedenum), float>::type Gorgon::String::To<float>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
Comment 6 Pedro Alves 2016-08-09 13:25:48 UTC
Fixed in 7.10.1:

$ /usr/local/bin/gdb-7.10.1  -ex "demangle -l c++ _ZN6Gorgon6String2ToIfEENSt9enable_ifIXaantsrSt16is_constructibleIT_ISsEE5valuentsrDTcl26gorgon__enum_trait_locatorcvS4__EEE14isupgradedenumES4_E4typeERKSs"
GNU gdb (GDB) 7.10.1.20160210-cvs
[...]
std::enable_if<(!std::is_constructible<float<std::string> >::value)&&(!decltype (gorgon__enum_trait_locator((float)()))::isupgradedenum), float>::type Gorgon::String::To<float>(std::string const&)
(gdb)