QProcess/Unix: disable vfork() under ASan

Change-Id: I443cf0c8a76243eead33fffd1768ee771eca2d56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 94ec17436cbdab52ed85e15ea197b538541b14ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2023-06-15 15:16:42 -07:00 committed by Qt Cherry-pick Bot
parent 12b43d3902
commit 4f8b0c7e3e

View File

@ -511,6 +511,10 @@ static QString resolveExecutable(const QString &program)
static int useForkFlags(const QProcessPrivate::UnixExtras *unixExtras)
{
#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
// ASan writes to global memory, so we mustn't use vfork().
return FFD_USE_FORK;
#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