ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
470 stars 38 forks source link

Segfault on Debian 11, can be worked around by using Steam Runtime's SDL #2254

Closed smcv closed 1 year ago

smcv commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

This might be related to Steam Runtime issue https://github.com/ValveSoftware/Dota-2/issues/2257. While trying to reproduce that issue, I encountered a segmentation fault with different symptoms.

https://github.com/ValveSoftware/Dota-2/issues/2257 is a segmentation fault on startup in Dota 2, but a key distinguishing factor in that report is that the issue reporters have said that downgrading "Steam Linux Runtime - soldier" to its previous_version branch is a workaround for their crash.

In my version of this crash, I'm seeing Dota 2 segfault on startup regardless of whether I downgrade "Steam Linux Runtime - soldier" to its previous_version branch, or keep it on the default branch, or upgrade to the client_beta version.

Workaround

There is a workaround for the crash I'm seeing: if I set Dota 2's Launch Options to

SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 %command%

to make it use the version of SDL that is maintained as part of "Steam Linux Runtime - soldier", then it no longer segfaults.

This suggests that Dota 2 developers could avoid this crash by either removing Dota 2's private copy of SDL and relying on the one from soldier, or upgrading it to match the version in soldier. [Edit: The reporter of https://github.com/ValveSoftware/Dota-2/issues/2257 has confirmed that this is also a workaround for their similar crash.]

The SDL version in the default branch of soldier is 2.26.2, but this version is known to have a regression for game controller hotplugging. The version in the client_beta branch is 2.26.3 with https://github.com/libsdl-org/SDL/commit/6edc0100e1a309aac924bcc1a71087903ab074f4 applied as a patch, fixing that regression. The beta version will be copied to the default branch when we are more confident that it doesn't cause any bad regressions, but we were concerned that it might be causing Dota 2 crashes similar to this one, which has delayed that.

Steps for reproducing this issue:

  1. Update system as of 2023-02-22
  2. Run steam (beta branch in desktop mode, in case it matters) from a terminal
  3. Library -> Dota 2 -> Properties -> General -> Launch Options, set to empty
  4. Library -> Dota 2 -> Properties -> Compatibility is set to "Steam Linux Runtime" (this is the default if I understand correctly)
  5. Launch Dota 2
  6. Skip processing of Vulkan shaders
  7. Dota 2 never appears (it crashes as soon as the "Processing Vulkan shaders..." window closes)
  8. Alt-tab to terminal, observe error message .../game/dota2.sh: line 109: 8549 Segmentation fault
  9. It uploads a minidump, my CrashID was bp-f1cf2da3-51c9-4a75-8c45-9c07c2230222 for my most recent attempt
smcv commented 1 year ago

Log file for a crash with launch options STEAM_LINUX_RUNTIME_VERBOSE=1 STEAM_LINUX_RUNTIME_LOG=1 %command%:

dota2-issue2254-bad.log.gz

Log file with workaround, same launch options plus SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0:

dota2-issue2254-workaround.log.gz

smcv commented 1 year ago

This might have been resolved by the recent update, I'll try to re-test tomorrow.

smcv commented 1 year ago

This is now working for me on Debian 11. It was probably fixed by the 2023-03-09 "Dead Reckoning Update", which included an upgraded SDL.