protonscr

Ubuntu 24.04: Steam Segfault in _XLockDisplay (dpy=0x47) after GTK2 Theme Parsing Errors

steamclosed
ValveSoftware/steam-for-linux#11980 · opened 2025-05-06 by skiller185 · updated 2025-05-06 · 1 comments · github
Sskiller185 2025-05-06 github

Okay, here is the exact text drafted for you to copy and paste into the corresponding sections of the Steam for Linux GitHub issue form.

Remember to:

  1. Replace placeholders like [your_username_on_github] and [your_actual_homedir_username] (which is likely lily based on your logs) with your correct information.
  2. Create the Gists for the full GDB backtrace and the example terminal output, and insert their URLs into the text below where indicated.
  3. Generate the steam-logs.tar.gz file as instructed in the form and attach it to the GitHub issue.

Copy and paste this into the "Please describe your issue in as much detail as possible:" section:

Expected behavior:
Steam should launch successfully and display its main user interface.

Actual behavior:
Steam client (Updater built Apr 28 2025 21:09:24, installed from steam_latest.deb on 2025-05-06) crashes consistently on Ubuntu 24.04 64-bit (GNOME desktop, Nvidia GPU) immediately after the initial "Verifying installation..." or update check phase when launched from the terminal using the steam command.

The terminal output always shows GTK2 theme parsing errors just before the crash, specifically:

  • error: unexpected identifier 'direction', expected character '}' (in the theme's main.rc file)
  • error: invalid string constant "normal_entry", expected valid string constant (in the theme's hacks.rc file)

These errors occur for any GTK2 theme selected via GNOME Tweaks for "Legacy Applications." This has been tested with various Yaru themes (e.g., Yaru-blue-dark) and the standard Adwaita theme. After these GTK errors, a "Segmentation fault (core dumped)" message is printed.

A GDB backtrace of the crash (obtained when ulimit -c unlimited is set) shows that the segmentation fault occurs in __GI_strchr (from libc.so.6), which is called by _XLockDisplay (from libX11.so.6). The _XLockDisplay function is being called with an invalid Display* pointer, specifically dpy=0x47. This indicates memory corruption or an uninitialized variable related to the X11 display connection.

  • Full GDB backtrace of the crash: [Link to your Gist of the GDB backtrace here, e.g., https://gist.github.com/[your_username_on_github]/your_gdb_backtrace_gist_id]
  • Example terminal output showing GTK errors and crash: [Link to your Gist of the terminal output here, e.g., https://gist.github.com/[your_username_on_github]/your_terminal_output_gist_id]

Troubleshooting steps and findings:

  • Reinstalling Steam, various GTK themes (Yaru, Adwaita), and core GTK2 libraries (e.g., libgtk2.0-0:i386, adwaita-icon-theme, gnome-themes-standard) did not resolve the GTK parsing errors or the crash.
  • Setting the GTK2_RC_FILES environment variable (e.g., GTK2_RC_FILES=/dev/null steam or export GTK2_RC_FILES=/home/[your_actual_homedir_username]/minimal_gtkrc; steam) does not prevent the system-configured "Legacy Applications" theme (e.g., Yaru-blue-dark or Adwaita) from being parsed, nor does it prevent the GTK parsing errors or the subsequent crash. This suggests that when launched via the steam wrapper script, the GTK2_RC_FILES variable is being ignored or overridden by Steam's environment setup.
  • Setting STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1 steam also did not resolve the GTK parsing errors or the crash.
  • A secondary, and likely distinct, "user namespaces required" error (bwrap: setting up uid map: Permission denied) appears if Steam's direct script (/home/[your_actual_homedir_username]/.steam/debian-installation/steam.sh) is run directly with GTK2_RC_FILES in its immediate environment (either prepended or exported). This occurs even when kernel.unprivileged_userns_clone is confirmed to be 1. This user namespace error is consistently bypassed when using the main steam wrapper script (e.g., /usr/bin/steam or /usr/games/steam). This secondary issue complicated direct script testing with GTK2_RC_FILES but seems unrelated to the primary GTK/X11 crash when the wrapper is used.

The primary issue appears to be that Steam's 32-bit environment cannot correctly parse standard GTK2 theme configuration files on Ubuntu 24.04, leading to a corrupted state and the subsequent crash in X11 library functions. The standard mechanism to override GTK2 theme loading (GTK2_RC_FILES) seems ineffective in this scenario when using the steam wrapper.


Copy and paste this into the "Steps for reproducing this issue:" section:

  1. On an Ubuntu 24.04 64-bit system with an Nvidia GPU, ensure a standard GTK2 theme (e.g., Adwaita, or a Yaru variant like Yaru-blue-dark) is set as the "Legacy Applications" theme in GNOME Tweaks (or equivalent system settings).
  2. Open a terminal.
  3. Launch Steam using the command: steam
  4. Observe the terminal output. It will show GTK2 theme parsing errors for the selected theme (e.g., /usr/share/themes/Adwaita/gtk-2.0/main.rc:XXX: error: unexpected identifier 'direction', expected character '}' and /usr/share/themes/Adwaita/gtk-2.0/hacks.rc:XX: error: invalid string constant "normal_entry", expected valid string constant) followed by a "Segmentation fault (core dumped)" message. Steam will not launch.

Remember to replace [your_username_on_github] and [your_actual_homedir_username] (which is lily) as appropriate.
The paths like /home/lily/... in your actual logs are fine to leave as is, as they are part of the diagnostic data.
The line numbers for the errors in main.rc and hacks.rc might vary slightly by theme, so using "XXX" and "XX" as placeholders in the reproduction steps is okay, or you can use the specific ones from your Adwaita or Yaru logs.

Kkisak-valve maintainer 2025-05-06 github

Hello @skiller185, there's more AI generated noise here than usable feedback. Please use the issue report template and fill out the requested information yourself.

Nothing extracted yet.