Client crashes on map load on Linux
terencode opened this issue · 6 comments
Some info:
- OS: ArchLinux
- SDL2 version: 2.0.12
- cpu: ryzen 3600
- gpu: AMD R5 340X
- GCC 10.2
How I run the game:
- Get the latest official sauerbraten client from sourceforge
- Clone wc-ng
- go to src and
make
- copy
sauer-client
tolinux_64_client
at the official clientbin_unix
dir - Run the game
What happens is the game crashes when I try to load a map. This does not happen with the official client.
Here is the backtrace:
Thread 2 (Thread 0x7ffff6a5f640 (LWP 126541) "SDLTimer"):
#0 0x00007ffff7465014 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1 0x00007ffff7465118 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#2 0x00007ffff79a1f94 in ?? () from /usr/lib/libSDL2-2.0.so.0
#3 0x00007ffff790e468 in ?? () from /usr/lib/libSDL2-2.0.so.0
#4 0x00007ffff790dcff in ?? () from /usr/lib/libSDL2-2.0.so.0
#5 0x00007ffff79a16aa in ?? () from /usr/lib/libSDL2-2.0.so.0
#6 0x00007ffff745c3e9 in start_thread () from /usr/lib/libpthread.so.0
#7 0x00007ffff738a293 in clone () from /usr/lib/libc.so.6
Thread 1 (Thread 0x7ffff6ae1780 (LWP 126537) "linux_64_client"):
#0 0x00007ffff73efbf0 in __memmove_avx_unaligned_erms () from /usr/lib/libc.so.6
#1 0x00005555557f9825 in game::swayhudgun(int) ()
#2 0x00005555557ec9cb in game::updateworld() ()
#3 0x0000555555574605 in main ()
I can't figure out what's causing the crash.
- GCC 32 bit builds do not crash.
- GCC -O0 x86_64 doesn't crash
- -fsanitize=address doesn't show anything suspicious with Clang.
- GCC -O0 + -fsanitize=address doesn't show anything suspicious.
- GCC >= -Og = Crash. But I can't get a useful backtrace. Not even with -fsanitize=address.
I really think it's GCC miscompiling something. Wouldn't be the first time.
Build with clang as a workaround.
make CXX=clang++ CC=clang
Weird...
Building with clang works, thanks!
About the crash when compiled with gcc, It seems to crash each time a math function is called like exp(), pow(), log() ....
make GLIBCCOMPAT=0
should fix it. It's caused by the glibc quirks pisto recommended me one day.
Yes it works.
Are those quirks still needed?
I fixed it. I need it to make binaries which I compile on ArchLinux work on OSs with an older glibc.