protonscr

D-BUS Double Unref - Fatal With Vanilla D-BUS

steamclosed reviewed
ValveSoftware/steam-for-linux#4464 · opened 2016-05-27 by ikeydoherty · updated 2025-05-24 · 3 comments · github
Iikeydoherty 2016-05-27 github
  • Steam client version: ALL.
  • Distribution (e.g. Ubuntu): Solus
  • Opted into Steam client beta?: [Yes]
  • Have you checked for system updates?: [Yes]

The Steam client currently segfaults on non-Debian systems due to a double-unref by the Steam client.
This doesn't appear in Debian and Ubuntu because a patch is carried to forcibly disable fatal warnings in dbus, allowing bad API usage.

Note that this particular bug is common, and a a constant source of coredump uploads upon exit
of Steam, which unrefs a closed connection:

#0  0xf7784bb2 in  () at /lib/ld-linux.so.2
#1  0xf7278509 in raise () at /usr/lib32/libc.so.6
#2  0xf7279bf7 in abort () at /usr/lib32/libc.so.6
#3  0xf1ed11a7 in  () at /usr/lib32/libdbus-1.so.3
#4  0xf1ec6734 in  () at /usr/lib32/libdbus-1.so.3
#5  0xf1eaa929 in dbus_connection_unref () at /usr/lib32/libdbus-1.so.3
#6  0xf03158be in dbus_g_connection_unref () at /usr/lib32/libdbus-glib-1.so.2
#7  0xef557a74 in  ()
    at /home/ikey/.local/share/Steam/ubuntu12_32/steamclient.so
#8  0xef5a5973 in  ()
    at /home/ikey/.local/share/Steam/ubuntu12_32/steamclient.so
#9  0xef59aa66 in  ()
    at /home/ikey/.local/share/Steam/ubuntu12_32/steamclient.so
[#10](/issue/ValveSoftware/steam-for-linux/10) 0xef58b035 in  ()
    at /home/ikey/.local/share/Steam/ubuntu12_32/steamclient.so
[#11](/issue/ValveSoftware/steam-for-linux/11) 0xf3e4665a in  () at /home/ikey/.local/share/Steam/ubuntu12_32/steamui.so
[#12](/issue/ValveSoftware/steam-for-linux/12) 0xf42e26e0 in  () at /home/ikey/.local/share/Steam/ubuntu12_32/steamui.so
[#13](/issue/ValveSoftware/steam-for-linux/13) 0xf42e91fa in  () at /home/ikey/.local/share/Steam/ubuntu12_32/steamui.so
[#14](/issue/ValveSoftware/steam-for-linux/14) 0x56628d4a in RunSteam(int, char**, bool) ()
[#15](/issue/ValveSoftware/steam-for-linux/15) 0x566118f2 in  ()
[#16](/issue/ValveSoftware/steam-for-linux/16) 0xf7262715 in __libc_start_main () at /usr/lib32/libc.so.6
[#17](/issue/ValveSoftware/steam-for-linux/17) 0x56614009 in _start ()

Now, I know correcting the issue in Steam is probably going to take a bit of fixing, so there is a valid workaround you can implement in the main $bindir/steam script:

export DBUS_FATAL_WARNINGS=0

This is currently being used in LSI to prevent mass coredumps reaching Valve, though obviously the actual underlying bug should still be fixed.

LSI fix: https://github.com/solus-project/linux-steam-integration/commit/82512dece012448ad3ab4eea586ee6d2d7900cdd

Steps for reproducing this issue:

  1. Run Steam on any non-Debian distro
  2. Start up Steam, close from menu
  3. Observe curl upload of dump due to double dbus unref

If you have cannot immediately reproduce this, disabling the STEAM_RUNTIME will force it to happen. (STEAM_RUNTIME=0)

Related patched library in Steam runtime: http://archive.ubuntu.com/ubuntu/pool/main/d/dbus/dbus_1.4.18-1ubuntu1.7.debian.tar.gz

Mirrored patch used in Ubuntu package:
https://git.solus-project.com/packages/dbus/tree/files/no-fatal-warnings.patch

Note that the patch causes non-standard behaviour so shouldn't be relied upon, i.e. this is not the upstream dbus default behaviour. For now the export trick will be the best approach until a full solution has been found.

To debug in your dev-sdk builds, ensure you set:

export DBUS_FATAL_WARNINGS=1

To override the behaviour of the Ubuntu patch.

Aanthraxx 2016-09-29 github

I can confirm this issue in all its details.
Stumbled over this ticket while investigating some steam shutdown related coredumps that contained dbus_g_connection_unref (libdbus-glib-1.so.2). Using the workaround DBUS_FATAL_WARNINGS=0 does its job, steam exits cleanly.

Ssmcv 2025-03-25 github

The Steam client currently segfaults on non-Debian systems due to a double-unref by the Steam client.
This doesn't appear in Debian and Ubuntu because a patch is carried to forcibly disable fatal warnings in dbus, allowing bad API usage.

In Debian, I stopped applying this patch in November 2017 (in the dbus_1.12.2-1 package update, first included in a stable release in Debian 10 'buster'). It was never meant to be a permanent thing. Ubuntu picked up that change in Ubuntu 18.04 'bionic'.

Debian's steam package used the DBUS_FATAL_WARNINGS=0 workaround from December 2017 (steam_1.0.0.54-3) to September 2021 (steam_1:1.0.0.71-2), which means that the workaround existed in Debian 10 and 11, but was removed before Debian 12, which is our current stable release.

I don't think the Arch-Linux-derived SteamOS 3 ever used either of those workarounds, either. And Valve's steam-installer package for Debian/Ubuntu also never had the DBUS_FATAL_WARNINGS=0 workaround, as far as I can see.

We have not had complaints about Steam crashing in Debian or on SteamOS 3 after removing these workarounds, which I think implies that the underlying issue (presumably a refcounting bug somewhere inside steamclient.so) must have been fixed at some point.

Kkisak-valve maintainer 2025-05-24 github

Closing per the last comment.

Nothing extracted yet.