Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Swaylock crashes after wakeup

Open diniamo opened this issue 1 year ago • 47 comments

Hyprland Version

Hyprland, built from branch main at commit 8f3848788422822c2cb36c57b4f3929eec1cc42c dirty (xwayland: don't change workspace on configure for invisible windows). Tag: v0.33.1-31-g8f384878 flags: (if any) debug

Bug or Regression?

Bug

Description

Seems to be similar to #1519, except I'm not on a laptop. This is not completely consistent, but it happens more often than not: annoying: sometimes, after my pc wakes up, swaylock crashes and becomes completely unresponsive. If I try to kill it from another tty, I get a red screen instead of Hyprland.

I use https://aur.archlinux.org/packages/swaylock-effects-git / https://github.com/jirutka/swaylock-effects.

How to reproduce

  1. Call swaylock before sleep (I use swayidle)
  2. Wake up the computer
  3. Try to login

Crash reports, logs, images, videos

Not sure where I'm supposed to find logs for this

diniamo avatar Dec 12 '23 13:12 diniamo

Might be #804 which I somehow did not find before opening this. Still, I can't find any crash logs.

diniamo avatar Dec 12 '23 16:12 diniamo

I have the exact same issue on my laptop (framework 13 amd). Non responsive sway lock and if I kill it, red screen. I have to kill hyprland and relogin so it is not a kernel panic.

aacebedo avatar Dec 27 '23 09:12 aacebedo

That's weird, it only happens on my nvidia computer for me.

diniamo avatar Dec 27 '23 20:12 diniamo

It seems random and appears more often after an hibernation than a sleep. I checked hyprland logs and saw nothing. I am trying to disable waylock to sort it out.

aacebedo avatar Dec 28 '23 08:12 aacebedo

I have noticed a pattern, the crash only happens if the fade animation doesn't finish (it might not be related directly), which happens if you use

before-sleep 'swaylock -f'

in swayidle for example. A workaround is to change the above line to

before-sleep 'sh -c "swaylock -f && sleep 3"'

diniamo avatar Dec 28 '23 17:12 diniamo

Never mind, I still think there is a pattern though.

diniamo avatar Dec 28 '23 17:12 diniamo

This doesn't address the underlying problem, but if you do pkill -SIGUSR1 swaylock from another tty it unlocks swaylock instead of killing it and leaving you with a red screen.

emekoi avatar Dec 28 '23 20:12 emekoi

I have noticed a pattern, the crash only happens if the fade animation doesn't finish (it might not be related directly), which happens if you use

before-sleep 'swaylock -f'

in swayidle for example. A workaround is to change the above line to

before-sleep 'sh -c "swaylock -f && sleep 3"'

I also lock this way using swayidle. Do you confirm it helps?

aacebedo avatar Dec 28 '23 20:12 aacebedo

This doesn't address the underlying problem, but if you do pkill -SIGUSR1 swaylock from another tty it unlocks swaylock instead of killing it and leaving you with a red screen.

Do you use swaylock-effects or swaylock? I am testing swaylock to confirm which one is having a problem.

I also read that it was the focus that is not given to swaylock and causing the problem.

aacebedo avatar Dec 28 '23 20:12 aacebedo

This doesn't address the underlying problem, but if you do pkill -SIGUSR1 swaylock from another tty it unlocks swaylock instead of killing it and leaving you with a red screen.

Do you use swaylock-effects or swaylock? I am testing swaylock to confirm which one is having a problem.

I also read that it was the focus that is not given to swaylock and causing the problem.

swaylock-effect i facing same problem

0xl30 avatar Dec 30 '23 15:12 0xl30

I've been hit by this bug since version 1.7 of swaylock, but swaylock-effects was working ok. Since swaylock-effects switched to version 1.7 on archlinux the same is happening

It is happening every time after hibernation. I'm using an intel GPU

bluemax75 avatar Jan 03 '24 23:01 bluemax75

I'm on NixOS (23.11) and am having the same issue using either swaylock v1.7 or using swaylock-effects v1.6.11. It happens somewhat randomly during normal use, but I seem to be able to reproduce it 100% of the time when I lock and suspend, and then try and wake up immediately after locking & suspending. Hyprland version is commit d74607e414dcd16911089a6d4b6aeb661c880923 (v0.33.1)

frisodubach avatar Jan 06 '24 11:01 frisodubach

I tested all of it previously with the same swaylock (not effect) version on sway and the error only occurs on hyprland, so it seems to be a compositor issue. @vaxerski any ideas?The same also happens for waylock. Gtklock doesn't work anymore due to the new wlroots version which deprecated the old locking protocol.

mauricekraus avatar Jan 06 '24 19:01 mauricekraus

cna I get a wayland_debug log pls

swylocks

vaxerski avatar Jan 06 '24 21:01 vaxerski

cna I get a wayland_debug log pls

swylocks

~I remember seeing some issue where someone mentioned setting WAYLAND_DEBUG=1, however, I can't seem to find it anymore. I can easily reproduce the bug, but not sure where to find the logs after inducing the bug. Would you able to point me to what you'd need to debug?~ Should HYPRLAND_LOG_WLR=1 also be set?

@vaxerski I think managed to figure out how to get it. Hope this helps: debug.log

frisodubach avatar Jan 06 '24 23:01 frisodubach

swaylock doesnt seem to have crashed in that loge tho?

vaxerski avatar Jan 07 '24 13:01 vaxerski

I've got the same issue. swaylock 1.7 hyprland on 7e033e48 from 2024-01-05. It started after hyprland update. journalctl.log

PanAeon avatar Jan 07 '24 23:01 PanAeon

I'm having trouble artificially reproducing this for the wayland logs, but it still happens 99% of the time normally.

Also, I'm not sure if this is related, but the order my swayidle runs things is swaylock -> dpms off -> systemctl suspend, the exception is if I sleep manually, in which case only swaylock is run. The weird thing is that if all 3 of the events go through, my system doesn't actually go to sleep, it only does so once I interact with my keyboard or mouse (both are set to cancel dpms off). Not sure if this is 100% consistent, but I've had it happen a lot.

I'll set swaylock up so it always dumps log files, and upload the next time I crash.

diniamo avatar Jan 09 '24 15:01 diniamo

I'm also on NixOS 23.11 and I've been having similar issues for a month or so now on both Hyprland (03ebbe1) and Sway (1.8.1), with swaylock and swaylock-effects. However unlike some other situations here I don't have auto lock on sleep configured.

It doesn't happen every time, but if I lock my laptop and close the lid then relatively often it'll be frozen when I open it. SIGUSR1 from another tty will unlock it. I'll try to get logs the next time it happens.

olistrik avatar Jan 10 '24 08:01 olistrik

@olistrik closing the laptop lid automatically puts the device to sleep.

diniamo avatar Jan 10 '24 14:01 diniamo

@diniamo yeah, though I thought it might be important that the locking, screen off, and sleeping events are not happening simultaneously or in quick succession. I usually lock my laptop and then close the screen ~10 seconds later.

I've had some issues in the past with i3lock because it couldn't lock faster than my laptop would go to sleep, or that swayidle would trigger immediately after waking.

olistrik avatar Jan 10 '24 20:01 olistrik

I have a similar issue on my PC where I sometimes get the red screen, but more often I get blank/corrupted windows as if they didn't fully restore. Then if I open new windows and cause layout changes, sometimes they mostly "regain" their content.

I'll try to reproduce later and post some logs.

ParetoOptimalDev avatar Jan 11 '24 15:01 ParetoOptimalDev

sorry for the late reply here is the swaylock log and coredump

swaylock.log

ignore the swaylock-error --screenshots, i guess this is an internal bug.

coredump_hypr.log

mauricekraus avatar Jan 12 '24 11:01 mauricekraus

OK this is very weird, after making swaylock blocking (by removing the -f flag, it still works in swayidle, even if you don't have it), I can't reproduce it anymore. Can someone test if this has anything to do with it?

diniamo avatar Jan 13 '24 14:01 diniamo

@diniamo -f is definitely not the problem

mauricekraus avatar Jan 13 '24 21:01 mauricekraus

Huhm, that's weird then

diniamo avatar Jan 13 '24 21:01 diniamo

next to the coredump and swaylock here is a journal entry from today:

I usually run this script (from anopther tty) after waking my computer due to the aforementioned issue (it happens every single time on my computer)

#!/bin/bash
#
pkill -USR1 swaylock

exit

After switching back: It apparently also kills my bar, no matter of ags or nwg-shell (its visible in the log) and sometimes even firefox or electron apps.

journal.log

@vaxerski if you need anything else just say so, the hyprland log is empty, do i need to build a debug build?

mauricekraus avatar Jan 16 '24 10:01 mauricekraus

next to the coredump and swaylock here is a journal entry from today:

I usually run this script (from anopther tty) after waking my computer due to the aforementioned issue (it happens every single time on my computer)

#!/bin/bash
#
pkill -USR1 swaylock

exit

After switching back: It apparently also kills my bar, no matter of ags or nwg-shell (its visible in the log) and sometimes even firefox or electron apps.

journal.log

@vaxerski if you need anything else just say so, the hyprland log is empty, do i need to build a debug build?

Same thing here, happening every wakeup on (my) primary display with multiple displays attached, happens occasionally with one display attached

Desktop PC, Alder Lake, AMDGPU (RX6650)

Happy to help troubleshoot this if I can be of help

opticblu avatar Jan 17 '24 01:01 opticblu

I managed to get the log files too: wayland_debug.log

diniamo avatar Jan 20 '24 13:01 diniamo

@diniamo, you can directly upload files on github.

mauricekraus avatar Jan 20 '24 14:01 mauricekraus