* lib/get-rusage-as.c (get_rusage_as): When compiled by
"gcc -fsanitize=thread", don't try get_rusage_as_via_setrlimit.
* tests/test-pthread_sigmask2.c (main): Clean up the killer_thread
before exiting.
+2019-03-09 Bruno Haible <bruno@clisp.org>
+
+ get-rusage-as, pthread_sigmask tests: Fix -fsanitize=thread findings.
+ * lib/get-rusage-as.c (get_rusage_as): When compiled by
+ "gcc -fsanitize=thread", don't try get_rusage_as_via_setrlimit.
+ * tests/test-pthread_sigmask2.c (main): Clean up the killer_thread
+ before exiting.
+
2019-03-09 Jim Meyering <meyering@fb.com>
test-userspec.c: don't print NULL
uintptr_t
get_rusage_as (void)
{
-#if (defined __APPLE__ && defined __MACH__) || defined _AIX || defined __CYGWIN__ || defined __MVS__ /* Mac OS X, AIX, Cygwin, z/OS */
+#if (defined __APPLE__ && defined __MACH__) || defined _AIX || defined __CYGWIN__ || defined __MVS__ || defined __SANITIZE_THREAD__ /* Mac OS X, AIX, Cygwin, z/OS, gcc -fsanitize=thread */
/* get_rusage_as_via_setrlimit() does not work.
Prefer get_rusage_as_via_iterator(). */
return get_rusage_as_via_iterator ();
before the call to pthread_sigmask() returns." */
ASSERT (sigint_occurred == 1);
+ /* Clean up the thread. This avoid a "ThreadSanitizer: thread leak" warning
+ from "gcc -fsanitize=thread". */
+ gl_thread_join (killer_thread, NULL);
+
return 0;
}