compile error with master HEAD
Moderator: Forum Moderators
compile error with master HEAD
Hello everone, I just wanted to build a debug version from master:
libboost-*-dev 1.74.0.3
libsdl2-dev 2.0.14+dfsg2-3
libsdl2-image-dev 2.0.5+dfsg1-2
libsdl2-mixer-dev 2.0.4+dfsg1-3
libsdl2-ttf-dev 2.0.15+dfsg1-1
libfontconfig-dev 2.13.1-4.2
libcairomm-1.0-dev 1.12.2-4
libpango1.0-dev 1.46.2-3
libvorbis-dev 1.3.7-1
libz3-dev 4.8.10-1
libssl-dev 1.1.1i-3
tools:
g++ 10.2.1-1
cmake 3.18.4
GNU Make 4.3
Did I missed something? Probably not a usual compiler error, but the compiler crashed for some segmentation fault reason?
Thank you in advance
/Fleance
And got this error:git clone "https://github.com/wesnoth/wesnoth.git" wesnoth
cd wesnoth
mkdir build && cd build
cmake .. -DCMAKE_BUILD=Debug -DCMAKE_INSTALL_PREFIX=/home/chris/project/usr
make
I build it on Debian testing/sid with the following libraries:In file included from <command-line>:
/usr/include/stdc-predef.h: In substitution of 'template<class _Functor, class, class> std::function<std::__cxx11::basic_string<char>(gui2::slider&)>::function(_Functor) [with _Functor = <missing>; <template-parameter-1-2> = <missing>; <template-parameter-1-3> = <missing>]':
/home/chris/project/wesnoth/src/gui/dialogs/editor/generator_settings.cpp:60:52: required from here
/usr/include/stdc-predef.h:32:72: internal compiler error: Segmentation fault
32 | whether the overall intent is to support these features; otherwise,
| ^
0x7f97a9c06d5f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f97a9bf1d09 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
make[2]: *** [src/CMakeFiles/wesnoth-client.dir/build.make src/CMakeFiles/wesnoth-client.dir/gui/dialogs/editor/generator_settings.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:496: src/CMakeFiles/wesnoth-client.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
libboost-*-dev 1.74.0.3
libsdl2-dev 2.0.14+dfsg2-3
libsdl2-image-dev 2.0.5+dfsg1-2
libsdl2-mixer-dev 2.0.4+dfsg1-3
libsdl2-ttf-dev 2.0.15+dfsg1-1
libfontconfig-dev 2.13.1-4.2
libcairomm-1.0-dev 1.12.2-4
libpango1.0-dev 1.46.2-3
libvorbis-dev 1.3.7-1
libz3-dev 4.8.10-1
libssl-dev 1.1.1i-3
tools:
g++ 10.2.1-1
cmake 3.18.4
GNU Make 4.3
Did I missed something? Probably not a usual compiler error, but the compiler crashed for some segmentation fault reason?
Thank you in advance
/Fleance
Re: compile error with master HEAD
It's a bug in GCC, for which the fix has been added to Debian's Experimental distro but not yet to their Testing or Unstable distros. Personally, I've downgraded to the 10.2.1-3 versions of the compiler packages.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=980429
https://bugs.debian.org/cgi-bin/bugrepo ... bug=980429
Re: compile error with master HEAD
You could try compiling with
On an unrelated note, shouldn't
-DCMAKE_CXX_COMPILER=clang
and see if that works.On an unrelated note, shouldn't
-DCMAKE_BUILD=Debug
be -DCMAKE_BUILD_TYPE=Debug
?Re: compile error with master HEAD
Has the bug been reported to upstream GCC's bugzilla as well?octalot wrote: ↑February 20th, 2021, 11:47 pm It's a bug in GCC, for which the fix has been added to Debian's Experimental distro but not yet to their Testing or Unstable distros. Personally, I've downgraded to the 10.2.1-3 versions of the compiler packages.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=980429
Wesnoth-related GitHub repos:
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager
Re: compile error with master HEAD
It appears to be fixed already upstream.
Re: compile error with master HEAD
Opps, didn't saw that. But it was accepted anyway. And g++ build the whole project without crashing one time with this option. I guess this is just coincidental.
Re: compile error with master HEAD
It is, very much so. I normally need to run scons about 4 times before the problematic files will be compiled successfully, but sometimes it's more, less, or far more rarely gcc decides not to crash on the first attempt. It's really confusing to see the fix in an upload to experimental instead of sid but I guess the Debian devs know what they are doing.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: compile error with master HEAD
More than a year later i get the same compile error with latest source tarball 1.16.5 and g++ 10.2.1-6 (on Debian 5.10 x64) so i guess it hasnt really been fixed upstream.
The fellow who filed the bug report mentioned above also sent a test source file so you can check your compiler, and sure enough mine fails every second or 3rd attempt. I have attached it herewith so you can find it easily; the command to test for the bug is
Thanks to this thread however, i realized i can just type make again and it will continue from where it left off and eventually succeed.
Not really pleased about the soundness of this approach though - how do we know a faulty compiler is generating good, safe code?
The fellow who filed the bug report mentioned above also sent a test source file so you can check your compiler, and sure enough mine fails every second or 3rd attempt. I have attached it herewith so you can find it easily; the command to test for the bug is
Code: Select all
g++ -std=c++17 -Wno-return-type -c gcc-10-segfault.C
Not really pleased about the soundness of this approach though - how do we know a faulty compiler is generating good, safe code?
- Attachments
-
- gcc-10-segfault.C
- (14.99 KiB) Downloaded 68 times
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: compile error with master HEAD
Another option of course would be to build with clang instead of gcc until it's fixed.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code