flathub / com.valvesoftware.Steam

https://flathub.org/apps/details/com.valvesoftware.Steam
339 stars 69 forks source link

Hitman™ (2016): Crashes with locale error #497

Open ananace opened 4 years ago

ananace commented 4 years ago

Game information

Hitman™

Distribution name and version where applicable

Sabayon Linux amd64 19.10

Flatpak info

--version Flatpak 1.4.0 --gl-drivers default host

Problem description

Hitman™ crashes instantly on clicking play in the Feral launcher. The output contains the very damning

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid

Tested overriding LANG and LC_ALL - both as a launch option as well as for the entirety of Steam - with plain en_US.utf8 to no effect.

Does this issue reproduce with native Steam

No

andreldmonteiro commented 4 years ago

Test with SHARED_LIBRARY_GUARD=0

ananace commented 4 years ago

In the launch options / env for the game? Or as an env override on the Flatpak itself?

andreldmonteiro commented 4 years ago

For the flatpak

ananace commented 4 years ago

Well, I tested with both just to be sure, but the exact same error anyway. Even completely reset my overrides too to just that env var, and yet the same error.

The full output, from the point of pressing play on the launcher to the displayed crash window is;

SDL2 initialised [built against 2.0.5, running with 2.0.5]
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
HitmanPro: dumped to "/home/ace/.local/share/feral-interactive/HITMAN/crashes/369f6a82-62e0-39a8-567fbf28-22c1f026.dmp"
HitmanPro: crash reporter "/home/ace/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Hitman™/bin/feral_linux_crash_reporter" launching
Game crashed with signal 6
Game crashed with signal SIGABRT(6): Program Aborted.

If possible, launch Steam from command line to check the output when the game is run.
Then, contact support@feralinteractive.com with the details of the output, your Steam System Info, as well as the dump file:
/home/ace/.local/share/feral-interactive/HITMAN/crashes/369f6a82-62e0-39a8-567fbf28-22c1f026.dmp
/home/ace/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Hitman™/bin/feral_linux_crash_reporter: line 45: notify-send: command not found
nanonyme commented 4 years ago

Is this a Proton game?

nanonyme commented 4 years ago

I would suggest trying LD_PRELOAD=/usr/lib/$LIB/libSDL2.so.0 to see if this is yet another interesting forward-compatibility issue with SDL2 2.0.10.

ananace commented 4 years ago

This is a native game, a Feral port after all.

And it's using a packaged version of SDL2 by default.

nanonyme commented 4 years ago

I would say shared-library-guard is not loaded at all then. It's breaking on its own.

ananace commented 4 years ago

Tested replacing the packaged SDL2 libs with symlinks to the ones in /usr as well, no change;

SDL2 initialised [built against 2.0.5, running with 2.0.10]
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
nanonyme commented 4 years ago

Okay. Thanks for testing. I've seen these errors before, never really understood. Btw, it's en_US.UTF8, not en_US.utf8.

ananace commented 4 years ago

I think that to be perfectly correct it'd be en_US.UTF-8, but those are all treated equivalently by glibc.

Either way, I actually discovered a fix for the issue. In steamapps/common/Hitman™/HitmanPro.sh, lines 163-166;

# LC_ALL has caused users many issues in the past and generally is just
# used for debugging
# Uncomment this line if LC_ALL was needed (sometimes on openSUSE)
unset LC_ALL

Commenting out the unset LC_ALL fixes the missing C locale issue, and probably explains why my own attempts to set LC_ALL in the launch arguments had no effect.

nanonyme commented 4 years ago

Wait, you said missing C locale? Then it's probably one of these two workarounds for other games that's breaking it https://github.com/flathub/com.valvesoftware.Steam/blob/beta/com.valvesoftware.Steam.yml#L37 ; I don't to be honest understand how C locale could be missing completely. C.UTF-8 is a thing only with 20.08 https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/812 but C....

nanonyme commented 4 years ago

See https://github.com/flathub/com.valvesoftware.Steam/issues/112#issuecomment-415991416 https://github.com/flathub/com.valvesoftware.Steam/issues/62#issuecomment-415995666

nanonyme commented 4 years ago

LC_COLLATE=C was added by me going through Steam community for workarounds to different games, it wasn't through fixing issues. Might want to check if it's that.

ananace commented 4 years ago

Well, missing C locale was my assumption at least, it's possible that it's completely unrelated. Though I did test a whole lot of other locale configurations.

I'll do some more debugging and testing tomorrow when it's not midnight.

nanonyme commented 4 years ago

Did you have time to test which variable was the problematic one? We could potentially have more fine-grained locale fixing in shared-library-guard

ananace commented 4 years ago

Sorry, gotten absolutely buried in work, so I haven't had the time or energy to do any more testing.

I'll report back as soon as I can.