swaylock icon indicating copy to clipboard operation
swaylock copied to clipboard

swaylock crashed during/after changing outputs

Open stromnet opened this issue 3 years ago • 6 comments

swaylock 1.5-1, sway 1.6.1-1, pixman 0.40.0-1, cairo 1.17.4-5 from Arch packages. Lenovo X1 G9 Laptop with Intel GPU.

Laptop was connected to one USB-C dock with some displays. Outputs off, swaylock running. Disconnected and connected to another dock with other, larger, displays. When waking up (dpms on) the desktop was accessible.

Looking in journalctl I noticed swaylock had crashed 2 seconds after new USB devices where logged, so seems to be on the plugin.

Unfortnuately no debugging symbols:

(lldb) bt all
* thread #1, name = 'swaylock', stop reason = signal SIGBUS
  * frame #0: 0x00007fdda89acf50 libpixman-1.so.0`___lldb_unnamed_symbol27$$libpixman-1.so.0 + 240
    frame #1: 0x00007fdda8a1ee66 libpixman-1.so.0`pixman_fill + 102
    frame #2: 0x00007fdda91b5302 libcairo.so.2`___lldb_unnamed_symbol291$$libcairo.so.2 + 194
    frame #3: 0x00007fdda91ef38b libcairo.so.2`___lldb_unnamed_symbol764$$libcairo.so.2 + 267
    frame #4: 0x00007fdda91efe1c libcairo.so.2`___lldb_unnamed_symbol766$$libcairo.so.2 + 108
    frame #5: 0x00007fdda91a9301 libcairo.so.2`___lldb_unnamed_symbol132$$libcairo.so.2 + 81
    frame #6: 0x00007fdda91f7d78 libcairo.so.2`___lldb_unnamed_symbol833$$libcairo.so.2 + 184
    frame #7: 0x00007fdda91aedfc libcairo.so.2`___lldb_unnamed_symbol227$$libcairo.so.2 + 124
    frame #8: 0x00007fdda9204bf5 libcairo.so.2`cairo_paint + 21
    frame #9: 0x00005611560f4450 swaylock`___lldb_unnamed_symbol62$$swaylock + 432
    frame #10: 0x00005611560f4b7b swaylock`___lldb_unnamed_symbol62$$swaylock + 2267
    frame #11: 0x00005611560f308d swaylock`___lldb_unnamed_symbol37$$swaylock + 93
    frame #12: 0x00007fdda8569acd libffi.so.7`___lldb_unnamed_symbol31$$libffi.so.7 + 85
    frame #13: 0x00007fdda856903a libffi.so.7`___lldb_unnamed_symbol28$$libffi.so.7 + 426
    frame #14: 0x00007fdda909afe4 libwayland-client.so.0`___lldb_unnamed_symbol38$$libwayland-client.so.0 + 372
    frame #15: 0x00007fdda9097563 libwayland-client.so.0`___lldb_unnamed_symbol6$$libwayland-client.so.0 + 355
    frame #16: 0x00007fdda9098cac libwayland-client.so.0`wl_display_dispatch_queue_pending + 124
    frame #17: 0x00005611560f21c1 swaylock`___lldb_unnamed_symbol30$$swaylock + 17
    frame #18: 0x00005611560f1faf swaylock`___lldb_unnamed_symbol24$$swaylock + 127
    frame #19: 0x00005611560f05ff swaylock`___lldb_unnamed_symbol1$$swaylock + 1503
    frame #20: 0x00007fdda8ed8b25 libc.so.6`__libc_start_main + 213
    frame #21: 0x00005611560f0ade swaylock`___lldb_unnamed_symbol2$$swaylock + 46
    ```

Related to #179? Except it was explicitly trigged by this event, usually not an issue at all.

stromnet avatar Oct 13 '21 11:10 stromnet

@stromnet Thanks for opening this. I think I have a pretty similar issue, with 2 external monitors connected over Thunderbolt 4.

I don't have a backtrace, and I also don't know when exactly things go wrong. I've been playing a bit by changing swayidle parameters to:

swayidle -w \
     timeout 300 'swaylock -f -c 000000' \
     timeout 600 'swaymsg "output * dpms off"' \
     resume 'swaymsg "output eDP-1 dpms on"' \
     before-sleep 'swaylock -f -c 000000'

So only renable the laptop screen after waking up, but also that did not help.


In my case, when swaylock crashes I can move my mouse cursor around, and that's about it. When the external monitors are enabled I can switch workspaces, but I cannot interact with any application. I haven't found a way to get my computer working again without a hard reboot.

To1ne avatar Oct 21 '21 10:10 To1ne

In my case the system was fully operational. However, I did have some other interesting issues, when connecting laptop to some Logitech video conference system via HDMI; initially it all worked fine, but after some time (did not notify any explicit triggering it) the mouse cursor dissapeared on laptop output. Worked fine on external output. And after unplugging, I had no cursor at all until restarting sway. This happened twice.

Unfortunately both of these setups where only temporary available to me, so cannot try to reproduce.

stromnet avatar Oct 21 '21 20:10 stromnet

I have to retract that. In my case I'm hitting a bug in sway itself which makes it look like swaylock isn't working. My bad. (hard to debug)

To1ne avatar Nov 21 '21 11:11 To1ne

I had no cursor at all until restarting sway. This happened twice.

I've got that one sometimes too and no idea what causes it. Not even sure this is related to swaylock or just an issue in sway.

boredland avatar Nov 21 '21 11:11 boredland

I'm using the patch from https://github.com/swaywm/sway/issues/5757#issuecomment-882028355 now. So far it fixes my issue.

To1ne avatar Nov 22 '21 08:11 To1ne

Hi, I had the same issue today. When I plugged out my HDMI display, swaylock crashed and my desktop became accessible.

# coredumpctl gdb
           PID: 247095 (swaylock)
           UID: 1000 (user)
           GID: 1000 (user)
        Signal: 6 (ABRT)
     Timestamp: Tue 2022-01-11 12:00:00 CET
  Command Line: swaylock -f -c 000000
    Executable: /usr/bin/swaylock
 Control Group: /user.slice/user-1000.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1000.slice
       Session: 3
     Owner UID: 1000 (user)
       Boot ID: redacted
    Machine ID: redacted
      Hostname: redacted
       Storage: /var/lib/systemd/coredump/core.swaylock.1000.0123456789abcdef0123456789abcdef.abcdef.0123456789abcdef.zst (present)
     Disk Size: 441.8K
       Message: Process 247095 (swaylock) of user 1000 dumped core.

GNU gdb (GDB) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/swaylock...
(No debugging symbols found in /usr/bin/swaylock)

[New LWP 247095]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `swaylock -f -c 000000'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00006eaede00ad22 in raise () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00006eaede00ad22 in raise () at /usr/lib/libc.so.6
#1  0x00006eaeddff4862 in abort () at /usr/lib/libc.so.6
#2  0x00006eaede04cd28 in __libc_message () at /usr/lib/libc.so.6
#3  0x00006eaede05492a in  () at /usr/lib/libc.so.6
#4  0x00006eaede0559cc in malloc_consolidate () at /usr/lib/libc.so.6
#5  0x00006eaede05788b in _int_malloc () at /usr/lib/libc.so.6
#6  0x00006eaede059397 in malloc () at /usr/lib/libc.so.6
#7  0x00006eaede2f60c3 in  () at /usr/lib/libcairo.so.2
#8  0x00006eaede2e0c1a in  () at /usr/lib/libcairo.so.2
#9  0x00006eaede306187 in  () at /usr/lib/libcairo.so.2
#10 0x00006eaede3060d7 in  () at /usr/lib/libcairo.so.2
#11 0x00006eaede3060bc in  () at /usr/lib/libcairo.so.2
#12 0x00006eaede3060bc in  () at /usr/lib/libcairo.so.2
#13 0x00006eaede3060bc in  () at /usr/lib/libcairo.so.2
#14 0x00006eaede30da30 in  () at /usr/lib/libcairo.so.2
#15 0x00006eaede2e11dc in  () at /usr/lib/libcairo.so.2
#16 0x00006eaede2e879a in  () at /usr/lib/libcairo.so.2
#17 0x00006eaede2e8886 in  () at /usr/lib/libcairo.so.2
#18 0x00006eaede30d53b in  () at /usr/lib/libcairo.so.2
#19 0x00006eaede2c688e in  () at /usr/lib/libcairo.so.2
#20 0x00006eaede2d6285 in  () at /usr/lib/libcairo.so.2
#21 0x00006eaede315406 in  () at /usr/lib/libcairo.so.2
#22 0x00006eaede2cc995 in  () at /usr/lib/libcairo.so.2
#23 0x00006eaede321e85 in cairo_fill_preserve () at /usr/lib/libcairo.so.2
#24 0x00000d8ea28b65fc in  ()
#25 0x00000d8ea28b508d in  ()
#26 0x00006eaedd684d4a in  () at /usr/lib/libffi.so.8
#27 0x00006eaedd684267 in  () at /usr/lib/libffi.so.8
#28 0x00006eaede1b8323 in  () at /usr/lib/libwayland-client.so.0
#29 0x00006eaede1b45ab in  () at /usr/lib/libwayland-client.so.0
#30 0x00006eaede1b5f4c in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#31 0x00000d8ea28b41c1 in  ()
#32 0x00000d8ea28b3faf in  ()
#33 0x00000d8ea28b25ff in  ()
#34 0x00006eaeddff5b25 in __libc_start_main () at /usr/lib/libc.so.6
#35 0x00000d8ea28b2ade in  ()

Running Arch Linux with these packages:

cairo 1.17.4-5
swaylock 1.5-1
sway 1:1.6.1-2
wayland 1.20.0-1
xorg-xwayland 21.1.4-1

Thanks in advance!

throwaway-sl-crash avatar Jan 11 '22 12:01 throwaway-sl-crash