xwayland: add -core to flags

Xwayland has its own special handling for signals like SIGSEGV/SIGABRT.
Instead of leaving the job to the OS, it tries to walk up the call stack
(badly, because a lot of information is missing), print the stack trace
to stdout, then exit(1). This is very annoying because it prevents
Xwayland crashes from being easily debugged.

Xwayland has a flag "-core" that aborts instead of exiting. This allows
the OS to generate a coredump. It's far from perfect but better than
nothing, I guess.
This commit is contained in:
Simon Ser 2020-12-02 11:46:12 +01:00
parent 8bc5a92a98
commit 50b5f8558e
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -61,7 +61,7 @@ noreturn static void exec_xwayland(struct wlr_xwayland_server *server) {
char *argv[] = { char *argv[] = {
"Xwayland", NULL /* display, e.g. :1 */, "Xwayland", NULL /* display, e.g. :1 */,
"-rootless", "-terminate", "-rootless", "-terminate", "-core",
"-listen", NULL /* x_fd[0] */, "-listen", NULL /* x_fd[0] */,
"-listen", NULL /* x_fd[1] */, "-listen", NULL /* x_fd[1] */,
"-wm", NULL /* wm_fd[1] */, "-wm", NULL /* wm_fd[1] */,
@ -89,7 +89,7 @@ noreturn static void exec_xwayland(struct wlr_xwayland_server *server) {
snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", server->wl_fd[1]); snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", server->wl_fd[1]);
setenv("WAYLAND_SOCKET", wayland_socket_str, true); setenv("WAYLAND_SOCKET", wayland_socket_str, true);
wlr_log(WLR_INFO, "WAYLAND_SOCKET=%d Xwayland :%d -rootless -terminate -listen %d -listen %d -wm %d", wlr_log(WLR_INFO, "WAYLAND_SOCKET=%d Xwayland :%d -rootless -terminate -core -listen %d -listen %d -wm %d",
server->wl_fd[1], server->display, server->x_fd[0], server->wl_fd[1], server->display, server->x_fd[0],
server->x_fd[1], server->wm_fd[1]); server->x_fd[1], server->wm_fd[1]);