protonscr

STEAM randomly locks up my DE/GUI, killing process "solves" it (via tty)

steamopen Steam client
ValveSoftware/steam-for-linux#5440 · opened 2018-04-08 by BloodyIron · updated 2022-01-02 · 8 comments · github
BBloodyIron 2018-04-08 github

Your system information

  • Steam client version Built Apr 6 2018, at 16:07:06, API v018, package versions 1523057858
  • Distribution (e.g. Ubuntu): Ubuntu Desktop 17.10
  • Opted into Steam client beta?: Opted into beta
  • Have you checked for system updates?: I apply system updates almost daily

Additional info

  • nVidia 960 GTX, 387.34 blob used
  • intel i7-980x
  • 24GB DDR3 RAM
  • Asus Rampage Gene II
  • Asus Xonar DGX Soundcard (onboard disabled in BIOS)
  • Broadcom BCM5722 NIC (onboard disabled in BIOS)
  • XFCE4 + Unity
  • 3x1920x1080 monitors, all in landscape
  • Roccat Tyon

The issue i'm seeing, and I'm not sure how to report, is that sometimes I'll do something seemingly innocent, and suddenly STEAM just locks up my GUI. Like, locks it up pretty hard. Usually I can tell this has happened because my CPU fan often speeds up, and when I look at my system tray, the network and other meters I have going are not updating visually.

  • Sometimes it "fixes" itself after say a minute or two of waiting
  • Most of the time it doesn't fix itself

If I don't think it's going to fix itself, I have to kick to a tty, login via CIA, and kill -9 the STEAM process. The thing is, htop doesn't show STEAM as the big CPU user, it shows xorg as pinning a single CPU. But once I kill STEAM, the CPU usage drops even before I switch back to GUI.

Some examples of when the weirdness can happen:

  • Trying to reconfigure xbox 360 wireless controller with jstest-gtk (this is the most recent example)
  • Try to play a video in the STEAM store
  • Try to quit STEAM (this happens very often, locking up when quitting/rebooting)
  • Other examples that escape me right now

The thing is, I am really not sure what the cause of this is. My storage isn't failing, this has happened for quite a long time, and the behaviour seems erratic, so I don't think I can reliably reproduce it.

I'm also not sure what more to add to this to be a useful report. Can someone advise on what more I can add that may help? This has been going on for months, I honestly don't even remember when it started.

Kkisak-valve maintainer 2018-04-08 github

Related to #5279.

LLDD19 2018-04-08 github

Do you have XScreensaver? I highly suspect that it's what's causing the problem since it lets Steam notifications go through.

BBloodyIron 2018-04-09 github

@kisak-valve sure looks like it

@LDD19 yeah I use XScreensaver.

Hh1z1 2018-04-20 github

Any update? Ran into something like this a few times after a client update. It absolutely killed the display manager yet the box itself was fine. Only real option was waiting for the OS to kill it or logging in from another host. PITA to say the least.

BBloodyIron 2018-04-20 github

No changes on my end, still happens randomly.

TTheBeardOfTruth 2020-02-16 github

Bumping, still relevant.
reproducible with view->screenshots->show on disk if steam's been running long enough to bloat the x-server, doesn't happen otherwise. (No xscreensaver*, lightdm,+awesomewm, nemo file manager. No compositor)

Related to #5764?

* or any other type of screensaver for that matter.

AA-UNDERSCORE-D 2020-03-07 github

Confirming this here, Ubuntu 19.10, and gnome's screensaver frontend

33331 2022-01-02 github

Bumping, still relevant. reproducible with view->screenshots->show on disk if steam's been running long enough to bloat the x-server, doesn't happen otherwise. (No xscreensaver*, lightdm,+awesomewm, nemo file manager. No compositor)

Related to #5764?

  • or any other type of screensaver for that matter.

@kisak-valve @BloodyIron @CocaineJohnsson @h1z1

I believe I've found the root of this issue.
When clicking show on disk the shared object vgui2_s.so will use system to call something like this:

LD_LIBRARY_PATH=\"$SYSTEM_LD_LIBRARY_PATH\" PATH=\"$SYSTEM_PATH\" '/usr/bin/xdg-open' '/home/user/.steam/debian-installation/userdata/<some_id>/760/remote/730/screenshots/

To show files on disk, this is a problem because system waits for the command to finish which stalls the main thread that should be handling X input, so first of all it locks up steam until you are done viewing files on disk which is obviously not intended, and it also happens to be during some critical X input handling, which makes it lock up the device pointer across entire X session.

Temporary fix compile yourself or use attached file below this:

// compile:
// gcc main.c -ldl -O3 -s -shared -o system_fix.so
// start steam like this:
// LD_PRELOAD=<absolute_path_of_system_fix.so> steam
// or double fork:
// (LD_PRELOAD=<absolute_path_of_system_fix.so> steam &)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <malloc.h>
#define __USE_GNU
#include <dlfcn.h>

static int (*real_system)(const char*) = NULL;

// tiny wrapper for system which forces a double fork for anything going through the system symbol
int system(const char* cmd)
{
    void* result;
    /* Call recursively */
    if(!real_system)
        real_system = ((int (*)(const char*))dlsym(RTLD_NEXT, "system"));

    if(!cmd)
    {
        return real_system(cmd);
    }

    size_t n = strlen(cmd) + 5;
    char* new_cmd = (char*)malloc(n);
    // force double fork anything going through system
    snprintf(new_cmd, n, "(%s &)", cmd);
    int res = real_system(new_cmd);
    free(new_cmd);
    return res;
}

__attribute__((constructor))
void constructor(void)
{
    unsetenv("LD_PRELOAD");
    void* handle = dlopen("libc.so.6", RTLD_LAZY);
}

Alternatively use the attached so file system_fix.so.gz, and start steam like this: LD_PRELOAD=<absolute_path_of_system_fix.so> steam

So to sum up, this is not related to #5764 or #5279.

Nothing extracted yet.