From 50b5f8558eb1a6b1fb7bc9dc3fbba4f7fb109bc2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 2 Dec 2020 11:46:12 +0100 Subject: [PATCH] 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. --- xwayland/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwayland/server.c b/xwayland/server.c index d0057c66..e022f871 100644 --- a/xwayland/server.c +++ b/xwayland/server.c @@ -61,7 +61,7 @@ noreturn static void exec_xwayland(struct wlr_xwayland_server *server) { char *argv[] = { "Xwayland", NULL /* display, e.g. :1 */, - "-rootless", "-terminate", + "-rootless", "-terminate", "-core", "-listen", NULL /* x_fd[0] */, "-listen", NULL /* x_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]); 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->x_fd[1], server->wm_fd[1]);