Crash on cleanup when failing to bind to Xwayland
When building weston 14.0.0 in mock, the tests fail for xwayland. I haven't yet dug into what causes the following error:
[06:10:31.023] failed to bind to /tmp/.X11-unix/X0: No such file or directory
However, the end result is a SEGV caused by a NULL derefence in the following backtrace:
#0 0x00007ffff7cf9c60 in wl_event_source_remove () at /lib64/libwayland-server.so.0
#1 0x00007ffff67513b9 in weston_xserver_shutdown (wxs=wxs@entry=0x55555557c400) at ../xwayland/launcher.c:89
#2 0x00007ffff67513f5 in weston_xserver_destroy (l=0x55555557c460, data=<optimized out>) at ../xwayland/launcher.c:244
#3 0x00007ffff7cf9c1c in wl_signal_emit_mutable () at /lib64/libwayland-server.so.0
#4 0x00007ffff7f649c3 in weston_compositor_destroy (compositor=0x5555555713d0) at ../libweston/compositor.c:10105
#5 0x00007ffff7fb29e6 in wet_main (argc=<optimized out>, argv=<optimized out>, test_data=test_data@entry=0x7fffffffe2a0)
at ../frontend/main.c:4803
#6 0x0000555555557d31 in execute_compositor (data=0x55555556e998, setup=<synthetic pointer>)
at ../tests/weston-test-fixture-compositor.c:418
#7 weston_test_harness_execute_as_client (setup=<synthetic pointer>, harness=0x55555556e980) at ../tests/weston-test-runner.c:552
#8 fixture_setup (harness=0x55555556e980) at ../tests/xwayland-test.c:63
#9 fixture_setup_run_ (arg_=0x0, harness=0x55555556e980) at ../tests/xwayland-test.c:65
#10 main (argc=<optimized out>, argv=<optimized out>) at ../tests/weston-test-runner.c:700
(gdb) backtrace
#0 0x00007ffff7cf9c60 in wl_event_source_remove () at /lib64/libwayland-server.so.0
#1 0x00007ffff67513b9 in weston_xserver_shutdown (wxs=wxs@entry=0x55555557c400) at ../xwayland/launcher.c:89
#2 0x00007ffff67513f5 in weston_xserver_destroy (l=0x55555557c460, data=<optimized out>) at ../xwayland/launcher.c:244
#3 0x00007ffff7cf9c1c in wl_signal_emit_mutable () at /lib64/libwayland-server.so.0
#4 0x00007ffff7f649c3 in weston_compositor_destroy (compositor=0x5555555713d0) at ../libweston/compositor.c:10105
#5 0x00007ffff7fb29e6 in wet_main (argc=<optimized out>, argv=<optimized out>, test_data=test_data@entry=0x7fffffffe2a0)
at ../frontend/main.c:4803
#6 0x0000555555557d31 in execute_compositor (data=0x55555556e998, setup=<synthetic pointer>)
at ../tests/weston-test-fixture-compositor.c:418
#7 weston_test_harness_execute_as_client (setup=<synthetic pointer>, harness=0x55555556e980) at ../tests/weston-test-runner.c:552
#8 fixture_setup (harness=0x55555556e980) at ../tests/xwayland-test.c:63
#9 fixture_setup_run_ (arg_=0x0, harness=0x55555556e980) at ../tests/xwayland-test.c:65
#10 main (argc=<optimized out>, argv=<optimized out>) at ../tests/weston-test-runner.c:700
As far as I can tell weston_xserver_shutdown()
is calling wl_event_source_remove(wxs->abstract_source);
with wxs->abstract_source
NULL.
I haven't had a chance to dig & understand that part of the code yet (and might not have time for a little while), so here it is in case somebody more familiar wants to pick it up