protonscr

steam-runtime-launcher-service segfault in libgtk3-nocsd

steamclosed runtimeDistro Family: Arch
ValveSoftware/steam-for-linux#10002 · opened 2023-08-20 by notpentadactyl · updated 2023-10-30 · 11 comments · github
Nnotpentadactyl 2023-08-20 github

Your system information

  • Steam client version (build number or date): 1692390949
  • Distribution (e.g. Ubuntu): Arch
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes
  • GPU: Nvidia

Please describe your issue in as much detail as possible:

Since a recent Beta update dmesg shows steam-runtime-l segfaulting in steam-runtime-launcher-service every 2 seconds:

steam-runtime-l[3603]: segfault at 0 ip 0000000000000000 sp 00007ffcd77a8ec8 error 14 in steam-runtime-launcher-service[400000+23000] likely on CPU 0 (core 0, socket 0)
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
steam-runtime-l[3704]: segfault at 0 ip 0000000000000000 sp 00007ffdb442d298 error 14 in steam-runtime-launcher-service[400000+23000] likely on CPU 8 (core 8, socket 0)
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
steam-runtime-l[3719]: segfault at 0 ip 0000000000000000 sp 00007fff3021c628 error 14 in steam-runtime-launcher-service[400000+23000] likely on CPU 13 (core 13, socket 0)
Code: Unable to access opcode bytes at 0xffffffffffffffd6.

After opting out of the Beta these lines are gone, opting back in shows them again.

Steps for reproducing this issue:

  1. Opt into Steam Beta
  2. dmesg
Ssmcv 2023-08-21 github

I've asked Steam developers to put a restart limit or rate limit on how often this component gets restarted.

I was unable to reproduce this crash on two up-to-date Arch test systems (one AMD and one NVIDIA). Please could you try to get a backtrace or more information about the crash?

You can run the component that is crashing with more verbose output while Steam is not running, like this:

$ ~/.steam/root/ubuntu12_32/steam-runtime/run.sh -- \
  steam-runtime-launcher-service --alongside-steam --verbose

and that might provide some useful context to track down where the crash takes place.

If you can get a backtrace that would be very helpful. Usually the easiest way to get a backtrace is by using systemd-coredumpd: see https://wiki.archlinux.org/title/Core_dump.

Or, if you know how to use gdb, you could try running the component that is crashing under gdb:

$ STEAM_RUNTIME_USE_LIBCURL_SHIM=1 \
  ~/.steam/root/ubuntu12_32/steam-runtime/run.sh -- \
  gdb --args \
  steam-runtime-launcher-service --alongside-steam --verbose
(gdb) run
<wait for it to crash>
(gdb) thread apply all bt
Ssmcv 2023-08-21 github

The information given by Steam's Help -> System Information and Help -> Steam Runtime Diagnostics would also be very useful.

TTTimo 2023-08-21 github

Note: you can use -disablelauncherservice on steam's command line to disable the service until this is fixed.

Nnotpentadactyl 2023-08-22 github

@smcv

Running it verbose without steam:

$ ~/.steam/root/ubuntu12_32/steam-runtime/run.sh -- \   
  steam-runtime-launcher-service --alongside-steam --verbose
steam-runtime-launcher-service[17837]: N: Enabled profiling
steam-runtime-launcher-service[17837]: D: Connecting to D-Bus session bus...
[1]    17837 segmentation fault (core dumped)  ~/.steam/root/ubuntu12_32/steam-runtime/run.sh --  --alongside-steam --verbos

gdb output:

(gdb) run
Starting program: /home/mcd/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-launcher-service --alongside-steam --verbose
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
steam-runtime-launcher-service[23559]: N: Enabled profiling
steam-runtime-launcher-service[23559]: D: Connecting to D-Bus session bus...

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7f8d7c0 (LWP 23559) "steam-runtime-l"):
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7fbb01a in g_object_get () from /usr/lib/libgtk3-nocsd.so.0
#2  0x00007ffff7c8dbd2 in g_unix_connection_send_credentials () from /home/mcd/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/../lib/x86_64-linux-gnu/steam-runtime-tools-0/libgio-2.0.so.0
#3  0x00007ffff7caf226 in ?? () from /home/mcd/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/../lib/x86_64-linux-gnu/steam-runtime-tools-0/libgio-2.0.so.0
#4  0x00007ffff7cbe258 in ?? () from /home/mcd/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/../lib/x86_64-linux-gnu/steam-runtime-tools-0/libgio-2.0.so.0
#5  0x00007ffff7cbe721 in g_bus_get_sync () from /home/mcd/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/../lib/x86_64-linux-gnu/steam-runtime-tools-0/libgio-2.0.so.0
#6  0x0000000000418791 in ?? ()
#7  0x00000000004091e8 in ?? ()
#8  0x00007ffff6c27cd0 in ?? () from /usr/lib/libc.so.6
#9  0x00007ffff6c27d8a in __libc_start_main () from /usr/lib/libc.so.6
[#10](/issue/ValveSoftware/steam-for-linux/10) 0x000000000040960d in ?? ()
[#11](/issue/ValveSoftware/steam-for-linux/11) 0x00007fffffffd038 in ?? ()
[#12](/issue/ValveSoftware/steam-for-linux/12) 0x0000000000000038 in ?? ()
[#13](/issue/ValveSoftware/steam-for-linux/13) 0x0000000000000003 in ?? ()
[#14](/issue/ValveSoftware/steam-for-linux/14) 0x00007fffffffd514 in ?? ()
[#15](/issue/ValveSoftware/steam-for-linux/15) 0x0000000000000000 in ?? ()
(gdb) cont
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) 

Is this enough, or do you still want system information / runtime diagnostics?


@TTimo that works. Thanks! :+1:

Kkisak-valve maintainer 2023-08-22 github

Hello @notpentadactyl, we've seen libgtk3-nocsd.so.0 misbehave before like https://github.com/ValveSoftware/steam-runtime/issues/286#issuecomment-716551349. Can you remove the system package that provides it and test how steam-runtime-launcher-service responds?

Nnotpentadactyl 2023-08-22 github

@kisak-valve that fixed it! :+1:

Ssmcv 2023-08-23 github

Sigh, libgtk3-nocsd, continuing to insert bugs into software that doesn't even use GTK...

I wonder whether the Steam client should be filtering that out from LD_PRELOAD? (If I remember correctly, pressure-vessel already does, under at least some circumstances.)

steam-runtime-launcher-service can't be responsible for doing that itself unless we put a shell script or some other wrapper program around it, because by the time its main() gets control, it's already too late to stop libgtk3-nocsd from being loaded.

Ssmcv 2023-08-23 github

I've been able to reproduce this. The general workaround is "don't use libgtk3-nocsd", or more generally, "don't use LD_PRELOAD modules if they are not absolutely necessary".

The main problem is that gtk3-nocsd unconditionally interposes g_object_get(), even for non-GTK apps. That's probably necessary for it to do what it does. However, it makes assumptions in its implementation of g_object_get() that are not necessarily true when bundling dependencies alongside an executable in order to make a portable/relocatable binary.

Because steam-runtime-launcher-service is also used as part of the Steam Linux Runtime container runtime framework, it bundles its own dependencies alongside it via a RUNPATH, instead of relying on a larger framework to set that up for it. The version of GLib that it bundles is currently an extremely old one (2.32, from 2012) to ensure that it can run on as many systems as possible; but gtk3-nocsd assumes that it will be able to call functions mentioned in the GLib headers that were present at the time it was compiled, and those include g_type_check_instance_is_fundamentally_a(), which is a post-2012 addition.

Possible solutions in gtk3-nocsd would be to replace the call to G_IS_OBJECT with lower-level calls that are done in a more conservative/fault-tolerant way, and/or to make g_object_get() pass through to g_object_get_valist() without implementing its own logic whenever GTK is not currently loaded.

Possible solutions on the Steam Runtime side include providing a less ancient old version of GLib (most likely 2.42 or 2.58), or modifying the included version of GLib 2.32 to provide the missing g_type_check_instance_is_fundamentally_a(), or modifying the Steam or Steam Runtime startup scripts to filter out modules named libgtk3-nocsd from LD_PRELOAD during Steam startup.

Ssmcv 2023-09-07 github

Possible solutions on the Steam Runtime side include [...] modifying the included version of GLib 2.32 to provide the missing g_type_check_instance_is_fundamentally_a()

This is in the pipeline for a future Steam beta.

Possible solutions in gtk3-nocsd would be to replace the call to G_IS_OBJECT with lower-level calls that are done in a more conservative/fault-tolerant way, and/or to make g_object_get() pass through to g_object_get_valist() without implementing its own logic whenever GTK is not currently loaded.

I proposed both of these in fredldotme/gtk3-nocsd#1 (that git repo seems to be the one that Arch Linux uses an upstream for gtk3-nocsd, the original having been inactive since 2016) but I haven't seen any response there.

Ssmcv 2023-09-18 github

Possible solutions on the Steam Runtime side include [...] modifying the included version of GLib 2.32 to provide the missing g_type_check_instance_is_fundamentally_a()

The Steam beta branch now includes this change. In the version with this change, ~/.steam/root/ubuntu12_32/steam-runtime/version.txt will report version 0.20230905.59207 or later.

Ssmcv 2023-10-30 github

Possible solutions on the Steam Runtime side include [...] modifying the included version of GLib 2.32 to provide the missing g_type_check_instance_is_fundamentally_a()

The Steam beta branch now includes this change. In the version with this change, ~/.steam/root/ubuntu12_32/steam-runtime/version.txt will report version 0.20230905.59207 or later.

This change has now made it into the general-availability branch, so I think this issue can now be closed.

gtk3-nocsd is inherently fragile (it makes changes to internal functions in both GLib and GTK) and does not seem to be under active maintenance or development, so I would recommend avoiding using it.