Open mirko opened 3 years ago
Please reproduce with a manually compiled swaylock and post the new stack trace.
Please reproduce with a manually compiled swaylock and post the new stack trace.
I won't be able to do so on this very machine - at least not immediately.
For the record, a backtrace with debug symbols installed/resolved:
$ gdb /usr/bin/swaylock swaylock.dbg.coredump
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
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-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...
Reading symbols from /usr/lib/debug/.build-id/e4/a2b3023af52ea7db8335973295081c0eefbc8e.debug...
warning: Can't open file /run/user/1000/sway-client-2tGGCz (deleted) during file-backed mapping note processing
warning: Can't open file /run/user/1000/sway-client-a3xSbA (deleted) during file-backed mapping note processing
warning: Can't open file /run/user/1000/sway-client-ecJ0CB (deleted) during file-backed mapping note processing
warning: Can't open file /run/user/1000/sway-client-hQPSFB (deleted) during file-backed mapping note processing
warning: Can't open file /dev/shm/wlroots-bEmopO (deleted) during file-backed mapping note processing
warning: Can't open file /run/user/1000/sway-client-L9TnHC (deleted) during file-backed mapping note processing
[New LWP 10929]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `swaylock -c 000000'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f7e4788a537 in __GI_abort () at abort.c:79
#2 0x00007f7e478e3768 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f7e479f1e2d "%s\n")
at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007f7e478eaa5a in malloc_printerr (str=str@entry=0x7f7e479f4110 "malloc_consolidate(): invalid chunk size")
at malloc.c:5347
#4 0x00007f7e478eb918 in malloc_consolidate (av=av@entry=0x7f7e47a23b80 <main_arena>) at malloc.c:4477
#5 0x00007f7e478ed755 in _int_malloc (av=av@entry=0x7f7e47a23b80 <main_arena>, bytes=bytes@entry=1424) at malloc.c:3699
#6 0x00007f7e478efed1 in __libc_calloc (n=n@entry=1, elem_size=elem_size@entry=1424) at malloc.c:3428
#7 0x00007f7e47a6d51e in xkb_keymap_new (ctx=0x55b410184f90, format=format@entry=XKB_KEYMAP_FORMAT_TEXT_V1,
flags=flags@entry=XKB_KEYMAP_COMPILE_NO_FLAGS) at ../src/keymap-priv.c:62
#8 0x00007f7e47a6cd36 in xkb_keymap_new_from_buffer (ctx=<optimized out>,
buffer=buffer@entry=0x7f7e46942000 "xkb_keymap {\nxkb_keycodes \"(unnamed)\" {\n\tminimum = 8;\n\tmaximum = 569;\n\t<ESC>", ' ' <repeats 16 times>, "= 9;\n\t<AE01>", ' ' <repeats 15 times>, "= 10;\n\t<AE02>", ' ' <repeats 15 times>, "= 11;\n\t<AE03>", ' ' <repeats 15 times>, "= 12;\n\t<AE04>", ' ' <repeats 12 times>..., length=49092,
format=format@entry=XKB_KEYMAP_FORMAT_TEXT_V1, flags=flags@entry=XKB_KEYMAP_COMPILE_NO_FLAGS) at ../src/keymap.c:193
#9 0x00007f7e47a6ce1b in xkb_keymap_new_from_string (ctx=<optimized out>,
string=string@entry=0x7f7e46942000 "xkb_keymap {\nxkb_keycodes \"(unnamed)\" {\n\tminimum = 8;\n\tmaximum = 569;\n\t<ESC>", ' ' <repeats 16 times>, "= 9;\n\t<AE01>", ' ' <repeats 15 times>, "= 10;\n\t<AE02>", ' ' <repeats 15 times>, "= 11;\n\t<AE03>", ' ' <repeats 15 times>, "= 12;\n\t<AE04>", ' ' <repeats 12 times>..., format=format@entry=XKB_KEYMAP_FORMAT_TEXT_V1,
flags=flags@entry=XKB_KEYMAP_COMPILE_NO_FLAGS) at ../src/keymap.c:164
#10 0x000055b40f14874b in keyboard_keymap (data=0x55b40f14f900 <state>, wl_keyboard=<optimized out>, format=<optimized out>,
fd=6, size=49093) at ../seat.c:24
#11 0x00007f7e46e36d1d in ffi_call_unix64 () at ../src/x86/unix64.S:101
#12 0x00007f7e46e36289 in ffi_call_int (cif=0x7ffef714cb60, fn=0x55b40f1486f0 <keyboard_keymap>, rvalue=<optimized out>,
avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:669
#13 0x00007f7e47a472d2 in wl_closure_invoke (closure=closure@entry=0x55b4102038f0, flags=flags@entry=1,
target=<optimized out>, target@entry=0x55b41018b4c0, opcode=opcode@entry=0, data=<optimized out>)
at ../src/connection.c:1018
#14 0x00007f7e47a4397a in dispatch_event (display=display@entry=0x55b410185860, queue=<optimized out>, queue=<optimized out>)
at ../src/wayland-client.c:1445
#15 0x00007f7e47a4503c in dispatch_queue (queue=0x55b410185930, display=0x55b410185860) at ../src/wayland-client.c:1591
#16 wl_display_dispatch_queue_pending (display=0x55b410185860, queue=0x55b410185930) at ../src/wayland-client.c:1833
#17 0x000055b40f1459a0 in display_in (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../main.c:1080
#18 0x000055b40f14579f in loop_poll (loop=0x55b4101d1f30) at ../loop.c:95
#19 0x000055b40f143eb5 in main (argc=3, argv=0x7ffef714cfc8) at ../main.c:1235
Sounds like https://github.com/swaywm/swaylock/issues/181
Can you try running with ASan? This smells like memory corruption.
(See closed issue Github automatically linked above)
I have built with meson build/ -Db_sanitize=address,undefined
and will the use the resulting binary for some time in an attempt to get more information. In order to capture the output I am going to run swaylock like swaylock &| tee swaylock.log
. Let me know if I should change anything.
Already I see without a crash a couple of memory leaks like
Direct leak of 256 byte(s) in 1 object(s) allocated from:
#0 0x7f75f6ace279 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7f75f5883255 (/usr/lib/libfontconfig.so.1+0x21255)
I think this is benign and happens because for leak detection to work properly libraries would have to be compiled with asan as well. Mentioning it just in case.
So far I have not encountered a crash on master. If I do I will post again.
Sounds encouraging. Could you upload the binar(y|ies)? Happy to test.
I just compiled with the instructions in the readme with the extra options to meson build
. It is easy to compile and my binaries probably won't work on other systems anyway (not sure if they are static). So I think it it is better if you try building yourself.
Hi,
Same issue with swaylock-1.5-2 as shipped by Ubuntu 21.04. Recompiled from master branch: crash when secondary monitor wakes up seem to be solved!
swaylock
built on Debian 11:
meson build/ -Db_sanitize=address,undefined
Upon exit:
==196107==LeakSanitizer has encountered a fatal error.
==196107==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==196107==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
==196108==LeakSanitizer has encountered a fatal error.
==196108==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==196108==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
Update, with the same binary, when laptop left connected to an external monitor via USB-C, swaylock
gets "stuck" consuming 100% of the single core. It does not respond to any user input and shows no widgets on the screen. The only way out was to kill it from another TTY.
Another update, I can reproduce the same when running Sway v1.6. Installed from experimental
together with:
Package: libwayland-client0
Version: 1.19.0-2
Package: libwayland-cursor0
Version: 1.19.0-2
Package: libwlroots8
Version: 0.13.0-1
Package: libwayland-server0
Version: 1.19.0-2
In my current setup swaylock crashes for me when waking up my computer. I see the ring, start typing and even before hitting the second key I already see my desktop - and swaylock having crashed in the logs.
I know it's not swaylock vanilla, though the 3 patches applied to the source for the debian package don't seem invasive (http://deb.debian.org/debian/pool/main/s/swaylock/swaylock_1.5-2.debian.tar.xz) and since its single purpose is to lock the screen which it fails to do so in my case, I allow myself to also report it here.