summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-18 22:45:16 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-22 14:55:01 -0700
commit9153ec8464336c280f2a6e79ffa443104bbeb98c (patch)
tree3cbbf84049f0f1a404c4d401aa746179a1cda292 /hw/xquartz
parent2740dc1937e8ab32b4930f4086c302e6602a7bad (diff)
XQuartz: Don't respond to SIGALRM on the AppKit thread
================== WARNING: ThreadSanitizer: data race (pid=69627) Write of size 8 at 0x00010dae73f8 by main thread (mutexes: write M262): #0 SmartScheduleTimer utils.c:1245 (X11.bin+0x0001004b21f9) #1 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, bool, int, my_siginfo_t*, void*) <null>:144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000279f6) #2 __CFRunLoopRun <null>:77 (CoreFoundation+0x000000087e17) #3 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) #4 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) #5 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) #6 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) #7 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) #8 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) #9 start <null>:29 (libdyld.dylib+0x000000005254) Previous read of size 8 at 0x00010dae73f8 by thread T7: [failed to restore the stack] Location is global 'SmartScheduleTime' at 0x00010dae73f8 (X11.bin+0x0001005b03f8) Mutex M262 (0x7d300000bd10) created at: #0 pthread_mutex_init <null>:144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) #1 __CFRunLoopCreate <null>:77 (CoreFoundation+0x000000054e63) #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) #8 start <null>:29 (libdyld.dylib+0x000000005254) Thread T7 (tid=4051693, running) created by main thread at: #0 pthread_create <null>:144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) #1 create_thread quartzStartup.c:78 (X11.bin+0x0001000398dd) #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039813) #3 X11ApplicationMain X11Application.m:1286 (X11.bin+0x00010001c804) #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) #5 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) #10 start <null>:29 (libdyld.dylib+0x000000005254) SUMMARY: ThreadSanitizer: data race utils.c:1245 in SmartScheduleTimer ================== ================== WARNING: ThreadSanitizer: signal handler spoils errno (pid=69627) #0 SmartScheduleTimer utils.c:1244 (X11.bin+0x0001004b21a0) #1 __CFRunLoopRun <null>:77 (CoreFoundation+0x000000087e17) #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) #8 start <null>:29 (libdyld.dylib+0x000000005254) SUMMARY: ThreadSanitizer: signal handler spoils errno utils.c:1244 in SmartScheduleTimer ================== Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/quartzStartup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 4dc4dd630..bb92b6d3c 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -95,6 +95,15 @@ QuartzInitServer(int argc, char **argv, char **envp)
if (!create_thread(server_thread, args)) {
FatalError("can't create secondary thread\n");
}
+
+ /* Block signals on the AppKit thread that the X11 expects to handle on its thread */
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set, SIGALRM);
+#ifdef BUSFAULT
+ sigaddset(&set, SIGBUS);
+#endif
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
}
int