diff options
author | Christian Strømme <christian.stromme@digia.com> | 2013-08-13 11:20:05 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-28 23:51:11 (GMT) |
commit | 764f1a51209212b6fc60cef5c12e9748d06b57de (patch) | |
tree | d3f6f6dbf582786bc2bdd25c7387dac7b237df2d /tests/auto | |
parent | 9b62d3ef0bb3109f4d2d29a0b8fc6cf792729618 (diff) | |
download | Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.zip Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.tar.gz Qt-764f1a51209212b6fc60cef5c12e9748d06b57de.tar.bz2 |
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.
(cherry-picked from qtbase commit c8d9b17367cfdcb034d11f8a168ca4ae3993e7c3)
Task-number: QTBUG-32958
Change-Id: Id25b7781168489281645e21571361ca1a71d43e3
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qprocess/tst_qprocess.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index 95eee54..4bb4dcd 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -158,6 +158,7 @@ private slots: void invalidProgramString_data(); void invalidProgramString(); void onlyOneStartedSignal(); + 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) @@ -2619,6 +2620,12 @@ void tst_QProcess::onlyOneStartedSignal() QCOMPARE(spyFinished.count(), 1); } +void tst_QProcess::waitForStartedWithoutStart() +{ + QProcess process; + QVERIFY(!process.waitForStarted(5000)); +} + QTEST_MAIN(tst_QProcess) #include "tst_qprocess.moc" #endif |