From 6f0aba42ade27c4196fed7c42d8375aefcef2a75 Mon Sep 17 00:00:00 2001 From: Panagiotis Apostolou Date: Tue, 28 Jun 2022 08:47:19 +0200 Subject: [PATCH] util: Don't block SIGSEGV for new threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SIGSEGV is used by Vulkan API trace layers to track user changes in device memory mapped to user space. Now with drivers such as Zink, GLES applications are translated into Vulkan API calls and therefore it is possible to be tracked by Vulkan api trace layers. Blocking SIGSEGV hinders one of the memory tracking mechanisms used by such layers. Reviewed-by: Marek Olšák Reviewed-by: Adam Jackson Reviewed-by: Emma Anholt Part-of: --- src/util/u_thread.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/u_thread.h b/src/util/u_thread.h index 6221720123d..2b9deaab169 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -109,6 +109,12 @@ static inline int u_thread_create(thrd_t *thrd, int (*routine)(void *), void *pa sigfillset(&new_set); sigdelset(&new_set, SIGSYS); + + /* SIGSEGV is commonly used by Vulkan API tracing layers in order to track + * accesses in device memory mapped to user space. Blocking the signal hinders + * that tracking mechanism. + */ + sigdelset(&new_set, SIGSEGV); pthread_sigmask(SIG_BLOCK, &new_set, &saved_set); ret = thrd_create(thrd, routine, param); pthread_sigmask(SIG_SETMASK, &saved_set, NULL);