swaylock icon indicating copy to clipboard operation
swaylock copied to clipboard

Crash in seat.c when unplugging a display/keyboard/mouse

Open hedgepigdaniel opened this issue 5 years ago • 4 comments

If it happens again I may have a clearer picture of how to trigger it, but here's a stack trace:

#0  0x00007feada6632c0 in xkb_state_update_mask () at /usr/lib/libxkbcommon.so.0
#1  0x000056168fee0187 in keyboard_modifiers (data=0x56168fee7d20 <state>, wl_keyboard=0x561691baeae0, serial=8405, mods_depressed=0, mods_latched=0, mods_locked=0, group=0) at ../swaylock/seat.c:64
        state = 0x56168fee7d20 <state>
        caps_lock = 22038
#2  0x00007fead944a6d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#3  0x00007fead944a0a0 in ffi_call () at /usr/lib/libffi.so.6
#4  0x00007feada6528bc in wl_closure_invoke (closure=closure@entry=0x561691badba0, flags=flags@entry=1, target=<optimized out>, target@entry=0x561691baeae0, opcode=opcode@entry=4, data=<optimized out>)
    at src/connection.c:1006
        count = <optimized out>
        cif = {abi = FFI_UNIX64, nargs = 7, arg_types = 0x7ffe3049a2c0, rtype = 0x7fead944b180 <ffi_type_void>, bytes = 8, flags = 0}
        ffi_types = 
          {0x7fead944b060 <ffi_type_pointer>, 0x7fead944b060 <ffi_type_pointer>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7fead944b0e0 <ffi_type_uint32>, 0x7feada65068b <wl_proxy_marshal_array_constructor_versioned+178>, 0x561691bae870, 0x28, 0x561691bae870, 0x0, 0x56168fee6c20 <wl_callback_interface>, 0x7ffe3049a370, 0x0, 0x7feada651cad <wl_closure_clear_fds+59>, 0x75, 0xfceb347a3cc71200, 0x1, 0x561691bae700, 0x1, 0x7feada651fd9 <wl_closure_init+129>}
        ffi_args = 
          {0x7ffe3049a290, 0x7ffe3049a298, 0x561691badbb8, 0x561691badbc0, 0x561691badbc8, 0x561691badbd0, 0x561691badbd8, 0x561691bae7d0, 0x7ffe40000000, 0x561691ba9218, 0x7feada659d38 <wl_display_events+24>, 0x7feada6526fb <wl_closure_lookup_objects+160>, 0x561691ba9218, 0xfceb347a3cc71200, 0x91baa475, 0x561691bae0d0, 0x7feada654463, 0x3, 0x561691bae0d0, 0x0, 0x0, 0x7feada652de1 <wl_closure_destroy+22>}
        implementation = <optimized out>
#5  0x00007feada650132 in dispatch_event (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1427
        closure = 0x561691badba0
        proxy = 0x561691baeae0
        opcode = 4
        proxy_destroyed = <optimized out>
#6  0x00007feada650198 in dispatch_queue (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1573
        count = 4
#7  0x00007feada650ea6 in wl_display_dispatch_queue_pending (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1815
        ret = <optimized out>
#8  0x00007feada651049 in wl_display_dispatch_queue (display=display@entry=0x561691ba91a0, queue=queue@entry=0x561691ba9268) at src/wayland-client.c:1791
        ret = <optimized out>
#9  0x00007feada651244 in wl_display_roundtrip_queue (display=0x561691ba91a0, queue=0x561691ba9268) at src/wayland-client.c:1238
        display_wrapper = <optimized out>
        callback = 0x561691bae9d0
        done = 0
        ret = 0
#10 0x00007feada651277 in wl_display_roundtrip (display=<optimized out>) at src/wayland-client.c:1267
#11 0x000056168feddfac in main (argc=4, argv=0x7ffe3049a698) at ../swaylock/main.c:1135
        line_mode = LM_LINE
        config_path = 0x0
        result = 0
        registry = 0x561691bad320
        __PRETTY_FUNCTION__ = "main"
        surface = 0x56168fee7c90 <types+112>

hedgepigdaniel avatar Feb 21 '19 23:02 hedgepigdaniel

Happened to me as part of resuming my laptop after connecting my TB3 dock to where my screens/keyboard/mouse is connected.

Core was generated by `swaylock -e -F -f -i /home/kenny/.config/sway/lockscreen.jpg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007efd5c5b22c0 in xkb_state_update_mask () from /usr/lib/libxkbcommon.so.0
(gdb) bt full
#0  0x00007efd5c5b22c0 in xkb_state_update_mask () at /usr/lib/libxkbcommon.so.0
#1  0x000055e487725519 in keyboard_modifiers (data=0x55e48772cd20 <state>, wl_keyboard=0x55e4888c1320, serial=64599, mods_depressed=0, mods_latched=0, mods_locked=0, group=0) at ../swaylock/seat.c:64
        state = 0x55e48772cd20 <state>
        caps_lock = 21988
#2  0x00007efd5b7746d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#3  0x00007efd5b7740a0 in ffi_call () at /usr/lib/libffi.so.6
#4  0x00007efd5c5a2f8f in  () at /usr/lib/libwayland-client.so.0
#5  0x00007efd5c59f6ba in  () at /usr/lib/libwayland-client.so.0
#6  0x00007efd5c5a0bfc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#7  0x00007efd5c5a104c in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#8  0x000055e487721723 in handle_global (data=0x55e48772cd20 <state>, registry=0x55e4888b66b0, name=37, interface=0x55e4888c0670 "wl_output", version=3) at ../swaylock/main.c:341
        surface = 0x55e4888c2590
        state = 0x55e48772cd20 <state>
#9  0x00007efd5b7746d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#10 0x00007efd5b7740a0 in ffi_call () at /usr/lib/libffi.so.6
#11 0x00007efd5c5a2f8f in  () at /usr/lib/libwayland-client.so.0
#12 0x00007efd5c59f6ba in  () at /usr/lib/libwayland-client.so.0
#13 0x00007efd5c5a0bfc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#14 0x00007efd5c5a104c in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#15 0x000055e487721723 in handle_global (data=0x55e48772cd20 <state>, registry=0x55e4888b66b0, name=36, interface=0x55e4888c0890 "wl_output", version=3) at ../swaylock/main.c:341
        surface = 0x55e4888c2240
        state = 0x55e48772cd20 <state>
#16 0x00007efd5b7746d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#17 0x00007efd5b7740a0 in ffi_call () at /usr/lib/libffi.so.6
#18 0x00007efd5c5a2f8f in  () at /usr/lib/libwayland-client.so.0
#19 0x00007efd5c59f6ba in  () at /usr/lib/libwayland-client.so.0
#20 0x00007efd5c5a0bfc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#21 0x00007efd5c5a104c in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#22 0x000055e487721723 in handle_global (data=0x55e48772cd20 <state>, registry=0x55e4888b66b0, name=35, interface=0x55e4888c0aa0 "wl_output", version=3) at ../swaylock/main.c:341
        surface = 0x55e4888c1ef0
        state = 0x55e48772cd20 <state>
#23 0x00007efd5b7746d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#24 0x00007efd5b7740a0 in ffi_call () at /usr/lib/libffi.so.6
#25 0x00007efd5c5a2f8f in  () at /usr/lib/libwayland-client.so.0
#26 0x00007efd5c59f6ba in  () at /usr/lib/libwayland-client.so.0
#27 0x00007efd5c5a0bfc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#28 0x000055e487722ade in display_in (fd=3, mask=1, data=0x0) at ../swaylock/main.c:1008
#29 0x000055e48771ff43 in loop_poll (loop=0x55e4888c1390) at ../swaylock/loop.c:95
        pfd = {fd = 3, events = 1, revents = 1}
        events = 25
        ms = 2147483647
        fd_index = 0
        event = 0x55e4888c1c80
#30 0x000055e487723182 in main (argc=6, argv=0x7ffe287ca2f8) at ../swaylock/main.c:1155
        line_mode = LM_LINE
        config_path = 0x0
        result = 0
        registry = 0x55e4888b66b0
        __PRETTY_FUNCTION__ = "main"
        surface = 0x55e48772cc18

kennylevinsen avatar Mar 31 '19 17:03 kennylevinsen

I get the same SEGV when I disconnect my laptop from my ThinkPad dock (with screens/keyboard/mouse) and immediately close the lid which triggers swaylock. On wake-up, I find my laptop unlocked.

Coredump using the latest build from master with debug flags:

Core was generated by `/home/michael/projects/arch/swaylock/build/swaylock -d -f -c 000000'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fbae25ed2c0 in xkb_state_update_mask () from /usr/lib/libxkbcommon.so.0
(gdb) bt full
#0  0x00007fbae25ed2c0 in xkb_state_update_mask () at /usr/lib/libxkbcommon.so.0
#1  0x000055fa5f7b5723 in keyboard_modifiers
    (data=0x55fa5f7bdd60 <state>, wl_keyboard=0x55fa5fec7e70, serial=119608, mods_depressed=0, mods_latched=0, mods_locked=0, group=0) at ../seat.c:64
        state = 0x55fa5f7bdd60 <state>
        caps_lock = 22010
#2  0x00007fbae17ed6d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#3  0x00007fbae17ed0a0 in ffi_call () at /usr/lib/libffi.so.6
#4  0x00007fbae25ddf8f in  () at /usr/lib/libwayland-client.so.0
#5  0x00007fbae25da6ba in  () at /usr/lib/libwayland-client.so.0
#6  0x00007fbae25dbbfc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#7  0x00007fbae25dc04c in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#8  0x000055fa5f7b32cb in main (argc=5, argv=0x7ffc52d5fa08) at ../main.c:1173
        line_mode = LM_LINE
        config_path = 0x0
        result = 0
        registry = 0x55fa5fec1590
        __PRETTY_FUNCTION__ = "main"
        surface = 0x55fa5f7bdc58

mherzberg avatar Apr 30 '19 09:04 mherzberg

Also happens to me regularly. I am using the latest stable version installed from fedora modules rolling. This issue is quite annoying because I cannot assume the my notebook is securely locked.

Coredump with bt full. Edit: Installed debug symbols.

$ coredumpctl gdb 4112459
           PID: 4112459 (swaylock)
           UID: 1000 (schroeter)
           GID: 1000 (schroeter)
        Signal: 11 (SEGV)
     Timestamp: Thu 2020-01-16 16:58:50 CET (14h ago)
  Command Line: swaylock -f -i /home/schroeter/wallpaper -s fill
    Executable: /usr/bin/swaylock
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (schroeter)
       Boot ID: 05520c18c36d47c2a7c2a6d9eda77e26
    Machine ID: 843dee14172340d1a90273ceeff7e2c1
      Hostname: faustaff-010-020-012-041.pool.uni-erlangen.de
       Storage: /var/lib/systemd/coredump/core.swaylock.1000.05520c18c36d47c2a7c2a6d9eda77e26.4112459.1579190330000000000000.lz4
       Message: Process 4112459 (swaylock) of user 1000 dumped core.

                Stack trace of thread 4112459:
                #0  0x00007f91c04c7c14 xkb_state_update_mask (libxkbcommon.so.0)
                #1  0x000055e7b5cc5cfb keyboard_modifiers (swaylock)
                #2  0x00007f91bfa8aaa8 ffi_call_unix64 (libffi.so.6)
                #3  0x00007f91bfa8a2a4 ffi_call (libffi.so.6)
                #4  0x00007f91c04a15e8 wl_closure_invoke (libwayland-client.so.0)
                #5  0x00007f91c049df18 dispatch_event.isra.0 (libwayland-client.so.0)
                #6  0x00007f91c049f46c wl_display_dispatch_queue_pending (libwayland-client.so.0)
                #7  0x000055e7b5cc3294 display_in (swaylock)
                #8  0x000055e7b5cc307f loop_poll (swaylock)
                #9  0x000055e7b5cc1765 main (swaylock)
                #10 0x00007f91c02e21a3 __libc_start_main (libc.so.6)
                #11 0x000055e7b5cc1c0e _start (swaylock)

GNU gdb (GDB) Fedora 8.3.50.20190824-26.fc31
Copyright (C) 2019 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-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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...
Reading symbols from /usr/lib/debug/usr/bin/swaylock-1.4-2.module_f32+6140+eb754d2b.x86_64.debug...
[New LWP 4112459]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `swaylock -f -i /home/schroeter/wallpaper -s fill'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f91c04c7c14 in xkb_state_update_mask (state=0x0, base_mods=0, latched_mods=0, locked_mods=0, base_group=base_group@entry=0,
    latched_group=latched_group@entry=0, locked_group=0) at ../src/state.c:808
808	{
(gdb) bt full
#0  0x00007f91c04c7c14 in xkb_state_update_mask (state=0x0, base_mods=0, latched_mods=0, locked_mods=0, base_group=base_group@entry=0, latched_group=latched_group@entry=0, locked_group=0)
    at ../src/state.c:808
        prev_components = {base_group = 0, latched_group = 0, locked_group = 0, group = 0, base_mods = 3074773024, latched_mods = 21991, locked_mods = 3227134011, mods = 32657, leds = 3543287528}
        mask = <optimized out>
#1  0x000055e7b5cc5cfb in keyboard_modifiers
    (data=0x55e7b5ccd8a0 <state>, wl_keyboard=<optimized out>, serial=<optimized out>, mods_depressed=<optimized out>, mods_latched=<optimized out>, mods_locked=<optimized out>, group=0) at ../seat.c:64
        state = 0x55e7b5ccd8a0 <state>
        caps_lock = <optimized out>
#2  0x00007f91bfa8aaa8 in ffi_call_unix64 () at ../src/x86/unix64.S:76
#3  0x00007f91bfa8a2a4 in ffi_call (cif=cif@entry=0x7ffed33245f0, fn=<optimized out>, rvalue=<optimized out>, rvalue@entry=0x0, avalue=avalue@entry=0x7ffed33246c0) at ../src/x86/ffi64.c:525
        classes = {X86_64_INTEGERSI_CLASS, X86_64_NO_CLASS, 3215503456, 32657}
        stack = <optimized out>
        argp = 0x7ffed33244c4 "\376\177"
        arg_types = <optimized out>
        gprcount = 6
        ssecount = <optimized out>
        ngpr = 1
        nsse = 0
        i = <optimized out>
        avn = <optimized out>
        ret_in_memory = <optimized out>
        reg_args = <optimized out>
#4  0x00007f91c04a15e8 in wl_closure_invoke (closure=closure@entry=0x55e7b7453610, flags=flags@entry=1, target=<optimized out>, target@entry=0x55e7b7454c20, opcode=opcode@entry=4, data=<optimized out>)
    at src/connection.c:1014
        count = 5
        cif = {abi = FFI_UNIX64, nargs = 7, arg_types = 0x7ffed3324610, rtype = 0x7f91bfa8b180 <ffi_type_void>, bytes = 8, flags = 0}
        ffi_types =
          {0x7f91bfa8b060 <ffi_type_pointer>, 0x7f91bfa8b060 <ffi_type_pointer>, 0x7f91bfa8b0e0 <ffi_type_uint32>, 0x7f91bfa8b0e0 <ffi_type_uint32>, 0x7f91bfa8b0e0 <ffi_type_uint32>, 0x7f91bfa8b0e0 <ffi_type_uint32>, 0x7f91bfa8b0e0 <ffi_type_uint32>, 0x7f91c04a0091 <wl_connection_read+241>, 0x0, 0x55e7b74513f0, 0x0, 0x55e700000000, 0x7ffed33246a0, 0x2, 0x7ffed33246c0, 0x0, 0x7ffe40000000, 0x7f91c04a0405 <wl_closure_clear_fds+53>, 0x7f91c04a7790 <wl_buffer_events>, 0x7d70268cd7f24d00, 0x0, 0x7f91c04a05de <wl_closure_init+174>}
        ffi_args =
          {0x7ffed33245e0, 0x7ffed33245e8, 0x55e7b7453628, 0x55e7b7453630, 0x55e7b7453638, 0x55e7b7453640, 0x55e7b7453648, 0x55e7b744f3e0, 0x55e7b7454c10, 0x55e7b7454b40, 0x8b7453d00, 0x7f91c04a130c <wl_closure_lookup_objects+60>, 0x7f91c04a7790 <wl_buffer_events>, 0x7f91c04a048d <wl_closure_close_fds+77>, 0xc04a7761, 0x7d70268cd7f24d00, 0xd3324775, 0x7ffed3324780, 0x7f91c04a3473, 0x55e7b7440780, 0x55e7b7440750, 0x55e7b7440780}
        implementation = <optimized out>
#5  0x00007f91c049df18 in dispatch_event (display=display@entry=0x55e7b7449520, queue=<optimized out>) at src/wayland-client.c:1430
        closure = 0x55e7b7453610
        proxy = 0x55e7b7454c20
        opcode = 4
        proxy_destroyed = <optimized out>
#6  0x00007f91c049f46c in dispatch_queue (queue=0x55e7b74495e8, display=0x55e7b7449520) at src/wayland-client.c:1576
        count = 6
        ret = <optimized out>
#7  wl_display_dispatch_queue_pending (display=0x55e7b7449520, queue=0x55e7b74495e8) at src/wayland-client.c:1818
        ret = <optimized out>
#8  0x000055e7b5cc3294 in display_in (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../main.c:1041
#9  0x000055e7b5cc307f in loop_poll (loop=0x55e7b7454980) at ../loop.c:95
        pfd = <optimized out>
        events = <optimized out>
        ms = <optimized out>
        fd_index = <optimized out>
        event = 0x55e7b74547d0
#10 0x000055e7b5cc1765 in main (argc=6, argv=0x7ffed3324a48) at ../main.c:1189
        line_mode = LM_LINE
        config_path = 0x0
        result = <optimized out>
        registry = <optimized out>
        __PRETTY_FUNCTION__ = "main"
        surface = <optimized out>

Rikorose avatar Jan 17 '20 05:01 Rikorose

Likely fixed by https://github.com/swaywm/swaylock/pull/225

emersion avatar Feb 10 '22 08:02 emersion