summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2013-08-13 13:20:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-13 19:48:15 +0200
commitc8d9b17367cfdcb034d11f8a168ca4ae3993e7c3 (patch)
tree5480c360195d9f35913b02aa08e569d843e276e4 /tests/auto
parent8c3b31182cbf53aad8d1979f612eefb93a548940 (diff)
Fix crash in QProcess::waitForStarted() on Unix.
Invoking waitForStarted() on a QProcess before or after an unsuccessful call to start() (e.g., with an empty command), would execute FD_SET with an invalid file descriptor and cause the process to abort. The bug can be reliably reproduced on OSX. Task-number: QTBUG-32958 Change-Id: Id25b7781168489281645e21571361ca1a71d43e3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index f2759dfd6e..7a3f6837f8 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -154,6 +154,7 @@ private slots:
void invalidProgramString();
void onlyOneStartedSignal();
void finishProcessBeforeReadingDone();
+ void waitForStartedWithoutStart();
// keep these at the end, since they use lots of processes and sometimes
// caused obscure failures to occur in tests that followed them (esp. on the Mac)
@@ -2214,6 +2215,12 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
}
+void tst_QProcess::waitForStartedWithoutStart()
+{
+ QProcess process;
+ QVERIFY(!process.waitForStarted(5000));
+}
+
#endif //QT_NO_PROCESS
QTEST_MAIN(tst_QProcess)