Commits on Source (6)
-
Wayland signals (wl_signal) do not reliably handle changes to the notification list during signal emission. Such scenarios occasionally come up and can be difficult to investigate and debug. This commit introduces the weston_signal_emit_mutable() function which can be used in place of wl_signal_emit() and safely implements the following behavior regarding notification list changes: 1. Listeners deleted during a signal emission and which have not already been notified at the time of deletion are not notified by that emission. 2. Listeners added during signal emission are ignored by that emission. The implementation of weston_signal_emit_mutable() is copied from the wlr_signal_emit_safe() function of the wlroots project. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
8b6daa41 -
Basic test to verify that weston_signal_emit_mutable() would not corrupt the signal list. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
99017305 -
This avoids crashes due to removal of notification listeners from within invocations of other listener callbacks in the same signal emission. Fixes: #415 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
fa48c5ee -
This uses the more safer version of signal emission to avoid a potential crash when the output is destroyed that will follow a surface/view destruction for which it has a listener attached (to the output_destroy signal). Fixes: #734 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2015dfc3 -
This simulates an output removal which should trigger a crash when the compositor is shutdown abruptly by having a view with a listener installed on its output_destroy signal. This patch assumes that weston_compositor_remove_output() has already been amended to use the more safer version for triggering signal emission. As both shells use this construct it should catch any potential signal corruption. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
ee571679 -
Replaces potential corruption signal emit call sites with the more safer weston_signal_emit_mutable(). Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
f2452d60
shared/signal.c
0 → 100644
shared/signal.h
0 → 100644
tests/safe-signal-output-removal-test.c
0 → 100644
tests/safe-signal-test.c
0 → 100644