You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shadowrun Returns (234650) not launching after recent Steam runtime update #317
Are you using the Steam Linux Runtime compatibility tool?: No (same issue if using compatibility tool)
Please describe your issue in as much detail as possible:
After recent Steam runtime update Shadowrun Returns fails to launch. Game window opens and immediately closes. Log file has errors about library files failing to load: libsteamwrap.so. gist with full error log
Could this be related to LD_LIBRARY_PATH improvements made in new version of Steam runtime?
/home/REDACTED/.local/share/Steam/steamapps/common/Shadowrun Returns/Shadowrun_Data/Plugins/x86/libsteamwrap.so : Could not load a dll file. Make sure that the steam_api.dll/libsteam_api.dylib file is placed at the correct location. See the documentation for more info. looks like a line of interest from the log. Looks like the game has multiple steam_api.so files in various folders.
If your LD_LIBRARY_PATH outside Steam happens to be completely empty or unset (which is the most common situation), then this results in something like
so Steam and games will load libraries from whatever their current working directory happens to be at the time.
This was probably not meant to happen, but it looks as though Shadowrun Returns might be relying on the fact that it does happen. When Steam launches a game, the current working directory is usually set to the game's top-level directory, so dlopening libsteam_api.so will find ./libsteam_api.so. This also explains how Mount & Blade Warband (#301) can ever have worked, and explains why it doesn't work in the container environment, which never had this bug.
However, I don't think we want to go back to precisely the old behaviour, because in rare circumstances it can be a security vulnerability: if a game changes directory to an untrusted directory where other users have write access, most commonly /tmp or /var/tmp, then we definitely don't want to load libraries from that directory.
Now we have two changes:
if LD_LIBRARY_PATH is set at the system level, we put it first, rather than last;
if it's empty or unset, we correctly don't add an extra :
If games were relying on this, then we should probably put the game's working directory at the end of the LD_LIBRARY_PATH, like it (effectively) was before, so that libraries get loaded from the game's directory but only if there is no version from the Steam Runtime or the OS. That would bring back more or less the old behaviour. But we should probably use the absolute path to the game, instead of . or the empty string, to avoid the /tmp attack - and we can't do that from run.sh, because run.sh is only run once for the entire Steam session, not once per game.
As a workaround, you could try that approach by setting the Launch Options to something like this:
@TTimo, would it be feasible to make the Steam client do the equivalent of that every time it launches a Steam Runtime game? It's probably best if we don't do it for non-Steam games, or for games that run via a compat tool.
Being the current maintainer of Simutrans, I can say this also affected the game. Previous maintainer assumed that Steam Runtime simply picked up the libraries from the game root directory. Some users reported this same issue a month ago when using the beta version, so I was aware that this could happen, but I was also expecting either a "fix" or an announcement before this important change :-/
I've already updated the game to correctly set LD_LIBRARY_PATH, but probably more games assumed this, and I wouldn't expect all of them to update to address this change, so a solution is indeed necessary.
Hello, per "Fix a regression of support for some native titles (steam-runtime#317)" in the 2020-12-10 Steam client beta update, please opt into Steam's beta client and retest this issue.
Works for me also (actually, all three of Shadowrun titles started working).
Confusing though, I noticed some strange behaviour with scaling for fullscreen resolutions (in my case, it's "desktop" resolution of 1920x1080) and can't remember anything like this before. Could this be connected to the update?
I noticed some strange behaviour with scaling for fullscreen resolutions (in my case, it's "desktop" resolution of 1920x1080) and can't remember anything like this before
Please open a separate issue with full details: there isn't much we can do with "some strange behaviour".
Activity
kisak-valve commentedon Dec 9, 2020
/home/REDACTED/.local/share/Steam/steamapps/common/Shadowrun Returns/Shadowrun_Data/Plugins/x86/libsteamwrap.so : Could not load a dll file. Make sure that the steam_api.dll/libsteam_api.dylib file is placed at the correct location. See the documentation for more info.looks like a line of interest from the log. Looks like the game has multiple steam_api.so files in various folders.joshas commentedon Dec 9, 2020
There are three
libsteam_api.sofiles in game directory:All three of them have identical contents.
smcv commentedon Dec 9, 2020
I suspect this might be a regression in
run.shin 914de96 (#274), caused by making the code arguably more correct...Previously, we set
LD_LIBRARY_PATHinside the Steam Runtime environment like this:If your
LD_LIBRARY_PATHoutside Steam happens to be completely empty or unset (which is the most common situation), then this results in something likewith an extra
:at the end.ld.sointerprets this as equivalent toso Steam and games will load libraries from whatever their current working directory happens to be at the time.
This was probably not meant to happen, but it looks as though Shadowrun Returns might be relying on the fact that it does happen. When Steam launches a game, the current working directory is usually set to the game's top-level directory, so dlopening
libsteam_api.sowill find./libsteam_api.so. This also explains how Mount & Blade Warband (#301) can ever have worked, and explains why it doesn't work in the container environment, which never had this bug.However, I don't think we want to go back to precisely the old behaviour, because in rare circumstances it can be a security vulnerability: if a game changes directory to an untrusted directory where other users have write access, most commonly
/tmpor/var/tmp, then we definitely don't want to load libraries from that directory.Now we have two changes:
LD_LIBRARY_PATHis set at the system level, we put it first, rather than last;:If games were relying on this, then we should probably put the game's working directory at the end of the
LD_LIBRARY_PATH, like it (effectively) was before, so that libraries get loaded from the game's directory but only if there is no version from the Steam Runtime or the OS. That would bring back more or less the old behaviour. But we should probably use the absolute path to the game, instead of.or the empty string, to avoid the/tmpattack - and we can't do that fromrun.sh, becauserun.shis only run once for the entire Steam session, not once per game.As a workaround, you could try that approach by setting the Launch Options to something like this:
@TTimo, would it be feasible to make the Steam client do the equivalent of that every time it launches a Steam Runtime game? It's probably best if we don't do it for non-Steam games, or for games that run via a compat tool.
joshas commentedon Dec 9, 2020
Using this Launch Options command game starts correctly. Thank you.
TTimo commentedon Dec 9, 2020
Yes we can do this. I think we would make it a "legacy" property to be phased out for new releases.
Roboron3042 commentedon Dec 10, 2020
Being the current maintainer of Simutrans, I can say this also affected the game. Previous maintainer assumed that Steam Runtime simply picked up the libraries from the game root directory. Some users reported this same issue a month ago when using the beta version, so I was aware that this could happen, but I was also expecting either a "fix" or an announcement before this important change :-/
I've already updated the game to correctly set LD_LIBRARY_PATH, but probably more games assumed this, and I wouldn't expect all of them to update to address this change, so a solution is indeed necessary.
kisak-valve commentedon Dec 11, 2020
Hello, per "Fix a regression of support for some native titles (steam-runtime#317)" in the 2020-12-10 Steam client beta update, please opt into Steam's beta client and retest this issue.
joshas commentedon Dec 11, 2020
Can confirm that Shadowrun Returns is working without additional launch options using latest Steam client Beta update.
thaewrapt commentedon Dec 11, 2020
Works for me also (actually, all three of Shadowrun titles started working).
Confusing though, I noticed some strange behaviour with scaling for fullscreen resolutions (in my case, it's "desktop" resolution of 1920x1080) and can't remember anything like this before. Could this be connected to the update?
smcv commentedon Dec 11, 2020
Please open a separate issue with full details: there isn't much we can do with "some strange behaviour".
thaewrapt commentedon Dec 11, 2020
Definitely, after some more testing and a minimal effort to bisect the issue, I'll do, thanks.
smcv commentedon Dec 15, 2020
The changes in the beta client should be fixing this for games run without the SteamLinuxRuntime (but only those games, right now).
Resolving https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/issues/46 and updating to a newer Steam client (not yet released) will fix this for games run with the SteamLinuxRuntime.
kisak-valve commentedon Jan 15, 2021
Closing because the issue in the opening post has been fixed.