fix: survive Xwayland SIGKILL without aborting (detach X surface listeners)
Killing the embedded Xwayland server aborted the compositor: surface_handle_resource_destroy assert (non-empty map listener list) via wl_client_destroy in the main loop's flush_clients. Mechanism: the dead server's Wayland client connection is purged before wlroots' xwm cascade dissociates anything, so wlr_surfaces die with our map/unmap/commit listeners still attached. Fix: watch the Xwayland Wayland client (its destroy signal fires before its resources are purged) and proactively detach surface listeners only -- across claimed windows, override-redirect windows and unclaimed pendings -- leaving xsurface-level listeners for the later tab teardown. Idempotent; later dissociate/xsurface-destroy find clean flags. The restart test now also waits for the X11 window's map before killing, so the crash path (listeners attached at death) is deterministically exercised instead of raced. Also re-mark output_mgmt_apply flaky (1 post-fix assertion under -n15; budgets help but the modeset roundtrip stays load-sensitive). Evidence: restart test 12/12 at the -n15 repro config (was ~2/9 crashing), detach handler firing on every server death, -n15 gate clean, serial gate clean (148), flaky set green (11).
This commit is contained in:
parent
dcd6552533
commit
0babe8832e
2 changed files with 92 additions and 7 deletions
|
|
@ -1805,6 +1805,7 @@ def test_standalone_headless_output_mgmt_test(tmp_path):
|
|||
s.close()
|
||||
|
||||
|
||||
@pytest.mark.flaky
|
||||
def test_standalone_headless_output_mgmt_apply(tmp_path):
|
||||
"""Applying 800x600 through output-management resizes the session:
|
||||
the client sees before/applied/after and a tab commits at 800x600."""
|
||||
|
|
@ -4247,7 +4248,6 @@ def test_x11_or_menu_move_repositions(tmp_path):
|
|||
s.close()
|
||||
|
||||
|
||||
@pytest.mark.flaky
|
||||
def test_xwayland_server_restart_survived(xwayland_session):
|
||||
"""Killing the embedded Xwayland server must not take the session down:
|
||||
wlroots restarts it lazily and the Wayland tab keeps working. (The
|
||||
|
|
@ -4256,6 +4256,10 @@ def test_xwayland_server_restart_survived(xwayland_session):
|
|||
s = xwayland_session
|
||||
s.wait_any_active()
|
||||
s.wait_for(r"\[xwayland\] ready display=:(\d+)")
|
||||
# Kill with the X11 window mapped+associated: the crash this guards
|
||||
# needs surface listeners attached at server death (an early kill
|
||||
# races teardown of nothing and proves nothing).
|
||||
s.wait_for(r"\[diag\] map app=0")
|
||||
disp = ":" + re.search(r"\[xwayland\] ready display=:(\d+)",
|
||||
s.read_log()).group(1)
|
||||
# wlr_xwayland double-forks, so the server is not our child: find it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue