Closed smcv closed 1 year ago
This is almost certainly my own ignorance, but I could not get this game to run against sdl12-compat with LD_LIBRARY_PATH or LD_PRELOAD and I can't figure out why.
[icculus@taise ~/projects/SDL-1.2/buildbot]$ readelf -d /usr/lib/games/glhack/glhack
Dynamic section at offset 0x1cf7f0 contains 30 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libSDL-1.2.so.0]
0x0000000000000001 (NEEDED) Shared library: [libGL.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpng16.so.16]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
[...]
I had to replace the system library with sdl12-compat, it just wouldn't let me override it any other way; nothing else has had this problem for me, any idea what would cause it?
(I'll look at the actual issue shortly either way, I'm just baffled by this.)
Ack, it's because /usr/lib/games/glhack/glhack is setuid root!
(I meant setgid, not setuid. See comments in #247 about setgid binaries vs LD_LIBRARY_PATH.)
setgid games, rather than setgid root. Same as https://github.com/libsdl-org/sdl12-compat/issues/247#issuecomment-1276887769
In this case disabling setgid breaks the game ("Cannot lock /var/games/glhack/perm
for unknown reason (1)", where 1 is probably EPERM
); but if I install libsdl1.2-compat-shim
version 1.2.58-1 (which replaces the libSDL-1.2.so.0
in the default library search path with sdl12-compat) then it seems to work fine.
If Debian moves to sdl12-compat as the default (like Fedora and Arch did), it'll be via something more like libsdl1.2-compat-shim
: the only reason I'm preferring to use LD_LIBRARY_PATH
for this round of testing is that using LD_LIBRARY_PATH
lets me compare sdl12-compat vs. classic SDL 1.2, so that when I see an apparent bug I can check whether it's a sdl12-compat regression or a pre-existing bug.
Prerequisites:
pipewire-pulse
emulating PulseAudioapt install glhack
(Debian package version1.2-4
)libsdl1.2-compat
either 1.2.58-1 (packaged in Debian experimental) or commit eba13ef (locally built)libsdl2-2.0-0
version2.24.1+dfsg-1
To reproduce:
glhack
LD_LIBRARY_PATH=.../sdl12-compat/_build glhack
SDL_VIDEODRIVER=wayland LD_LIBRARY_PATH=.../sdl12-compat/_build glhack
Expected result: all work
Actual result: with sdl12-compat and
SDL_VIDEODRIVER=wayland
, it fails with:Workaround: use X11.