FS#62095 - [steam-native-runtime] embedded browser requires libpcre.so.3
Attached to Project:
Community Packages
Opened by Dan Ziemba (zman0900) - Wednesday, 20 March 2019, 23:22 GMT
Last edited by Levente Polyak (anthraxx) - Wednesday, 21 August 2019, 22:18 GMT
Opened by Dan Ziemba (zman0900) - Wednesday, 20 March 2019, 23:22 GMT
Last edited by Levente Polyak (anthraxx) - Wednesday, 21 August 2019, 22:18 GMT
|
Details
Description:
Web-views in Steam, such as the store or profiles pages, no longer work. The following error is seen in the journal: steam-native.desktop[4115]: ./steamwebhelper: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory Apparently libpcre.so.3 is just a Debian-specific version of libpcre.so.1: https://sources.debian.org/src/pcre3/2:8.39-12/debian/README.Debian/ Maybe steam-native-runtime can just provide a symlink? Additional info: * package version(s) - steam 1.0.0.59-1 - steam-native-runtime 1.0.0.56-3 Steps to reproduce: 1. Start steam native 2. Log in 3. Click store tab 4. Observe blank screen and error in journalctl |
This task depends upon
Closed by Levente Polyak (anthraxx)
Wednesday, 21 August 2019, 22:18 GMT
Reason for closing: Fixed
Additional comments about closing: 1.0.0.61-1
Wednesday, 21 August 2019, 22:18 GMT
Reason for closing: Fixed
Additional comments about closing: 1.0.0.61-1
./steamwebhelper: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
After installing libselinux from AUR, steamwebhelper does work again.
# ln -s /usr/lib/libpcre.so.1 /usr/lib/libpcre.so.3
And I got the same error. Installing libselinux from AUR works.
https://steamcommunity.com/groups/SteamClientBeta#announcements/detail/1809791405932517565
https://aur.archlinux.org/packages/steam-native-pcre-fix
```
$ export LD_PRELOAD="/usr/lib/libgio-2.0.so.0:/usr/lib/libglib-2.0.so.0"
$ steam-native
```
[1] https://steamcommunity.com/groups/SteamClientBeta/discussions/0/1848072002764995823/#c1769259642875894556
That leaves the question why gio and glib from the steam distribution are used by steam-native in the first place.
I was talking to kisak (Valve Moderator on GitHub) on #steamdb and he told me that other distros had the same problem. I've just talked to him again and reading what de-vri-es wrote, I have to agree that the fix should come from Arch and not upstream, because it doesn't make sense at all to use glib and gio from the Steam distribution.
Screenshot: https://steamuserimages-a.akamaihd.net/ugc/957486694769437110/6E3F3D80536C5A0EB1011347F81897EA66C333B6/
Issue at GitHub: https://github.com/ValveSoftware/csgo-osx-linux/issues/2062
Log taken from steam-native: https://gist.github.com/RockyTV/60ae2799e5b4c4e1e9e869f32039739f#file-csgo-log
It keeps spamming my console with these errors:
```
(process:30053): GLib-GObject-WARNING **: 21:43:17.124: invalid cast from 'PangoFcFontMap' to 'GTypePlugin'
(process:30053): GLib-GObject-WARNING **: 21:43:17.124: plugin pointer (0xb08f010) for type 'BasicEngineFc' is invalid
(process:30053): GLib-GObject-WARNING **: plugin '(unknown)' failed to register type '(null)'
(process:30053): Pango-CRITICAL **: 21:43:17.128: pango_ft2_render_transformed: assertion 'PANGO_FT2_IS_FONT (font)' failed
```
$ find -L ~/.local/share/Steam -name "steamwebhelper"
The LD_LIBRARY_PATH is changed thrice, first in the steam-native script, then in the steam.sh script, and finally in the steamwebhelper.sh accompanying the binary. Replaying this in the shell yields:
$ export LD_LIBRARY_PATH="/usr/lib/steam:/usr/lib32/steam${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
$ export LD_LIBRARY_PATH="$HOME/.local/share/Steam/ubuntu12_32/:$HOME/.local/share/Steam/ubuntu12_32/panorama:${LD_LIBRARY_PATH-}"
$ export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}:${HOME}/.local/share/Steam/ubuntu12_64"
$ echo $LD_LIBARY_PATH
.:/home/leonard/.local/share/Steam/ubuntu12_32:/home/leonard/.local/share/Steam/ubuntu12_32/panorama:/usr/lib/steam:/usr/lib32/steam:/home/leonard/.local/share/Steam/ubuntu12_64
If we now use ldd on the binary, we can see the culprit (I've marked all local libraries with an 'x' and libpcre with an 'X'): https://pastebin.com/8mbq8xmW
We have two problems:
a) The path '.' is needed to be in LD_LIBRARY_PATH since otherwise libcef.so won't be loaded. However, if it is in that path in the first place, it will have priority over /usr/lib and /usr/lib32 since they aren't in the LD_LIBRARY_PATH at all.
b) Even if they were (maybe because we edited steam-native), it will be the first entry in the variable, thus the first to be searched. You can try this by editing steam-native to use
export LD_LIBRARY_PATH="/usr/lib/steam:/usr/lib32/steam${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH:/usr/lib:/usr/lib32"
and then start steam-native. It won't work, but if you then edit the steamwebhelper.sh to *append* '.' rather than *prepend* you can open any page and it will work (no need to restart steam).
[ Note that the prepended path in the steam.sh script is no issue (at least here) since only the path to the locally distributed 32-bit binaries is prepended. I consider this wrong, too, but it's of no issue here. ]
The solution thus entails to first include /usr/lib:/usr/lib32 in LD_LIBRARY_PATH in steam-native and also Valve to modify their steamwebhelper.sh script to append '.' rather than prepending.
EDIT: turns out there was an outage reported when I was testing, I just tried the same method right now and it works fine. Also no CRC check failed that causes Steam to update and overwrite the changes applied to steamwebhelper.sh
But, the issue was closed upstream and we're trying the get it opened back:
https://github.com/ValveSoftware/steam-for-linux/issues/6156
Run the patch against the steam-native script on /usr/bin. If you start steam, it will try to change the file and fail, but it will otherwise work as intended. This breaks the steam update process, and I'm not sure if this triggers any VAC functionality, so, use on your own discretion.
steam-native.patch (0.5 KiB)
Using steam-runtime client doesn't have this problem.
ERROR: ld.so: object '/usr/lib/libgio-2.0.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/usr/lib/libglib-2.0.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
(process:7299): GLib-GObject-WARNING **: invalid cast from 'PangoFcFontMap' to 'GTypePlugin'
(process:7299): GLib-GObject-WARNING **: plugin pointer (0x5559618b0410) for type 'BasicEngineFc' is invalid
(process:7299): GLib-GObject-WARNING **: plugin '(unknown)' failed to register type '(null)'
(process:7299): Pango-CRITICAL **: pango_ft2_render_transformed: assertion 'PANGO_FT2_IS_FONT (font)' failed
a) These games hook into the steamwebhelper (as does CS:GO) and the LD_PRELOAD doesn't preload everything it should (a full list of libs that are loaded can be found in the pastebin I created earlier: https://pastebin.com/8mbq8xmW).
b) The games themselves load libgio, too, and usually use Wl,-rpath to specify loading from the CWD to load game-packaged versions independently of the SteamRT which breaks our LD_PRELOAD approach.
I suspect the former.
In any case, LD_PRELOAD is an ungly hack and completely mad in hindsight, I suspect jt will break more than it'll fix.
That makes it harder to make the script work with both the native and bundled runtime. Still, it's a start.
/edit: First version called /usr/lib/steam/steam-webhelper.sh, fixed it now to steamwebhelper.sh . Additionally, the second version passes on "$0" and "$@" for use by the other script.
steamwebhelper.sh (0.1 KiB)
It's a complete and ugly hack (also interesting from a technical viewpoint and thus intriguing). But I don't see a better way, too.
We should also check, whether the script has changed its CRC since it's not unlikely that Valve will change the script, thus the CRC and we do not want to patch that updated script, but rather issue a warning or so.
The steamwebhelper.sh is fixed by the patch we provided upstream. But, that script also requires us to add /usr/lib and /usr/lib32 to the steam-native script. So, keep in mind that in any hacking you're doing.
Also, if you can come up with a consistent way to patch this script on the HOME folder of the calling user, I could consider this for inclusion. But I'll also wait on Levente's input on this, because this is an ugly, ugly hack.
A straightforward solution that works until the upstream script changes:
1) Check if the script in the user home folder has the expected checksum. If not, abort and hope for the best.
2) If it did match, overwrite it with a fixed version that delegates to /usr/lib/steam/steamwebhelper.sh, which isn't checked by steam. The last script I uploaded does this.
Then /usr/lib/steam/steamwebhelper.sh can be the patched version that upstream didn't want to accept.
There's a difference in sending a patch and it being accepted. But yes, we would patch steam-native to include those dirs too, if (when?) steam releases an updated script. I have talked with them and they are going to probably start working on this on the next beta cycle, one or two weeks from now.
@Maarten,
I'm going to test your scripts, but don't expect inclusion on the main package right now. I need Levente's input and he is currently on vacation.
@Alucryd,
Are you ok with these changes? I don't think we need to change anything on steam-native-runtime package, but your opinion is relevant here as well.
In any case I think we should add /usr/lib and /usr/lib32 to the path, as always should've been (I kind of expected it to behave that way even, and I guess this could even fix bugs with Civ V and openAL). But for the other stuff, I'd wait for Valve a bit to decide before doing the ugliest packaging-hack there is.
To make the picture complete, I've got this at /usr/lib/steam/steamwebhelper.sh:
```
#!/bin/bash
old_arg_0="$1"
shift
DIR="$(dirname "$old_arg_0")"
cd ${DIR}
export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}:${DIR}"
export SYSTEM_LD_LIBRARY_PATH="/usr/lib:/usr/lib32"
# Give precedence to system libraries when running in native mode
if [[ "${STEAM_RUNTIME}" = "0" && -n "${SYSTEM_LD_LIBRARY_PATH}" ]]; then
export LD_LIBRARY_PATH="${SYSTEM_LD_LIBRARY_PATH:-}:${LD_LIBRARY_PATH}"
fi
./steamwebhelper "$@"
```
(I'm not uploading it because it has the same name as the other file, so that might get confusing.)
```
WEBHELPER_SHA256=($(sha256sum "$HOME/.local/share/Steam/ubuntu12_64/steamwebhelper.sh"))
WEBHELPER_SHA256="${WEBHELPER_SHA256[0]}"
if [[ $WEBHELPER_SHA256 == "f60cb3818ca4cb716a8adf09ed7f1454aa6cdf775d8321f6ab1944db424d8790" ]]; then
cp /usr/lib/steam/steamwebhelper.sh.override "$HOME/.local/share/Steam/ubuntu12_64/steamwebhelper.sh"
fi
```
That or something similar could be part of /usr/bin/steam-native. That would probably be better than /usr/lib/steam/steam, because the latter is owned by the steam package instead of steam-native.
The script I uploaded before would then be placed at /usr/lib/steam/steamwebhelper.sh.override to be copied into the home folder.
I'm not sure if the sha256 checksum here is correct, I don't feel like letting steam update the file again ;)
We are in contact with them and they are going to look into this issue in the next Beta cycle, as I said. I'm also against this hacking, and, as I said, I will not put this on the package unless the maintainer agrees.
Now, if Valve refuses to fix this issue, either we won't be able to package steam-native anymore, or have to resort to this ugly hacks. Also, I'm not going to open a new upstream issue, unless Valve stop responding on the email thread we currently have with them. And even then, I don't know how much good it would bring to open a new issue. We will have to wait an use steam-runtime in the mean time.
Nevertheless, I understand the hesitation to include this because of the hacky nature. In the mean time, I bundled it all in an AUR package: https://aur.archlinux.org/packages/steam-native-webhelper/
> Fixed library ordering to prefer the Steam Runtime's libcurl over the hosts'. Fixes "Risk of Rain" and other GameMaker titles
I thought they would've fixed the problem with the native runtime, but, unfortunately, that isn't the case. It's still interesting, though, because they've introduced the heavy runtime:
> # Steam runtime 'heavy' is a newer runtime than the default Steam runtime (scout)
> # steamwebhelper and libcef.so are built in this newer environment,
> # and the needed libraries from heavy are provided here.
> # steamwebhelper is compiled to run in the composite runtime made up of heavy+scout(+host)
> # See http://repo.steampowered.com/steamrt/steamrt-heavy/ for details
They also haven't changed the library ordering:
> export LD_LIBRARY_PATH=".:${STEAM_RUNTIME_HEAVY}:${LD_LIBRARY_PATH}:${DIR}"
I don't know if this information is useful, but I've traced back the issue to the March 20th update, when Chromium was updated: https://steamcommunity.com/groups/SteamClientBeta#announcements/detail/1809791405918976077
Valve then tried fixing the black screen issue in the following updates:
- March 21st: https://steamcommunity.com/groups/SteamClientBeta#announcements/detail/1809791405926223447
- March 22nd: https://steamcommunity.com/groups/SteamClientBeta#announcements/detail/1809791405932517565
- March 26th: https://steamcommunity.com/groups/SteamClientBeta#announcements/detail/1730979046027007443
And since then we haven't had an update to fix this issue. Hopefully things change with the heavy runtime.
EDIT: from http://repo.steampowered.com/steamrt/steamrt-heavy/snapshots/steamrt-heavy.txt
> Steam Runtime 'Heavy' is a 64-bit only runtime based on Debian jessie.
>This is a transitional runtime used for the 'steamwebhelper' component of the Steam Client.
>
> 'steamwebhelper' and 'libcef.so' included in the Steam Client are compiled in this environment,
and libraries from this runtime are also distributed in the Steam Client to provide a
suitable runtime environment for it.
Also tested CS:Go, and the text displays correctly.
The moment I installed this, steam-native's blank store page immediately started loading properly - didn't even need to restart or refresh the page!
cd ~/.steam/steam/ubuntu12_64
ln -s ../ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libpcre.so.3 libpcre.so.3
ln -s ../ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libselinux.so.1 libselinux.so.1