-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steel Storm Burning Retribution demo: can crash with BadWindow, workaround: SDL12COMPAT_ALLOW_SYSWM=0 #290
Comments
This appears to be a game based on darkplaces (modified Quake). The same versions work well on a different test machine with: Debian 12 prerelease, AMD vega10, Mesa; and either GNOME (Wayland) or Xfce (Xorg). At this stage I'm unsure whether it's Ubuntu vs Debian or NVIDIA vs AMD/Mesa that is significant. |
For an apples-to-apples comparison, I booted both test machines into Debian 11 stable with GNOME (Xorg) and the same game works fine there; so this might be Ubuntu-specific or NVIDIA-driver-version-specific. I won't be able to test Ubuntu 22.04 on AMD or Debian 12 on NVIDIA until I've installed the relevant operating systems, which will take a while. |
So, interestingly, I couldn't reproduce this (with the full game, not the demo) just running the game through Steam (both with and without the pressure-vessel 'Steam Linux Runtime') on openSUSE Tumbleweed with nVidia/KDE/Wayland. However, if I ran the game directly (instead of via Steam), I get the same BadWindow error. It looks like the game is trying to set a window icon, and is passing NULL as the Window:
Using either |
FYI, I wasn't using the container/pressure-vessel "Steam Linux Runtime" for this testing, only the legacy |
I think openSUSE does some nasty patching to force Steam to use the distro versions of some libraries, rather than the Steam Runtime versions, so that might explain some of the differences. /proc/pid/maps definitely gives the distro version of sdl12-compat by default when launching through Steam, and it's exactly the same library running when I get BadWindow locally. Swapping out a self-compiled sdl12-compat doesn't change anything. (There are a bunch of other libraries which come from the steam runtime when run via Steam, and the distro otherwise, but SDL doesn't seem to be one of them. Just: |
Steel Storm (and presumably other darkplaces, SDL 1.2-based games) expect x11.wmwindow to be valid if they've created a window and are running under X11. Just pass the same game window like we do for x11.window. See the old darkplaces code here: https://github.com/xonotic/darkplaces/blob/a0465ad2ee16719587b0b7a80d4c1c2f7df1ac0e/vid_sdl.c#L2334 This should fix the BadWindow errors on Steel Storm Burning Retribution (issue libsdl-org#290)
I managed to track down the darkplaces code that causes the issue: It's using the x11.wmwindow field, which sdl12-compat never sets (as there's no SDL2 equivalent). Just setting it to be the same as x11.window fixes it for me (see PR #292), and is only slightly incorrect. (I did the same for x11.fswindow as well, just in case). Otherwise, adding a quirk to disable SDL12COMPAT_ALLOW_SYSWM seems like the other valid solution: the game has decent fallbacks if SysWM is unavailable. |
Being GPL'd code, you'll find this in your Steam install, too, fwiw:
|
I think this is the correct fix. There's no need to turn off sywm with a quirk, as it uses the API correctly, including when not running on X11, and doesn't do anything that seems to upset things if available. |
Steel Storm (and presumably other darkplaces, SDL 1.2-based games) expect x11.wmwindow to be valid if they've created a window and are running under X11. Just pass the same game window like we do for x11.window. See the old darkplaces code here: https://github.com/xonotic/darkplaces/blob/a0465ad2ee16719587b0b7a80d4c1c2f7df1ac0e/vid_sdl.c#L2334 This should fix the BadWindow errors on Steel Storm Burning Retribution (issue #290)
Okay, this is fixed by 32a06ea, thanks! |
Confirmed fixed with 1.2.64 + 2.26.5. |
To reproduce:
LD_LIBRARY_PATH
(I used a modified Steam Runtime replacing its bundled legacy SDL 1.2 with a backport of 1.2.62, based on 1.2.62-1 in Debian experimental)SDL12COMPAT_ALLOW_SYSWM=0
additionally in the environmentExpected result: all runs succeed
Actual result:
SDL12COMPAT_ALLOW_SYSWM=0
: OKThe text was updated successfully, but these errors were encountered: