The steam client version is 1601512230
I'm surprised to see libstdc++.so.6 in the pinned libraries there. Even if CentOS 7 is pretty old (2014), I would expect the host to have a newer version that doesn't require pinning scout's version before it. Could be unrelated though.
Bear in mind that run.sh is not always amazingly good at determining which version of a library is newer and which one is older (pressure-vessel has per-library knowledge for this sort of thing, although libstdc++ is not currently one of the special cases).
What's in the RPM that contains libstdc++.so.6 on this OS? I'd be particularly interested to see the result of ls -l /usr/lib64/libstdc++.so.* (or whatever directory it's really in).
Even if CentOS 7 is pretty old (2014), I would expect the host to have a newer version that doesn't require pinning scout's version before it
Actually... scout originally had libstdc++ from gcc 4.6, but has been upgraded to the version from gcc 5. CentOS 7 appears to have gcc 4.8. So perhaps scout's libstdc++ is genuinely newer than the copy in the host OS in this case.
in std::string::compare(char const*) const ()
This seems reasonably likely to be a NULL pointer dereference (like most crashes in strcmp). Does IsRunningInAppContainer in vrclient definitely check for NULL strings?
Many thanks for your help.
Just wanted to mention that SteamVR was working fine on CentOS 7 before the last update.
ls -l /usr/lib64/libstdc++.so.*
lrwxrwxrwx 1 root root 19 Apr 15 07:51 /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x 1 root root 991616 Aug 6 2019 /usr/lib64/libstdc++.so.6.0.19
I've been getting a similar segfault for months with SteamVR on my machine (which also somehow manages to take down any Proton game (below 5.13) using DXVK but that's a different issue). It looks like it's segfaulting on std::string::_M_data. Likely as a result of the input from IsRunningInAppContainer().
This should be my backtrace, from the current stable version of SteamVR (1.14.16 I believe).
[New LWP 919007]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `./vrstartup'.
--Type <RET> for more, q to quit, c to continue without paging--c
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fbd5e99d7d1 in std::string::_M_data (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3361
3361 /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h: No such file or directory.
(gdb) bt
#0 0x00007fbd5e99d7d1 in std::string::_M_data (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3361
#1 std::string::_M_rep (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3369
#2 std::string::size (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3904
#3 std::string::compare (this=0x0, __s=0x7fbd5be82ada "ID") at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1432
#4 0x00007fbd5bce4432 in IsRunningInAppContainer() () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#5 0x00007fbd5bba861e in CHmdSystemLatest::Init(vr::EVRApplicationType, char const*) () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#6 0x00007fbd5eea4b82 in VR_InitInternal2 () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/libopenvr_api.so
#7 0x0000000000408069 in RealMain(int, char**) ()
#8 0x0000000000406ffb in main ()
Here is another backtrace, from the beta 1.15.9
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f0177a0c7d1 in std::string::_M_data (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3361
3361 /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h: No such file or directory.
(gdb) bt
#0 0x00007f0177a0c7d1 in std::string::_M_data (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3361
#1 std::string::_M_rep (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3369
#2 std::string::size (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3904
#3 std::string::compare (this=0x0, __s=0x7f017540d2b7 "ID") at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1432
#4 0x00007f017518f502 in IsRunningInAppContainer() () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#5 0x00007f0175128c12 in CHmdSystemLatest::Init(vr::EVRApplicationType, char const*) () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#6 0x00007f0177ebd0d2 in VR_InitInternal2 () from /home/matthew/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/libopenvr_api.so
#7 0x0000000000407bcf in RealMain(int, char**) ()
#8 0x0000000000409470 in main ()
(gdb)
Steam client version: Oct 28 2020, at 23:35:02
Distribution: Arch Linux (installed as Antergos Linux)
Opted into Steam client beta?: No
Have you checked for system updates?: Yes
gcc-libs version (which contains libstdc++): 10.2.0-3
I have /usr/lib/libstdc++.so.6.0.28 if it's meaningful information.
I installed Steam via my distro's repositories.
I'm positive it worked with SteamVR 1.13.
Edit: Another side-effect is that Steam crashes after installing/updating SteamVR, presumably because it's trying to initialize VR and failing
#0 0xf7dfd9ca in std::string::_M_data (this=0x0)
at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/bits/basic_string.h:3360
#1 std::string::_M_rep (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/bits/basic_string.h:3369
#2 std::string::size (this=0x0) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/bits/basic_string.h:3904
#3 std::string::compare (this=0x0, __s=0xbb8a6d36 "")
at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/bits/basic_string.tcc:1432
#4 0xbb6dca0d in ?? ()
#5 0xbb595bd9 in ?? ()
#6 0xdd9c7304 in VR_InitInternal2 () from /home/matthew/.local/share/Steam/ubuntu12_32/libopenvr_api.so
#7 0xdd9c735f in VR_InitInternal () from /home/matthew/.local/share/Steam/ubuntu12_32/libopenvr_api.so
#8 0xdffdfdce in ?? () from /home/matthew/.local/share/Steam/ubuntu12_32/steamclient.so
#9 0xdf5a650f in ?? () from /home/matthew/.local/share/Steam/ubuntu12_32/steamclient.so
[#10](/issue/ValveSoftware/SteamVR-for-Linux/10) 0xdf5a677a in ?? () from /home/matthew/.local/share/Steam/ubuntu12_32/steamclient.so
[#11](/issue/ValveSoftware/SteamVR-for-Linux/11) 0xdf5a6d88 in ?? () from /home/matthew/.local/share/Steam/ubuntu12_32/steamclient.so
Edit 2: LD_PRELOADing libstdc++.so from the Seam Linux Runtime (both Scout and Solider) causes it to segfault on std::string::compare instead of segfaulting deeper in.
Okay, through a lot of trial-and-error and reverse-engineering, I think I've figured it out.
The function IsRunningInAppContainer() tries to determine if SteamVR is running in a container by reading the contents of /etc/os-release, I believe to check if ID=steamrt. But, for some reason, it reads the wrong bits of the file if there are any empty lines in /etc/os-release, resulting in the segfault. Possibly an issue with TokenizeString() converting the whitespace lines and returning entries that just contain nulls?
To the end-users until this crash gets fixed: Check the file /etc/os-release and remove any blank lines. The file should not end on a new line. It should end on the same line as the last parameter. Make a backup of the file in advance, of course. You may need to start your text editor with sudo e.g. sudo nano /etc/os-release.
To Valve: You should be able to reproduce this crash yourself by adding some trailing newlines at the end of your /etc/os-release file, and then hopefully figure out whatever makes SteamVR read the wrong lines. If you still can't reproduce, let me know and I can send you my version before removing the empty lines.
Edit: A quick check of the /etc/os-release file in CentOS 7 confirms it also has a few blank lines in its initial state. Other distros might too but I have not tested them all. If your distribution has empty lines in its /etc/os-release by default, feel free to comment.
Edit 2: EndeavourOS (arch-derived) also has a newline at the end of the file by default, which is perfectly normal for a /etc/os-release file to have.
Just hit this bug on my old Antergos Linux (Arch)
Removed new lines from /etc/os-release did allow Steam VR to boot fine.
I've been without VR for months on Void Linux. I can confirm that removing the single blank line from /etc/os-release has fixed the segfault problem. Thanks so much for working out this simple fix!
The function
IsRunningInAppContainer()tries to determine if SteamVR is running in a container by reading the contents of/etc/os-release, I believe to check ifID=steamrt
As a note to the SteamVR developers within Valve:
If your goal with this is to detect whether SteamVR is running inside SteamLinuxRuntime (also known as the Steam container runtime or pressure-vessel), there is now an easier way to achieve the same thing with less parsing: you can try to read /run/host/container-manager, which is a filename borrowed from systemd's container interface. All versions of the Steam container runtime since early 2021 have created this file.
If it contains pressure-vessel followed by a newline, then you're running under pressure-vessel. If it contains flatpak followed by a newline, then you're running under Flatpak 1.10 or later. If it contains some other string, you're running under some other container manager (other high-level container managers like Toolbx and other app-sandboxing frameworks like Snap might implement the same interface now or in future, I don't know exactly what the status is). If the file doesn't exist, you're running on the host system or in a container manager that doesn't support this interface.
If your goal is to detect a specific major version of the container runtime (for instance distinguishing between scout, soldier and sniper containers), parsing os-release is still the easiest way to achieve that.
Nothing extracted yet.
Your system information
Please describe your issue in as much detail as possible:
When starting SteamVR, I get a segmentation fault with this traceback, which indicates that function "IsRunningInAppContainer" does something wrong:
[kornel@yasara2 bin]$ gdb linux64/vrstartup core.3757
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-115.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrstartup...Missing separate debuginfo for /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrstartup
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/53/ab58a7e42ce4e8aa6894425f03a0d5fc4f304a.debug
(no debugging symbols found)...done.
[New LWP 3757]
Missing separate debuginfo for /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/libSDL2-2.0.so.0
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/fe/82171601f25f8fcf56f84ccda5714a0e2c88cb.debug
Missing separate debuginfo for /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/libopenvr_api.so
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/59/62fc5d74dd927360506bced709293d0606cc7a.debug
Missing separate debuginfo for /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/libsteam_api.so
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/11/1902389643b15beee454d61fecc94ed68a83a7.debug
Missing separate debuginfo for /home/kornel/.steam/ubuntu12_32/steam-runtime/pinned_libs_64/libstdc++.so.6
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/24/302938237b8f927e3a524231f4722ae6c503b0.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /home/kornel/.steam/linux64/steamclient.so
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/e2/32bccc8c0a7097e36c148fa722c49f18118407.debug
Missing separate debuginfo for /home/kornel/.steam/linux64/crashhandler.so
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/c6/98b3dc98acb79d0b7ddb0f3221de3950502849.debug
Missing separate debuginfo for /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/9f/8abbf0efdedf253490061d19ac1a6dd994fdc8.debug
Core was generated by `/home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrstartup'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f0eda9e919d in std::string::compare(char const*) const () from /home/kornel/.steam/ubuntu12_32/steam-runtime/pinned_libs_64/libstdc++.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-292.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libglvnd-1.0.1-0.8.git5baa1e5.el7.x86_64 libglvnd-glx-1.0.1-0.8.git5baa1e5.el7.x86_64 libxcb-1.13-1.el7.x86_64
(gdb) where
#0 0x00007f0eda9e919d in std::string::compare(char const*) const () from /home/kornel/.steam/ubuntu12_32/steam-runtime/pinned_libs_64/libstdc++.so.6
ValveSoftware/steam-for-linux#1 0x00007f0ed7bb80f2 in IsRunningInAppContainer() () from /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
ValveSoftware/steam-for-linux#2 0x00007f0ed7b51c39 in CHmdSystemLatest::Init(vr::EVRApplicationType, char const*) () from /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
ValveSoftware/steam-for-linux#3 0x00007f0edbacb0d2 in VR_InitInternal2 () from /home/kornel/.steam/steamapps/common/SteamVR/bin/linux64/libopenvr_api.so
ValveSoftware/steam-for-linux#4 0x0000000000407bcf in RealMain(int, char**) ()
ValveSoftware/steam-for-linux#5 0x0000000000409470 in main ()