Compiler segfaults on EffectPaser.cpp

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Compiler segfaults on EffectPaser.cpp

#1 Post by o01eg »

When I try to compile the freeorion I get error:
$ LANG="en_US.UTF-8" make
[ 40%] Built target core_static
Scanning dependencies of target parse_static
[ 41%] Building CXX object CMakeFiles/parse_static.dir/parse/EffectParser.cpp.o
c++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <http://bugs.gentoo.org/> for instructions.
make[2]: *** [CMakeFiles/parse_static.dir/parse/EffectParser.cpp.o] Error 1
make[1]: *** [CMakeFiles/parse_static.dir/all] Error 2
make: *** [all] Error 2
gcc 4.5.3
boost 1.48.0
GG and freeorion from trunk [rev 5153]en_US.UTF-8
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiler segfaults on EffectPaser.cpp

#2 Post by Geoff the Medio »

How much RAM do you have? The parsers use a bunch of Boost templates and tend to use quite a lot of memory to compile.

I also build (on Windows) against Boost 1.47, so there might be an issue specific to 1.48.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Compiler segfaults on EffectPaser.cpp

#3 Post by o01eg »

Geoff the Medio wrote:How much RAM do you have? The parsers use a bunch of Boost templates and tend to use quite a lot of memory to compile.

I also build (on Windows) against Boost 1.47, so there might be an issue specific to 1.48.
I've 6 GB RAM and 6 GB swap but I'm not sure that compiler get all memory.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: Compiler segfaults on EffectPaser.cpp

#4 Post by raptor »

I can confirm GCC (in my case: 4.6.2) segfaults on compiling here for 0.4.1. I have compiled on two different Linux machines, both x86_64. One had 4GB RAM (4 threads), the other 12 GB (8 threads).

Edit: I forgot to mention that I'm using boost 1.49.0 headers.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiler segfaults on EffectPaser.cpp

#5 Post by Geoff the Medio »

Do any of the other parser cpp files crash the compiler if compiled individually? For that matter, does EffectParser.cpp crash if compiled on its own, rather than as part of a whole-project build?

If it's just that file and it always crashes, I can try splitting it up similar to the Condition parsers.

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: Compiler segfaults on EffectPaser.cpp

#6 Post by raptor »

All other parse compilation units completed. Only EffectParser.cpp.o slowly fills up all remaining RAM until gcc crashes..

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: Compiler segfaults on EffectPaser.cpp

#7 Post by raptor »

I did some more tests...

I don't believe it is a RAM issue anymore. Swapping out optimizations:
-O3 fails
-O2 fails
-O1 compiles
-g compiles

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: Compiler segfaults on EffectPaser.cpp

#8 Post by raptor »

It looks like EffectsParser.cpp also caused a compiler segfault in freeorion 0.4.0 about 50% of the time. I just looked at the packaging logs when building the RPMs for openSUSE and it frequently failed on that file with a GCC segfault (OOM). It only succeeded a few times when server loads was low and it could use loads of memory.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiler segfaults on EffectPaser.cpp

#9 Post by Geoff the Medio »

I've split the effect parser into two source files in SVN. Let me know whether that helps the compile finish...

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Compiler segfaults on EffectPaser.cpp

#10 Post by o01eg »

Thanks. Freeorion successfully compiled. But it crashes if I use rus_stringtable.txt and shows artifacts around text: viewtopic.php?f=9&t=6165
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compiler segfaults on EffectPaser.cpp

#11 Post by Geoff the Medio »

The issue with font artifacts is extensively discussed. Most recently here: viewtopic.php?f=24&t=6753 and here: viewtopic.php?f=25&t=6715

I'm not aware of any crashes specifically with a different stringtable. You should probably make a separate thread about that.

raptor
Space Squid
Posts: 87
Joined: Sat Jun 02, 2012 11:29 pm

Re: Compiler segfaults on EffectPaser.cpp

#12 Post by raptor »

I have back-ported the fix to patch against 0.4.1. See attached.

[The extension diff has been deactivated and can no longer be displayed.]


Post Reply