From 2ed99ff5ca338ac02f71c347b1449d4662e6c221 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 14 Sep 2020 18:00:47 +0200 Subject: Make usage of forkfd_pidfd in QProcess a configurable feature Our CI cross-compiling arm qemu builds have issues in tests that use QProcess, due to user-space qemu seemingly not supporting pidfds properly. Add a 'forkfd_pidfd' configure.json feature, which can be manually disabled when configuring Qt, causing QProcess to do a regular fork instead of using the new pidfd kernel feature. This will help us avoid the regression of multiple tests failing on the new Ubuntu 20.04 CI host images when they are run via qemu. Task-number: QTBUG-86285 Task-number: QTBUG-86187 Task-number: QTBUG-86198 Change-Id: Ib2209d7e95126e0fb738bf59e39070d5a62c482f Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index f14e78f94e..5fce848c2c 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -461,6 +461,12 @@ void QProcessPrivate::startProcess() int ffdflags = FFD_CLOEXEC; if (childProcessModifier) ffdflags |= FFD_USE_FORK; + + // QTBUG-86285 +#if !QT_CONFIG(forkfd_pidfd) + ffdflags |= FFD_USE_FORK; +#endif + pid_t childPid; forkfd = ::forkfd(ffdflags , &childPid); int lastForkErrno = errno; -- cgit v1.2.3