From 1d0302d03df9d5bde57fb326c5df3f6de43ddd6f Mon Sep 17 00:00:00 2001
From: David Klempner <klempner@google.com>
Date: Wed, 4 Feb 2015 16:08:01 -0800
Subject: [PATCH] Add a tsan suppression file with OPENSSL_cleanse and use it
 in run_tests

---
 tools/run_tests/run_tests.py | 5 +++--
 tools/tsan_suppressions.txt  | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100644 tools/tsan_suppressions.txt

diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 280c3f05cb9..cb54c0db82c 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -108,10 +108,11 @@ class PythonLanguage(object):
 _CONFIGS = {
     'dbg': SimpleConfig('dbg'),
     'opt': SimpleConfig('opt'),
-    'tsan': SimpleConfig('tsan'),
+    'tsan': SimpleConfig('tsan', environ={
+        'TSAN_OPTIONS': 'suppressions=tools/tsan_suppressions.txt'}),
     'msan': SimpleConfig('msan'),
     'asan': SimpleConfig('asan', environ={
-        'ASAN_OPTIONS': 'detect_leaks=1:color=always'}),
+        'ASAN_OPTIONS': 'detect_leaks=1:color=always:suppressions=tools/tsan_suppressions.txt'}),
     'gcov': SimpleConfig('gcov'),
     'memcheck': ValgrindConfig('valgrind', 'memcheck'),
     'helgrind': ValgrindConfig('dbg', 'helgrind')
diff --git a/tools/tsan_suppressions.txt b/tools/tsan_suppressions.txt
new file mode 100644
index 00000000000..23d57f9fd1f
--- /dev/null
+++ b/tools/tsan_suppressions.txt
@@ -0,0 +1,2 @@
+# OPENSSL_cleanse does racy access to a global
+race:OPENSSL_cleanse