From: Bart Van Assche Date: Sat, 11 Oct 2008 18:29:46 +0000 (+0000) Subject: Suppress race reports triggered by glibc's _IO_flockfile(FILE*) on stdout and stderr. X-Git-Tag: svn/VALGRIND_3_4_0~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f09070a08c296cd3c61fd153ecb149159a70c7ed;p=thirdparty%2Fvalgrind.git Suppress race reports triggered by glibc's _IO_flockfile(FILE*) on stdout and stderr. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8658 --- diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index e7223792e1..ce4c52e8b6 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -44,6 +44,7 @@ // versions (2.3 or before). #ifndef _GNU_SOURCE #define _GNU_SOURCE +#define _IO_MTSAFE_IO #endif #include @@ -53,6 +54,9 @@ #include #include #include // confstr() +#if defined(HAVE_BITS_LIBC_LOCK_H) +#include +#endif #include "config.h" #include "drd_clientreq.h" #include "pub_tool_redir.h" @@ -98,11 +102,15 @@ static void init(void) { check_threading_library(); vg_set_main_thread_state(); - /* glibc up to and including version 2.7 triggers conflicting accesses */ + /* glibc up to and including version 2.8 triggers conflicting accesses */ /* on stdout and stderr when sending output to one of these streams from */ /* more than one thread. Suppress data race reports on these objects. */ DRD_IGNORE_VAR(*stdout); DRD_IGNORE_VAR(*stderr); +#if defined(HAVE_BITS_LIBC_LOCK_H) + DRD_IGNORE_VAR(*(__libc_lock_recursive_t*)(stdout->_lock)); + DRD_IGNORE_VAR(*(__libc_lock_recursive_t*)(stderr->_lock)); +#endif } static MutexT pthread_to_drd_mutex_type(const int kind)