tpoechtrager / wc-ng

WC-NG - Cube 2: Sauerbraten Modification
Other
21 stars 3 forks source link

Client crashes on map load on Linux #9

Closed terencode closed 3 years ago

terencode commented 3 years ago

Some info:

How I run the game:

  1. Get the latest official sauerbraten client from sourceforge
  2. Clone wc-ng
  3. go to src and make
  4. copy sauer-client tolinux_64_client at the official client bin_unix dir
  5. 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 ()
tpoechtrager commented 3 years ago

I can't figure out what's causing the crash.

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

terencode commented 3 years ago

Weird...

Building with clang works, thanks!

terencode commented 3 years ago

About the crash when compiled with gcc, It seems to crash each time a math function is called like exp(), pow(), log() ....

tpoechtrager commented 3 years ago

make GLIBCCOMPAT=0 should fix it. It's caused by the glibc quirks pisto recommended me one day.

terencode commented 3 years ago

Yes it works. Are those quirks still needed?

tpoechtrager commented 3 years ago

I fixed it. I need it to make binaries which I compile on ArchLinux work on OSs with an older glibc.