protonscr

Some games fail to run as the Steam client is scrubbing system-provided LD_LIBRARY_PATH

steamopen Distro Family: GentooDistro-provided steam package
ValveSoftware/steam-for-linux#7686 · opened 2021-03-01 by literal-0x4e · updated 2021-05-11 · 2 comments · github
Lliteral-0x4e 2021-03-01 github

Your system information

  • Steam client version (build number or date): Feb 27 2021, at 23:47:02
  • Distribution (e.g. Ubuntu): Gentoo
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

TL;DR

Since autumn 2020 the Steam client is scrubbing whatever LD_LIBRARY_PATH is set to when the steam client it launched and "moves" it to another environment variable, namely SYSTEM_LD_LIBRARY_PATH, which is making some games to fail unless LD_LIBRARY_PATH is again manually set to the original value in the game's launch options.

Long Explanation

It apears the LD_LIBRARY_PATH, as set up by the distro package gets moved to SYSTEM_LD_LIBRARY_PATH which then proceeds to be completely ignored by games being launch. As a result, some of the libraries I certainly have, that are under non-default paths, are not found by some games that need them. I believe this is definitely a bug related to the "improvements in LD_LIBRARY_PATH handling", as listed in Steam client's changelog, as my original observation of the issue co-incided with the beta release containing that change.
One such notable library is libcurl-gnutls.so.4, which I have under /usr/lib64/debiancompat and /usr/lib/debiancompat for x86-64 and x86 versions, respectively. At least one VALVe game (Counter Strike: Global Offensive) is also affected by this issue and does not run without a workaround.

I did these steps to confirm the issue when launching CSGO:

env dump when running the game showed SYSTEM_LD_LIBRARY_PATH is set:

SYSTEM_LD_LIBRARY_PATH=/usr/lib64/debiancompat:/usr/lib/debiancompat:/usr/lib64/fltk:/usr/lib/fltk

while LD_LIBRARY_PATH is empty:

LD_LIBRARY_PATH=

Meanwhile, steam client gets invoked with LD_LIBRARY_PATH definitely set to all the required directories:

rin-aux@steamtainer ~ $ grep LD_LIBRARY_PATH $(which steam)
export LD_LIBRARY_PATH+="${LD_LIBRARY_PATH+:}/usr/lib64/debiancompat:/usr/lib/debiancompat:/usr/lib64/fltk:/usr/lib/fltk"

Steps for reproducing this issue:

  1. Set LD_LIBRARY_PATH and launch the steam client
  2. Launch a game that depends on some libraries found only in paths provided via LD_LIBRARY_PATH
  3. The game inherits a LD_LIBRARY_PATH cleared by Steam client instead and fails to load

NOTE: I previously reported this bug under [csgo-osx-linux bug #2584](https://github.com/ValveSoftware/csgo-osx-linux/issues/2584), but it got closed before I could find the root cause (i.e. this very problem with the steam client). I updated that report to provide all this info plus some csgo-specific bits and requested a move to steam-for-linux, but since that request was ignored for around three months, I'm opening a new issue myself.

Kkisak-valve maintainer 2021-03-01 github

Hello @literal-0x4e, the previous evaluation on https://github.com/ValveSoftware/csgo-osx-linux/issues/2584 still stands in as much as you've disabled the Steam runtime and this issue is specific to that configuration. Disabling the Steam runtime is not supported.

This issue should be evaluated by your package maintainer(s) that helped you disable the Steam runtime.

Lliteral-0x4e 2021-03-01 github

@kisak-valve Steam itself is unsetting LD_LIBRARY_PATH. Package maintainers are at Your mercy to not to that. Package sets the required environment variables, then Steam goes right ahead and break it all by unsetting them.

TL;DR I can't ask distro maintainers to stop VALVe from scrubbing the envirenment.

Nothing extracted yet.