]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Avoid reporting false positive race reports inside pthread_join().
authorBart Van Assche <bvanassche@acm.org>
Wed, 24 Aug 2011 15:02:21 +0000 (15:02 +0000)
committerBart Van Assche <bvanassche@acm.org>
Wed, 24 Aug 2011 15:02:21 +0000 (15:02 +0000)
Note: I haven't analyzed yet since which commit these false positives
started to appear but it's most likely a commit applied after the 3.6
release.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12003

drd/drd_pthread_intercepts.c

index 856092fa6ee94f2a0ccabf5a715b966a97b85480..5b13bb30b673968ac96d174db8e7e510162100d0 100644 (file)
@@ -483,12 +483,18 @@ int pthread_join_intercept(pthread_t pt_joinee, void **thread_return)
    OrigFn   fn;
 
    VALGRIND_GET_ORIG_FN(fn);
+   /*
+    * Avoid that the sys_futex(td->tid) call invoked by the NPTL pthread_join()
+    * implementation triggers a (false positive) race report.
+    */
+   ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
    CALL_FN_W_WW(ret, fn, pt_joinee, thread_return);
    if (ret == 0)
    {
       VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_THREAD_JOIN,
                                       pt_joinee, 0, 0, 0, 0);
    }
+   ANNOTATE_IGNORE_READS_AND_WRITES_END();
    return ret;
 }