sway icon indicating copy to clipboard operation
sway copied to clipboard

swaylock crashing Sway in wlr_xdg_toplevel_set_size

Open J0nnyMak0 opened this issue 4 months ago • 9 comments

With latest sources invoking swaylock crashes Sway. Stack trace attached.

gdb.txt

J0nnyMak0 avatar Feb 01 '24 18:02 J0nnyMak0

Relevant part of the log

#6  0x00007b9ae69932d4 in wlr_xdg_toplevel_set_size (toplevel=0x5b7d528d0640, width=-4, height=-29) at ../subprojects/wlroots/types/xdg_shell/wlr_xdg_toplevel.c:558
        __PRETTY_FUNCTION__ = "wlr_xdg_toplevel_set_size"
#7  0x00005b7d51271e5c in configure (view=0x5b7d526da1b0, lx=10882, ly=27, width=-4, height=-29) at ../sway/desktop/xdg_shell.c:164
        xdg_shell_view = 0x5b7d526da1b0
#8  0x00005b7d512b37cc in view_configure (view=0x5b7d526da1b0, lx=10882, ly=27, width=-4, height=-29) at ../sway/tree/view.c:185
#9  0x00005b7d51271250 in transaction_commit (transaction=0x5b7d52f3f080) at ../sway/desktop/transaction.c:803
        instruction = 0x5b7d53098f40
        node = 0x5b7d5253d560
        hidden = false
        i = 21
#10 0x00005b7d51271451 in transaction_commit_pending () at ../sway/desktop/transaction.c:855
        transaction = 0x5b7d52f3f080
#11 0x00005b7d512717ee in _transaction_commit_dirty (server_request=true) at ../sway/desktop/transaction.c:932
#12 0x00005b7d51271804 in transaction_commit_dirty () at ../sway/desktop/transaction.c:936
#13 0x00005b7d5126e8d7 in handle_new_output (listener=0x5b7d512e8bc0 <server+96>, data=0x5b7d52be77f0) at ../sway/desktop/output.c:519
        server = 0x5b7d512e8b60 <server>
        wlr_output = 0x5b7d52be77f0
        scene_output = 0x5b7d52d1c270
        output = 0x5b7d5302b500
        oc = 0x5b7d52781580

That negative size is odd. @vyivel didnt something about negative sizes got merged in wlroots recently?

bl4ckb0ne avatar Feb 01 '24 19:02 bl4ckb0ne

Yeah, wlroots now asserts that the size is non-negative. This is a Sway bug.

vyivel avatar Feb 01 '24 19:02 vyivel

A new output might be spawning initially with a 0x0 mode. When sway tries to arrange a surface it will subtract the title bar and also borders and generate negative numbers.

I don't think this is a regression of scene-graph

Nefsen402 avatar Feb 01 '24 23:02 Nefsen402

Sway will not try to arrange layer surfaces on a disabled output though.

emersion avatar Feb 01 '24 23:02 emersion

I'm attaching Sway asan log and dmesg log in case they have any useful info.

sway.log dmesg.log.tar.gz

J0nnyMak0 avatar Feb 02 '24 03:02 J0nnyMak0

Same issue here.

swaymsg -t get_outputs:

swaymsg -t get_outputs
Output eDP-1 'LG Display 0x06EB Unknown'
  Current mode: 2560x1600 @ 59.994 Hz
  Power: on
  Position: 0,500
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 3
  Max render time: off
  Adaptive sync: disabled
  Available modes:
    2560x1600 @ 59.994 Hz

Output HDMI-A-1 'Dell Inc. DELL U2718Q T4YR885E13ML' (focused)
  Current mode: 3840x2160 @ 60.000 Hz
  Power: on
  Position: 2560,0
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 4
  Max render time: off
  Adaptive sync: disabled
  Available modes: omitted

Version

Name            : sway-im-git
Version         : r7292.d19810eba895-2

Name            : wlroots-git
Version         : 0.18.0.r6893.842093bb8-1
Coredump syslog:

Feb 19 10:45:06 gram systemd[1]: Started Process Core Dump (PID 188627/UID 0).
Feb 19 10:45:06 gram systemd-coredump[188628]: [🡕] Process 132774 (sway) of user 1000 dumped core.
                                               
                                               Stack trace of thread 132774:
                                               #0  0x000072ee7a05e32c n/a (libc.so.6 + 0x8d32c)
                                               #1  0x000072ee7a00d6c8 raise (libc.so.6 + 0x3c6c8)
                                               #2  0x000072ee79ff54b8 abort (libc.so.6 + 0x244b8)
                                               #3  0x000072ee79ff53dc n/a (libc.so.6 + 0x243dc)
                                               #4  0x000072ee7a005d46 __assert_fail (libc.so.6 + 0x34d46)
                                               #5  0x000072ee7a2be225 wlr_xdg_toplevel_set_size (libwlroots.so.13 + 0x7e225)
                                               #6  0x0000556d4923c08d n/a (sway + 0x2608d)
                                               #7  0x0000556d4923dda8 n/a (sway + 0x27da8)
                                               #8  0x0000556d4923bc6a n/a (sway + 0x25c6a)
                                               #9  0x000072ee7a36a01e wl_signal_emit_mutable (libwayland-server.so.0 + 0xa01e)
                                               #10 0x000072ee7a36a01e wl_signal_emit_mutable (libwayland-server.so.0 + 0xa01e)
                                               #11 0x000072ee7a293425 n/a (libwlroots.so.13 + 0x53425)
                                               #12 0x000072ee7a36a01e wl_signal_emit_mutable (libwayland-server.so.0 + 0xa01e)
                                               #13 0x000072ee7a28cd29 n/a (libwlroots.so.13 + 0x4cd29)
                                               #14 0x000072ee7a36bae2 wl_event_loop_dispatch (libwayland-server.so.0 + 0xbae2)
                                               #15 0x000072ee7a36c2d7 wl_display_run (libwayland-server.so.0 + 0xc2d7)
                                               #16 0x0000556d4922b695 n/a (sway + 0x15695)
                                               #17 0x000072ee79ff6cd0 n/a (libc.so.6 + 0x25cd0)
                                               #18 0x000072ee79ff6d8a __libc_start_main (libc.so.6 + 0x25d8a)
                                               #19 0x0000556d4922b895 n/a (sway + 0x15895)
                                               
                                               Stack trace of thread 132783:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132784:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132787:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132785:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132786:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132789:
                                               #0  0x000072ee7a0d788d syscall (libc.so.6 + 0x10688d)
                                               #1  0x000072ee7a577337 g_cond_wait (libglib-2.0.so.0 + 0xb3337)
                                               #2  0x000072ee7a4e91b4 n/a (libglib-2.0.so.0 + 0x251b4)
                                               #3  0x000072ee7a4e921c g_async_queue_pop (libglib-2.0.so.0 + 0x2521c)
                                               #4  0x000072ee797e5d08 n/a (libpangoft2-1.0.so.0 + 0x8d08)
                                               #5  0x000072ee7a54fa45 n/a (libglib-2.0.so.0 + 0x8ba45)
                                               #6  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #7  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               
                                               Stack trace of thread 132788:
                                               #0  0x000072ee7a058ebe n/a (libc.so.6 + 0x87ebe)
                                               #1  0x000072ee7a05b750 pthread_cond_wait (libc.so.6 + 0x8a750)
                                               #2  0x000072ee76e8686c n/a (iris_dri.so + 0x8686c)
                                               #3  0x000072ee76e9e83c n/a (iris_dri.so + 0x9e83c)
                                               #4  0x000072ee7a05c55a n/a (libc.so.6 + 0x8b55a)
                                               #5  0x000072ee7a0d9a3c n/a (libc.so.6 + 0x108a3c)
                                               ELF object binary architecture: AMD x86-64
Feb 19 10:45:06 gram systemd[1]: [email protected]: Deactivated successfully.
Feb 19 10:45:06 gram seatd[775]: 08:25:53.527 [INFO] [seatd/client.c:471] Client disconnected
Feb 19 10:45:06 gram greetd[131392]: pam_unix(greetd:session): session closed for user cherrot

dumped core: core.zip

cherrot avatar Feb 20 '24 05:02 cherrot

Same issue, are there any solutions before 1.10 to bypass this problem ? Thanks

dingiso avatar Feb 25 '24 07:02 dingiso

I hit this same crash.

#0  0x000070933444532c in ?? () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7093336399c0 (LWP 952))]
(gdb) bt full
#0  0x000070933444532c in ??? () at /usr/lib/libc.so.6
#1  0x00007093343f46c8 in raise () at /usr/lib/libc.so.6
#2  0x00007093343dc4b8 in abort () at /usr/lib/libc.so.6
#3  0x00007093343dc3dc in ??? () at /usr/lib/libc.so.6
#4  0x00007093343ecd46 in __assert_fail () at /usr/lib/libc.so.6
#5  0x0000709334d28e9d in wlr_xdg_toplevel_set_size (toplevel=0x5f05d8173710, width=0, height=-22) at ../subprojects/wlroots/types/xdg_shell/wlr_xdg_toplevel.c:558
        __PRETTY_FUNCTION__ = "wlr_xdg_toplevel_set_size"
#6  0x00005f05d567e663 in configure (view=0x5f05d8442670, lx=0, ly=22, width=0, height=-22) at ../sway/desktop/xdg_shell.c:164
        xdg_shell_view = 0x5f05d8442670
#7  0x00005f05d56c0929 in view_configure (view=0x5f05d8442670, lx=0, ly=22, width=0, height=-22) at ../sway/tree/view.c:185
#8  0x00005f05d567da57 in transaction_commit (transaction=0x5f05d909be40) at ../sway/desktop/transaction.c:812
        instruction = 0x5f05d9161fc0
        node = 0x5f05d816aaa0
        hidden = false
        i = 38
#9  0x00005f05d567dc58 in transaction_commit_pending () at ../sway/desktop/transaction.c:864
        transaction = 0x5f05d909be40
#10 0x00005f05d567dff5 in _transaction_commit_dirty (server_request=true) at ../sway/desktop/transaction.c:941
#11 0x00005f05d567e00b in transaction_commit_dirty () at ../sway/desktop/transaction.c:945
#12 0x00005f05d567af4d in handle_new_output (listener=0x5f05d56f5c38 <server+216>, data=0x5f05d83f76a0) at ../sway/desktop/output.c:512
        server = 0x5f05d56f5b60 <server>
        wlr_output = 0x5f05d83f76a0
        scene_output = 0x5f05d8e3cf60
        output = 0x5f05d91a4b00
        oc = 0x5f05d8562780
#13 0x000070933463001e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#14 0x0000709334cfcbb0 in new_output_reemit (listener=0x5f05d76657c8, data=0x5f05d83f76a0) at ../subprojects/wlroots/backend/multi/backend.c:146
        state = 0x5f05d76657a0
#15 0x000070933463001e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#16 0x0000709334cede45 in scan_drm_connectors (drm=0x5f05d766f060, event=0x7fff9feaad2c) at ../subprojects/wlroots/backend/drm/drm.c:1609
        conn = 0x5f05d83f76a0
        i = 0
        res = 0x5f05d89419a0
        seen_len = 4
        seen = {true, true, true, true, false}
        new_outputs_len = 1
        new_outputs = {0x5f05d83f76a0, 0x7fff9feaab60, 0x7fff9feaac20, 0x7fff9feaac60, 0x7fff9feaad28}
        conn = 0x5f05d766eed8
        tmp_conn = 0x5f05d83e6360
        index = 0
#17 0x0000709334ce8bdb in handle_dev_change (listener=0x5f05d766f118, data=0x7fff9feaad28) at ../subprojects/wlroots/backend/drm/backend.c:148
        drm = 0x5f05d766f060
        change = 0x7fff9feaad28
#18 0x000070933463001e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#19 0x0000709334ce6270 in handle_udev_event (fd=8, mask=1, data=0x5f05d76586a0) at ../subprojects/wlroots/backend/session/session.c:213
        event = {type = WLR_DEVICE_HOTPLUG, {hotplug = {connector_id = 113, prop_id = 0}}}
        devnum = 57857
        dev = 0x5f05d764d4f0
        session = 0x5f05d76586a0
        udev_dev = 0x5f05d82790c0
        sysname = 0x5f05d83adcb0 "card1"
        devnode = 0x5f05d8035000 "/dev/dri/card1"
        action = 0x709334aaffb5 "change"
        seat = 0x709334da14ff "seat0"
        __PRETTY_FUNCTION__ = "handle_udev_event"
#20 0x0000709334631ae2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#21 0x00007093346322d7 in wl_display_run () at /usr/lib/libwayland-server.so.0
#22 0x00005f05d5676bf9 in server_run (server=0x5f05d56f5b60 <server>) at ../sway/server.c:452
#23 0x00005f05d567552e in main (argc=2, argv=0x7fff9feab0f8) at ../sway/main.c:374
        verbose = false
        debug = false
        validate = false
        config_path = 0x0
        c = -1

This happened when I came back to my computer after it has been locked (swaylock and screens powered off) and I turned on the chrome cast that's connected to the HDMI port on one of my monitors. Looks like my computer connected through DP noticed and crashed sway.

Inspecting the program state, wlroots seems to think the monitor is has a width and height of 0. Is this a wlroots problem and we just shouldn't advertise a monitor that is 0x0 or should we add some if statements to sway and call it a day?

Nefsen402 avatar May 03 '24 04:05 Nefsen402

Weird, 0x0 would typically indicate that the output is disabled. It seems wrong to expose disabled outputs.

emersion avatar May 08 '24 06:05 emersion