|
From: <sv...@va...> - 2008-10-11 18:29:56
|
Author: bart
Date: 2008-10-11 19:29:46 +0100 (Sat, 11 Oct 2008)
New Revision: 8658
Log:
Suppress race reports triggered by glibc's _IO_flockfile(FILE*) on stdout and stderr.
Modified:
trunk/drd/drd_pthread_intercepts.c
Modified: trunk/drd/drd_pthread_intercepts.c
===================================================================
--- trunk/drd/drd_pthread_intercepts.c 2008-10-11 18:28:34 UTC (rev 8657)
+++ trunk/drd/drd_pthread_intercepts.c 2008-10-11 18:29:46 UTC (rev 8658)
@@ -44,6 +44,7 @@
// versions (2.3 or before).
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#define _IO_MTSAFE_IO
#endif
#include <assert.h>
@@ -53,6 +54,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> // confstr()
+#if defined(HAVE_BITS_LIBC_LOCK_H)
+#include <bits/libc-lock.h>
+#endif
#include "config.h"
#include "drd_clientreq.h"
#include "pub_tool_redir.h"
@@ -98,11 +102,15 @@
{
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)
|