#920523 libgl1-mesa-dri: segfault in /usr/lib/i386-linux-gnu/dri/r600_dri.so

Package:
libgl1-mesa-dri
Source:
mesa
Description:
free implementation of the OpenGL API -- DRI modules
Submitter:
Samuel Moll
Date:
2023-10-07 01:09:02 UTC
Severity:
normal
Tags:
#920523#5
Date:
2019-01-26 15:40:09 UTC
From:
To:
Dear Maintainer,

after updating via aptitude some days ago (Debian testing), the game
"Neverwinter Nights" (linux native version, 32bit) doesn't run anymore; When
starting the game, it just hangs forever (maybe one thread is waiting for the
segfaulted one); I don't know if the problem is really in libgl1-mesa-dri:i386,
but using gdb gives me a segfault in /usr/lib/i386-linux-gnu/dri/r600_dri.so.

I tried to install libgl1-mesa-dri-dbg to get more debug information, but the
new (18.3.2-1) debug package doesn't seem to be available yet. Aptitude says:
"Some dependencies of libgl1-mesa-dri-dbg:i386 (broken) are not satisfied:
libgl1-mesa-dri-dbg:i386 (install, 10.6.8-1) depends on libgl1-mesa-dri:i386 (=
10.6.8-1)".

I also tried to revert libgl1-mesa-dri back to 10.6.8-1 to verify that the game
works with that version, but couldn't get all the dependent packages to resolve
(somehow even xorg seems to depend on that specific version of the package, and
the dependencies spill over from the i386 versions to the amd64 ones).

I don't really know how to find the root of the problem further, but I'd be
more than happy to help in finding the cause.


using gdb gives me:

user@computer:~/nwn$ gdb nwmain
GNU gdb (Debian 8.2-1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nwmain...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/user/nwn/nwmain
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0xf6cb1b40 (LWP 21475)]
[New Thread 0xf5a75b40 (LWP 21476)]
[New Thread 0xf5274b40 (LWP 21477)]

Thread 1 "nwmain" received signal SIGSEGV, Segmentation fault.
0xf43b5eba in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
(gdb) bt
#0  0xf43b5eba in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
#1  0xf7987a8a in bool std::has_facet<std::ctype<char> >(std::locale const&) ()
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#2  0xf79796cf in std::basic_ios<char, std::char_traits<char>
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#3  0xf7979b2b in std::basic_ios<char, std::char_traits<char>
/usr/lib/i386-linux-gnu/libstdc++.so.6
#4  0xf7973f96 in std::basic_ofstream<char, std::char_traits<char>
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5  0xf35925fc in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
#6  0xf7fe4283 in ?? () from /lib/ld-linux.so.2
#7  0xf7fe4382 in ?? () from /lib/ld-linux.so.2
#8  0xf7fe7fc0 in ?? () from /lib/ld-linux.so.2
#9  0xf7bdd53a in _dl_catch_exception () from /lib/i386-linux-gnu/libc.so.6
#10 0xf7fe786e in ?? () from /lib/ld-linux.so.2
#11 0xf7a1d2c3 in ?? () from /lib/i386-linux-gnu/libdl.so.2
#12 0xf7bdd53a in _dl_catch_exception () from /lib/i386-linux-gnu/libc.so.6
#13 0xf7bdd5d0 in _dl_catch_error () from /lib/i386-linux-gnu/libc.so.6
#14 0xf7a1da71 in ?? () from /lib/i386-linux-gnu/libdl.so.2
#15 0xf7a1d366 in dlopen () from /lib/i386-linux-gnu/libdl.so.2
#16 0xf499eb8d in ?? () from /usr/lib/i386-linux-gnu/libGLX_mesa.so.0
#17 0xf49a7a10 in ?? () from /usr/lib/i386-linux-gnu/libGLX_mesa.so.0
#18 0xf4993308 in ?? () from /usr/lib/i386-linux-gnu/libGLX_mesa.so.0
#19 0xf498e525 in ?? () from /usr/lib/i386-linux-gnu/libGLX_mesa.so.0
#20 0xf498f428 in ?? () from /usr/lib/i386-linux-gnu/libGLX_mesa.so.0
#21 0xf7cc0d1e in ?? () from /usr/lib/i386-linux-gnu/libSDL-1.2.so.0
#22 0xf7cc5e79 in ?? () from /usr/lib/i386-linux-gnu/libSDL-1.2.so.0
#23 0xf7cc6390 in ?? () from /usr/lib/i386-linux-gnu/libSDL-1.2.so.0
#24 0xf7cb5770 in SDL_SetVideoMode () from /usr/lib/i386-linux-
gnu/libSDL-1.2.so.0
#25 0x084d1b4d in ?? ()
#26 0x080508b5 in ?? ()
#27 0x0805d896 in ?? ()
#28 0x0805adc0 in ?? ()
#29 0x08059ae5 in ?? ()
#30 0x0804fb57 in ?? ()
#31 0xf7ac2b41 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
#32 0x0804f851 in ?? ()
(gdb)

#920523#10
Date:
2020-02-10 12:28:47 UTC
From:
To:
I reliably reproduce this segmentation fault on Bullseye/Sid, a more
detailed gdb backtrace is attached as nwmain-backtrace.txt. In case it
might help, I added the output of ltrace (nwmain-ltrace.txt) and strace
(nwmain-strace.txt).

This has been reported on ./play.it (a games installer) issues tracker
too: https://forge.dotslashplay.it/play.it/games/issues/139
I’ll relay here everything useful we might find on ./play.it side.

#920523#15
Date:
2023-10-07 00:58:04 UTC
From:
To:
It took me a while to understand that, but the crash is actually due to a symbol conflict between the old game binaries and current libstdc++.so.6.

Patched binaries are available here: https://downloads.dotslashplay.it/games/neverwinter-nights-1/

And the explanation about how they have been patched:
"""
The original binaries nwmain and nwserver have a symbol conflict with modern libstdc++.so.6.
patchelf has been used to patch the binaries and rename the conflicting symbol (__dynamic_cast).

Big thanks to Phil Morrell, who used a similar method to patch Unreal Tournament libraries.
Without their work I would not have known how to fix this.
"""

I suggest closing this bug report, especially now that we know that this was not really related to libgl1-mesa-dri in the first place.