From a0a29695ab018118f194b3d332ae9b0065c7b1a1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 2 Nov 2023 07:45:57 -0700 Subject: [PATCH] QProcess/Unix: also ban vfork() under TSan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complements 94ec17436cbdab52ed85e15ea197b538541b14ca for the ASan logic (52ed6af5277100ed5b9a4f4231b94013ce539a2c for the code change). Fixes: QTBUG-117533 Pick-to: 6.6 Change-Id: I09c3950e719e4b259bc7fffd1793d59dbdbfe82a Reviewed-by: Oswald Buddenhagen Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Jonas Karlsson Reviewed-by: Volker Hilsheimer --- src/corelib/io/qprocess_unix.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index a949a492cd8..361b28dcff1 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -622,6 +622,10 @@ inline bool globalUsingVfork() noexcept // ASan writes to global memory, so we mustn't use vfork(). return false; #endif +#if defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer) + // Ditto, apparently + return false; +#endif #if defined(Q_OS_LINUX) && !QT_CONFIG(forkfd_pidfd) // some broken environments are known to have problems with the new Linux // API, so we have a way for users to opt-out during configure time (see