Skip to content
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

Shadow Warrior (233130) hangs on exit with SLR and gamemode #234

Open
2 tasks done
XakepSDK opened this issue Feb 22, 2020 · 11 comments
Open
2 tasks done

Shadow Warrior (233130) hangs on exit with SLR and gamemode #234

XakepSDK opened this issue Feb 22, 2020 · 11 comments

Comments

@XakepSDK
Copy link

XakepSDK commented Feb 22, 2020

Compatibility Report

  • Name of the game with compatibility issues: Shadow Warrior
  • Steam AppID of the game: 233130

System Information

I confirm:

  • that I haven't found an existing compatibility report for this game.
  • that I have checked whether there are updates for my system available.

Symptoms

When i start game with SLR, game has no text. Instead of actual text, i see text keys, e.g. UI_menu_exit
Game freezes when i exit it using game menu option

Reproduction

Start game with SLR
Note: game was launched with gamemode from feral, this version was used: FeralInteractive/gamemode@d5620e8

@smcv
Copy link
Contributor

smcv commented Mar 9, 2020

If you run Steam from a terminal (as steam), and then run this game, what output does Steam produce?

When i start game with SLR, game has no text. Instead of actual text, i see text keys, e.g. UI_menu_exit

That sounds like a localization issue. I notice you're using a German locale. If you set the launch command to env LC_ALL=en_US.UTF-8 %command% (which will tell the game to run in English), does that work any better?

Game freezes when i exit it using game menu option

That might be related to the locale/strings issue, or unrelated.

Note: game was launched with gamemode from feral

Can you reproduce these bugs without gamemode? Just to isolate whether gamemode is affecting it.

@XakepSDK
Copy link
Author

XakepSDK commented Mar 12, 2020

Gamemode affects game. Without gamemode, game launches and exits fine with and without SLR.

Game still have localization issue with SLR. env LC_ALL=en_US.UTF-8 %command% does not help.
Language selected in shadow warrior steam game properties - english
Game startup time significantly is higher with SLR.

I found game logs, they have something interesting.
With SLR: https://gist.github.com/XakepSDK/76dd02fd44e8b3bbf3cb94c2fd3dd757
Without SLR: https://gist.github.com/XakepSDK/38b59496540421ebecc5366ad5a62738

@smcv
Copy link
Contributor

smcv commented Mar 12, 2020

You seem to have two separate issues with this game:

  • The untranslated strings in the menu
  • The game freezes on exit if you are running it in the SteamLinuxRuntime container and using Feral's gamemode

so let's use #242 to represent the untranslated strings, with this issue tracking only the freeze.

Were those logs with or without gamemode? Please could you get another two sets of logs, so that we can compare all four situations: (with/without) gamemode, and (with/without) the SteamLinuxRuntime container?

Game startup time significantly is higher with SLR

This is expected. The container runtime has to do a lot of setup, and at the moment we repeat all that setup every time you launch a game. For now the focus is on making it correct, rather than on making it fast (it can be optimized later, when we have it working reliably).

@smcv
Copy link
Contributor

smcv commented Mar 12, 2020

@kisak-valve, would you mind retitling this to "Shadow Warrior (233130) hangs on exit with SLR and gamemode" or something similar?

@kisak-valve kisak-valve changed the title Shadow Warrior (233130) Shadow Warrior (233130) hangs on exit with SLR and gamemode Mar 12, 2020
@XakepSDK
Copy link
Author

@smcv it's most likely gamemode issue since game does not start at all with it enabled
I tested Shadow Warrior with SLR and gamemode and it didn't hang when exited.

Let me re-test everything and group issues, so it's more understandable:

  1. With SLR:
    No localization
    Slow startup

  2. Without SLR
    Runs fine

  3. With SLR and with gamemode
    No localization
    Slow startup

  4. Without SLR and with gamemode
    Game crashes

About slow startup - when i start game, cursor almost immediately changes to in-game one, but game does not render anything. After 15-20 seconds it starts to rendering. I think solving gconv issue will fix this.

@smcv
Copy link
Contributor

smcv commented Mar 13, 2020

About slow startup - when i start game, cursor almost immediately changes to in-game one, but game does not render anything.

OK, that's not expected. The extra delays that we expect the container runtime to cause are before the game gets a chance to display anything.

@smcv
Copy link
Contributor

smcv commented Mar 13, 2020

Let me re-test everything and group issues, so it's more understandable

Thanks, that helps. Which of those four cases has the freeze/hang on exit? From what you said before, I think it's only case 3, but please confirm.

If it's case 3, the most interesting logs to compare would be from cases 3 and 4.

@smcv
Copy link
Contributor

smcv commented Mar 13, 2020

If it's case 3, the most interesting logs to compare would be from cases 3 and 4.

... and also from 1 and 3, in fact.

Which cases are the logs you already posted?

@XakepSDK
Copy link
Author

  1. I can't reproduce hang case now no matter what i tried. But when game hung, it was 3 only case.
  2. Logs are from 1 and 2 case runs

@RyuzakiKK
Copy link
Contributor

I'm able to reproduce the issue when I launch the game without SLR and with the launch option gamemoderun %command%.

It appears that this problem is caused by the fact that the main game executable is 32bit, while some of the other subprocesses are 64bit. And because gamemode preloads LD_PRELOAD="libgamemodeauto.so.0", we end up loading both versions of this library and this crashes the game.

For example if I preload only the 64bit version it crashes:

LD_PRELOAD="/usr/lib/libgamemodeauto.so.0" ./ShadowWarrior.bin.x86 
ERROR: ld.so: object '/usr/lib/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Initializing Packs System...
JobSystem starting with 6 threads
Setting breakpad minidump AppID = 233130
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561199188348302 [API loaded no]
[1]    39165 segmentation fault (core dumped)  LD_PRELOAD="/usr/lib/libgamemodeauto.so.0" ./ShadowWarrior.bin.x86

When I preload only the base library name it crashes too:

LD_PRELOAD="libgamemodeauto.so.0" ./ShadowWarrior.bin.x86 
Initializing Packs System...
JobSystem starting with 6 threads
Setting breakpad minidump AppID = 233130
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561199188348302 [API loaded no]
[1]    39299 segmentation fault (core dumped)  LD_PRELOAD="libgamemodeauto.so.0" ./ShadowWarrior.bin.x86

Instead, if I just set the 32bit version it works:

LD_PRELOAD="/usr/lib32/libgamemodeauto.so.0" ./ShadowWarrior.bin.x86
Initializing Packs System...
JobSystem starting with 6 threads
Setting breakpad minidump AppID = 233130
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561199188348302 [API loaded no]
ERROR: ld.so: object '/usr/lib32/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

It appears that this is the external 64bit executable that leads to preloading the 64bit version of libgamemodeauto.so.0:

28868 12:27:26 execve("/bin/sh", ["sh", "-c", "pulseaudio --check > /dev/null 2"...], 0xaa7eb90 /* 84 vars */ <unfinished ...>
28805 12:27:26 <... clone resumed>)     = 28868 <0.001857>
28805 12:27:26 munmap(0xf2a05000, 36864) = 0 <0.000008>
28805 12:27:26 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0 <0.000004>
28805 12:27:26 wait4(28868,  <unfinished ...>
28868 12:27:26 <... execve resumed>)    = 0 <0.000111>
28868 12:27:26 brk(NULL)                = 0x55efcd6ed000 <0.000004>
28868 12:27:26 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffd996fc1c0) = -1 EINVAL (Invalid argument) <0.000004>
28868 12:27:26 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000007>
28868 12:27:26 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=186748, ...}, AT_EMPTY_PATH) = 0 <0.000005>
28868 12:27:26 mmap(NULL, 186748, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9e62f2f000 <0.000005>
28868 12:27:26 close(3)                 = 0 <0.000004>
28868 12:27:26 openat(AT_FDCWD, "/usr/lib/libgamemodeauto.so.0", O_RDONLY|O_CLOEXEC) = 3 <0.000006>

@RyuzakiKK
Copy link
Contributor

This is the upstream issue FeralInteractive/gamemode#196, and it seems to confirm that forcing the preload of just the library with the correct ABI is enough to fix the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants