From 029d894d7fa9c511b68d9d85c266d2791d35dd19 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 12 Dec 2017 19:24:02 +0300 Subject: [PATCH] Fix gctest failure if compiled with TSan and parallel marker As of clang-4.0, Thread Sanitizer does not support creation of threads in the forked process (before exec). So, GC_start_mark_threads() is a no-op now if TSan is enabled. * misc.c [THREADS && PARALLEL_MARK && CAN_HANDLE_FORK] (GC_start_mark_threads): Do not call GC_start_mark_threads_inner() if THREAD_SANITIZER; add comment. --- misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc.c b/misc.c index e28fbff..0c40e9b 100644 --- a/misc.c +++ b/misc.c @@ -1343,7 +1343,9 @@ GC_API void GC_CALL GC_enable_incremental(void) #if defined(THREADS) GC_API void GC_CALL GC_start_mark_threads(void) { -# if defined(PARALLEL_MARK) && defined(CAN_HANDLE_FORK) +# if defined(PARALLEL_MARK) && defined(CAN_HANDLE_FORK) \ + && !defined(THREAD_SANITIZER) + /* TSan does not support threads creation in the child process. */ IF_CANCEL(int cancel_state;) DISABLE_CANCEL(cancel_state); -- 2.7.4