View Issue Details

IDProjectCategoryView StatusLast Update
0004461DarkRadiantCompilation/Buildpublic10.08.2017 18:34
Reportergreebo Assigned Togreebo  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSSlackwareOS Version14.2 x86
Product Version2.1.0 
Target Version2.2.0Fixed in Version2.2.0 
Summary0004461: Crash at startup in std::string constructor (g++ 5.3)
DescriptionDarkRadiant compiles fine (based on commit f21215bacdeb140ce63799458864e6bb6eba5d09), but starting up the application yields a segfault right in the static constructors.
Additional InformationProgram received signal SIGSEGV, Segmentation fault.
0xb64a6275 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
(gdb) bt
0 0xffffffff in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () at /usr/lib/libstdc++.so.6
1 0x08150776 in std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (__lhs=..., __rhs=...) at /usr/include/c++/5.3.0/bits/basic_string.h:4788
2 0x083bcbe9 in Doom3PatchCreator::getName() const (this=0x86d9158) at patch/PatchCreators.cpp:39
3 0x083c9dc5 in module::StaticModule<Doom3PatchCreator>::StaticModule() (this=0x86a0e80 <doom3PatchDef3Creator>) at ./modulesystem/StaticModule.h:36
4 0x083c9c04 in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at patch/PatchModule.cpp:5
5 0x083c9cdd in _GLOBAL__sub_I_doom3PatchDef3Creator() () at patch/PatchModule.cpp:6
6 0x0842d915 in __do_global_ctors_aux ()
7 0x086d3670 in ()
8 0x080bc5c0 in _init ()
9 0x00000208 in ()
10 0x08686000 in _GLOBAL_OFFSET_TABLE_ ()
TagsNo tags attached.

Activities

greebo

greebo

07.01.2017 11:40

administrator   ~0008706

Last edited: 08.01.2017 03:51

Originally reported by Nightstalker here: http://forums.thedarkmod.com/topic/18594-darkradiant-crashes-immediately-under-slackware/

greebo

greebo

07.01.2017 12:18

administrator   ~0008707

It seems that (at least in) g++ 5.3, the generated code runs into problems due to static initialisation order. By the time the StaticModule constructor is called the std::string instances in the ipatch.h header seem to be uninitialised. Attempting to call the std::string::operator+ to concat "PatchDefModule" with "Def3" produces the segfault.

I'll work around this problem (which seems to be not an issue in the other compilers, likely due to luck?) by getting rid of the string concatenation altogether.
greebo

greebo

07.01.2017 12:34

administrator   ~0008708

Fixed in 32848a5841b5567d16e890258954f110346d929c

Issue History

Date Modified Username Field Change
07.01.2017 11:39 greebo New Issue
07.01.2017 11:40 greebo Note Added: 0008706
07.01.2017 11:40 greebo Status new => confirmed
07.01.2017 12:18 greebo Note Added: 0008707
07.01.2017 12:18 greebo Assigned To => greebo
07.01.2017 12:18 greebo Status confirmed => assigned
07.01.2017 12:34 greebo Note Added: 0008708
07.01.2017 12:34 greebo Status assigned => resolved
07.01.2017 12:34 greebo Fixed in Version => 2.2.0
07.01.2017 12:34 greebo Resolution open => fixed
07.01.2017 12:35 greebo OS => Slackware
07.01.2017 12:35 greebo Platform Slackware => Linux
08.01.2017 03:51 greebo Note Edited: 0008706
10.08.2017 18:34 greebo Status resolved => closed