ublue-os / bazzite

Bazzite is a custom image built upon Fedora Atomic Desktops that brings the best of Linux gaming to all of your devices - including your favorite handheld.
https://bazzite.gg
Apache License 2.0
3.23k stars 175 forks source link

Freeze on "Shutting down Steam" when using "Shutdown" or "Reboot" option in Game Mode #1264

Open MatthijsMarco opened 2 weeks ago

MatthijsMarco commented 2 weeks ago

Describe the bug

When attempting to shutdown or reboot the system from the Game Mode UI, the system hangs on the "Shutting down Steam" screen.

What did you expect to happen?

A successful shutdown or reboot.

Output of rpm-ostree status

State: idle
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:b5b9747ef6b7608fcca8b9813d95509b2ae9235a1ba37a1fb49ef175c46e86bb
                  Version: 40.20240621.0 (2024-06-21T05:13:33Z)
          LayeredPackages: strace
            LocalPackages: lact-0.5.4-0.x86_64

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:b5b9747ef6b7608fcca8b9813d95509b2ae9235a1ba37a1fb49ef175c46e86bb
                  Version: 40.20240621.0 (2024-06-21T05:13:33Z)
            LocalPackages: lact-0.5.4-0.x86_64

Hardware

bazzite-deck:stable 
Fedora Linux 40 (Kinoite) x86_64
Linux 6.9.4-201.fsync.fc40.x86_64
15 mins
Spawned on Jan 20 2024

Z390 AORUS PRO WIFI
Intel(R) Core(TM) i9-9900K (16) @ 5.00 GHz
AMD Radeon RX 7600 [Discrete]
3.35 GiB / 31.26 GiB (11%)
31.93 GiB / 68.35 GiB (47%) - ext4 [Read-only]
3.08 TiB / 7.15 TiB (43%) - ext4
1920x1080 @ 60Hz
3840x2160 @ 60Hz [External]

bash 5.2.26
/dev/pts/0
2746 (rpm), 48 (flatpak-system), 7 (flatpak-user)

Extra information or context

There seems to be a zombie process:

marco@fedora:~$ ps aux | awk '$8 ~ /^[Zz]/'
marco       6174  0.0  0.0      0     0 ?        Z<s  12:55   0:00 [steam-runtime-s] <defunct>

It comes from the following parent process:

marco@fedora:~$ ps -o ppid= 6174
   6104
marco@fedora:~$ ps -Flww -p 6104
F S UID          PID    PPID  C PRI  NI ADDR SZ WCHAN    RSS PSR STIME TTY          TIME CMD
4 S marco       6104    5970  1  75  -5 - 200659 hrtime 229048 12 12:55 ?       00:00:14 /var/home/marco/.local/share/Steam/ubuntu12_32/steam -srt-logger-opened -gamepadui -steamos3 -steampal -steamdeck

Which gives he following strace output (ad infinitum):

marco@fedora:~$ sudo strace -p 6104
strace: Process 6104 attached
[ Process PID=6104 runs in 32 bit mode. ]
restart_syscall(<... resuming interrupted read ...>) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
getpid()                                = 6104
tgkill(6104, 6511, 0)                   = 0
rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=50000000}, 0xffbf2234) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
getpid()                                = 6104
tgkill(6104, 6511, 0)                   = 0
rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=50000000}, 0xffbf2234) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
getpid()                                = 6104
tgkill(6104, 6511, 0)                   = 0
rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=50000000}, 0xffbf2234) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
getpid()                                = 6104
tgkill(6104, 6511, 0)                   = 0
rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=50000000}, 0xffbf2234) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
getpid()                                = 6104
tgkill(6104, 6511, 0)                   = 0

The process mentioned in the strace output (6511) doesn't seem to exist:

marco@fedora:~$ ps -Flww -p 6511
F S UID          PID    PPID  C PRI  NI ADDR SZ WCHAN    RSS PSR STIME TTY          TIME CMD

But, for some reason, sending a kill command to the phantom process successfully continues the shutdown process:

marco@fedora:~$ kill -9 6174 (the zombie process, but this doesn't seem to do anything)
marco@fedora:~$ kill -9 6511
marco@fedora:~$ 
Broadcast message from marco@fedora (Sun 2024-06-23 13:28:34 CEST):

The system will reboot now!

client_loop: send disconnect: Broken pipe
NightHammer1000 commented 5 days ago

Can sign that one. Have the Same Issue for weeks now.

MatthijsMarco commented 5 days ago

Strangely, the problem seems to have fixed itself a few days ago (I didn't notice, but my girlfriend said she used our HTPC and never even knew it was an issue, which was quite funny). This is the second time I've had this bug (should have mentioned that in the original post, sorry). Last time I thought one of my troubleshooting steps helped, but now I'm unsure. Since it isn't the first time and someone else also had the issue now, I'll leave the issue open for now.

MatthijsMarco commented 2 days ago

Alright everyone, get your voodoo dolls and detective hats out, because we have a curse to investigate: after applying the fix script to be able to receive updates again, the issue reappeared! I'm genuinely stumped, and quite annoyed.

NightHammer1000 commented 1 day ago

I had to completely reinstall Bazzite to get rid of it. Not even Rebasing solved it. I could also rule out Decky and all its Plugin as it also happened with Decky removed.

MatthijsMarco commented 20 hours ago

I managed to fix it! (Sorry that I found it too late for you, @NightHammer1000 ) This thread describes the issue for Steam Deck.

For Bazzite:

Considering how many people are complaining about this issue without a fix, I'm surprised how far I had to scroll to find someone with an actual solution (4th or 5th page of Google). While the issue itself is now resolved, I'd like a dev's comment on if a preventative fix can be applied to avoid this issue in the future. Afterwards the issue can be closed.