Hanging processes after closing multiple windows #542

Closed
opened 5 months ago by kmarius · 1 comments
kmarius commented 5 months ago

Sometimes when closing multiple windows at once, hanging processes can remain using 100% cpu each. I can reproduce this on swaywm with

foot -a foot_test &
foot -a foot_test &
foot -a foot_test &
sleep 1
swaymsg [app_id=foot_test] kill

This will sometimes leave a process that can only be stopped with kill -9. One can add more foots for more hanging processes. Also note that it does not seem to happen if the windows are non-tiling, i.e. floating/stacking/tabbed.

Environment:
Arch Linux Kernel 5.12.5-arch1-1
swaywm 1.6
foot 1.7.2/master

Sometimes when closing multiple windows at once, hanging processes can remain using 100% cpu each. I can reproduce this on `swaywm` with foot -a foot_test & foot -a foot_test & foot -a foot_test & sleep 1 swaymsg [app_id=foot_test] kill This will sometimes leave a process that can only be stopped with `kill -9`. One can add more `foot`s for more hanging processes. Also note that it does not seem to happen if the windows are non-tiling, i.e. floating/stacking/tabbed. Environment: Arch Linux Kernel 5.12.5-arch1-1 swaywm 1.6 foot 1.7.2/master
Owner

I can reproduce.

(gdb) bt
#0  0x00007fa046cb44c3 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#1  0x00007fa04788fc54 in wl_display_dispatch_queue_pending () from /usr/lib/libwayland-client.so.0
#2  0x000055d74dfe0ca3 in wayl_roundtrip (wayl=0x611000002980) at ../../wayland.c:1599
#3  0x000055d74dfde7ef in wayl_win_destroy (win=0x612000002d40) at ../../wayland.c:1464
#4  0x000055d74e02d2db in fdm_shutdown (fdm=0x612000001840, fd=6, events=1, data=0x622000006100) at ../../terminal.c:1229
#5  0x000055d74df1056e in fdm_poll (fdm=0x612000001840) at ../../fdm.c:463
#6  0x000055d74df3d9e8 in main (argc=0, argv=0x7fff2f3ed230) at ../../main.c:535

We're probably stuck here:

    while (wl_display_prepare_read(wayl->display) != 0)
        wl_display_dispatch_pending(wayl->display);
I can reproduce. ```gdb (gdb) bt #0 0x00007fa046cb44c3 in pthread_mutex_lock () from /usr/lib/libpthread.so.0 #1 0x00007fa04788fc54 in wl_display_dispatch_queue_pending () from /usr/lib/libwayland-client.so.0 #2 0x000055d74dfe0ca3 in wayl_roundtrip (wayl=0x611000002980) at ../../wayland.c:1599 #3 0x000055d74dfde7ef in wayl_win_destroy (win=0x612000002d40) at ../../wayland.c:1464 #4 0x000055d74e02d2db in fdm_shutdown (fdm=0x612000001840, fd=6, events=1, data=0x622000006100) at ../../terminal.c:1229 #5 0x000055d74df1056e in fdm_poll (fdm=0x612000001840) at ../../fdm.c:463 #6 0x000055d74df3d9e8 in main (argc=0, argv=0x7fff2f3ed230) at ../../main.c:535 ``` We're probably stuck [here](https://codeberg.org/dnkl/foot/src/commit/05160e61c507226b85ebaa5156fdb8dc6e3c5a8c/wayland.c#L1598-L1599): ```c while (wl_display_prepare_read(wayl->display) != 0) wl_display_dispatch_pending(wayl->display); ```
dnkl added the
bug
label 5 months ago
dnkl closed this issue 5 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.