From 51a77a42b4003d25fbf8193ae6122fd95fd1489a Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Thu, 8 Oct 2020 02:19:45 +0000 Subject: [PATCH] main: Create black surface after listening socket If agl-compositor is started without XDG_RUNTIME_DIR defined, an error arises and the system tries to exit cleanly. However, in this process a segfault is produced and the terminal is left misconfigured. The cause of this segfault is related to the destruction of the black surface, which is not handled properly in this corner case. In order to avoid this issue and as an initial fix, create the surface after the listening socket, which causes that the check for the var XDG_RUNTIME_DIR to be done before the surface creation. Bug-AGL: SPEC-3623 Signed-off-by: Walter Lozano Change-Id: I04760828f9ce5b5a6d4a31aeccdefe779a1c15a3 --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 590977f..2cefcd6 100644 --- a/src/main.c +++ b/src/main.c @@ -1489,11 +1489,11 @@ int main(int argc, char *argv[]) if (ivi.remoting_api) ivi_enable_remote_outputs(&ivi); - ivi_shell_init_black_fs(&ivi); - if (create_listening_socket(display, socket_name) < 0) goto error_compositor; + ivi_shell_init_black_fs(&ivi); + ivi.compositor->exit = handle_exit; weston_compositor_wake(ivi.compositor); -- 2.16.6