Mesa (main): util: Don't block SIGSEGV for new threads

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 13 07:17:55 UTC 2022


Module: Mesa
Branch: main
Commit: 6f0aba42ade27c4196fed7c42d8375aefcef2a75
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f0aba42ade27c4196fed7c42d8375aefcef2a75

Author: Panagiotis Apostolou <panosa at lunarg.com>
Date:   Tue Jun 28 08:47:19 2022 +0200

util: Don't block SIGSEGV for new threads

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 <marek.olsak at amd.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17273>

---

 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);



More information about the mesa-commit mailing list