summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-03-18 11:42:48 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-05-15 10:10:03 -0700
commitba05af82d3d8b7cbc6e22f93cbf1e3d1575afefe (patch)
tree16690f14548ba7eef54e6822d62e47c938ea3248 /src/corelib/io/qprocess_p.h
parentd2242c353fac9b76437b2c3bc521c0e6e415f3b1 (diff)
QProcess/Unix: protect against stack unwinding in the child process stub
There are two types of stack unwinding that can happen on Unix systems: C++ exceptions and PThread cancellations (on some systems, like Linux, PThread cancellations can be caught in catch(...) statements). We call a variety of PThread cancellation functions from inside the child stub, like close(). To avoid problems, we disable PThread cancellations completely before fork() or vfork(). The C++ exception case is simpler, because we can be sure of catching them with the catch (...) statement and simply transform them into an error message. This is also testable, which the PThread cancellation isn't. The error message isn't ideal because we're string-frozen. I'll improve it for 6.6. Pick-to: 6.5 Change-Id: Icfe44ecf285a480fafe4fffd174d97a475c93ff1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io/qprocess_p.h')
-rw-r--r--src/corelib/io/qprocess_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index c0273aeeae..dacf41b77a 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -303,7 +303,7 @@ public:
void startProcess();
#if defined(Q_OS_UNIX)
void commitChannels() const;
- void execChild(int workingDirectory, char **argv, char **envp) const;
+ void execChild(int workingDirectory, char **argv, char **envp) const noexcept;
#endif
bool processStarted(QString *errorMessage = nullptr);
void processFinished();