From 2d8c7087fb9ab747e9cae4a246685a6563db1d78 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Wed, 3 Jun 2015 11:46:58 -0700 Subject: Fix race condition with QProcess on OSX 10.7 Closing the forkfd descriptor before disabling the deathNotifier causes a race condition in ~QProcess. This is the same underlying cause as QTBUG-22789. Change-Id: I1cbdedc567fdfa8d95d111827b7bf9994661ecc7 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_unix.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 69b631f7e7..0fc9464f52 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -1101,6 +1101,9 @@ bool QProcessPrivate::waitForDeadChild() exitCode = info.si_status; crashed = info.si_code != CLD_EXITED; + delete deathNotifier; + deathNotifier = 0; + qt_safe_close(forkfd); forkfd = -1; // Child is dead, don't try to kill it anymore -- cgit v1.2.3