sway: Crash when swayidle locks the screen

Please fill out the following:

  • Sway Version:

    • sway version 1.8
  • Debug Log:

This seems to only happen when started via GDM. No debug log available there unfortunately.

  • Configuration File:

Relevant section regarding swayidle:

exec swayidle -w \
    timeout 300 'swaylock -f -c 444444' \
    timeout 360 'swaymsg "output * dpms off"' \
    before-sleep 'swaylock -f -c 444444' \
    after-resume 'swaymsg "output * dpms on"'
  • Stack Trace:
#0  0x00007f89ea66ef34 in wlr_surface_accepts_tablet_v2 (tablet=0x556abb28b820, surface=surface@entry=0x0)
    at ../types/tablet_v2/wlr_tablet_v2_pad.c:573
        client = <optimized out>
        tablet_tmp = <optimized out>
#1  0x0000556ab868f912 in sway_tablet_pad_notify_enter (surface=0x0, tablet_pad=0x556abb092040) at ../sway/input/tablet.c:363
        seat_device = 0x556abb224320
#2  sway_tablet_pad_notify_enter (surface=0x0, tablet_pad=0x556abb092040) at ../sway/input/tablet.c:344
        seat_device = 0x556abb224320
#3  seat_tablet_pads_notify_enter (seat=seat@entry=0x556abad73b50, surface=0x0) at ../sway/input/seat.c:183
        seat_device = 0x556abb224320
#4  0x0000556ab8693b06 in seat_set_focus_surface
    (seat=seat@entry=0x556abad73b50, surface=<optimized out>, unfocus=unfocus@entry=false) at ../sway/input/seat.c:1316
#5  0x0000556ab8693c03 in seat_set_focus (node=<optimized out>, seat=0x556abad73b50) at ../sway/input/seat.c:1287
#6  0x0000556ab8695825 in seat_set_exclusive_client (seat=0x556abad73b50, client=0x556abb4985a0) at ../sway/input/seat.c:1361
        focus = <optimized out>
        now = {tv_sec = 140230318746720, tv_nsec = 140230320521348}
        point = <optimized out>
#7  0x0000556ab8683353 in handle_session_lock (listener=<optimized out>, data=0x556abb3fd2a0) at ../sway/lock.c:191
        lock = 0x556abb3fd2a0
        client = 0x556abb4985a0
        seat = 0x556abad73b50
#8  0x00007f89ea70e42c in wl_signal_emit_mutable () at /lib64/libwayland-server.so.0
#9  0x00007f89e9cbb872 in  () at /lib64/libffi.so.8
#10 0x00007f89e9cb8210 in  () at /lib64/libffi.so.8
#11 0x00007f89e9cbae76 in ffi_call () at /lib64/libffi.so.8
#12 0x00007f89ea70d0c8 in  () at /lib64/libwayland-server.so.0
#13 0x00007f89ea711348 in  () at /lib64/libwayland-server.so.0
#14 0x00007f89ea70fdd2 in wl_event_loop_dispatch () at /lib64/libwayland-server.so.0
#15 0x00007f89ea710515 in wl_display_run () at /lib64/libwayland-server.so.0
#16 0x0000556ab867838d in server_run (server=<optimized out>) at ../sway/server.c:313
        config_path = 0x0
        c = <optimized out>
        validate = false
        debug = false
        allow_unsupported_gpu = false
        verbose = false
#17 main (argc=<optimized out>, argv=0x7ffc378563b8) at ../sway/main.c:415
        config_path = 0x0
        c = <optimized out>
        validate = false
        debug = false
        allow_unsupported_gpu = false
        verbose = false
  • Description:

Starting with the update of sway to 1.8 on my opensuse tumbelweed system, I am now seeing that once swayidle starts to lock the screen, sway crashes immediately. This wasn’t the case with 1.7. Moreover, manually starting swaylock also doesn’t trigger anything.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 19 (9 by maintainers)

Most upvoted comments

I have confirmed via bisect that the problem is caused by 8aa89dc27736fc4940f3811ef15bb3135e629a8c. I’m not sure exactly how it should be fixed, though.


Update (edited in to avoid sending unnecessary notifications)

I really need to workaround this, so I’m applying the following patch in my local machine. I don’t know if it is correct, but it does prevent crashing, and that’s really the important part for me at the moment.

diff --git a/sway/input/seat.c b/sway/input/seat.c
index 646f3866..33068b7c 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1283,7 +1283,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
 	} else {
 		seat_set_workspace_focus(seat, node);
 	}
-	if (server.session_lock.locked) {
+	if (server.session_lock.locked && server.session_lock.focused != NULL) {
 		seat_set_focus_surface(seat, server.session_lock.focused, false);
 	}
 }

Hi all, adding --screenshot solves the issue for the me.

I’m also getting red screen lock up when swayidle locks the screen. Downgrading sway and wlroots fixes the problem.

Yep It was swaylock-effects, so I’ve changed back to swaylock with no issues.