Open RAOF opened 1 month ago
Amusingly, even
execvp
is not async-signal-safe
That probably doesn't matter: we should use execve()
directly (we default xwayland-path
to "/usr/bin/Xwayland", which doesn't need PATH handling)
Oops! When reviewing https://github.com/canonical/mir/pull/3497 I also see that miral::launch_app_env
suffers from the same problems.
exec_wayland()
is called afterfork()
: https://github.com/canonical/mir/blob/953de04e07444a8f4410dd2f044ad9d24fbec2ef/src/server/frontend_xwayland/xwayland_server.cpp#L53-L98Unfortunately,
man 2 fork
says:We should instead do as much setup as possible in the parent, and then call
fork()
. (Amusingly, evenexecvp
is not async-signal-safe :woman_facepalming: )