Re: Configure with thread sanitizer fails the thread test - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Configure with thread sanitizer fails the thread test
Date
Msg-id 202107231735.yhuvz7hfgkun@alvherre.pgsql
Whole thread Raw
In response to Configure with thread sanitizer fails the thread test  (Ewan Higgs <ewan_higgs@yahoo.co.uk>)
Responses Re: Configure with thread sanitizer fails the thread test  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 2021-Jul-23, Mikhail Matrosov wrote:

> I am not sure what is the proper fix for the issue, but I at least suggest
> to disable this test when building with thread sanitizer:
>
https://github.com/conan-io/conan-center-index/pull/6472/files#diff-b8639f81e30f36c8ba29a0878f1ef4d9f1552293bc9098ebb9b429ddb1f0935f

Here's the proposed patch.  Patches posted to the mailing list by their
authors proposed for inclusion are considered to be under the PostgreSQL
license, but this patch hasn't been posted by the author so let's assume
they're not authorizing them to use it.  (Otherwise, why wouldn't they
just post it here instead of doing the absurdly convoluted dance of a
github PR?)

diff --git a/src/test/thread/thread_test.c b/src/test/thread/thread_test.c
index e1bec01..e4ffd78 100644
--- a/src/test/thread/thread_test.c
+++ b/src/test/thread/thread_test.c
@@ -61,6 +61,14 @@ main(int argc, char *argv[])
     fprintf(stderr, "Perhaps rerun 'configure' using '--enable-thread-safety'.\n");
     return 1;
 }
+
+#elif __has_feature(thread_sanitizer)
+int
+main(int argc, char *argv[])
+{
+    printf("Thread safety check is skipped since it does not work with thread sanitizer.\n");
+    return 0;
+}
 #else
 
 /* This must be down here because this is the code that uses threads. */

-- 
Álvaro Herrera



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)
Next
From: Alvaro Herrera
Date:
Subject: Re: Configure with thread sanitizer fails the thread test