Go to file
Simeon Bird 8efad82d6c Fix QTBUG-18934 by checking return value of qt_safe_pipe
When QProcess->start() is called, Qt creates a pipe to the process to
get its exit value and output.
It does this with qt_create_pipe, which calls qt_safe_pipe.
qt_safe_pipe, on failure, returns 1. qt_create_pipe then
sets errno and returns void.
The calling function, QProcessPrivate::startProcess, does not check
errno, and thus continues to fork the process, assuming the pipe has been
created successfully.

The child process then has no way to pass its exit value to the calling
process, since the communication pipes it would normally use do not
exist, and thus when it exits it becomes a zombie.

As a bonus, if waitForFinished is called on a broken process, a crash
results because it is trying to wait on a pipe which does not exist.

The fix makes qt_create_pipe return an integer, and QProcess::startProcess
check the return value, set processError and not create the child
process.

Task-Number: QTBUG-18934
Change-Id: I2e1effdd0617be5b8c5492bcbcf5f2b1584b2241
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-20 02:47:32 +01:00
bin Merge remote-tracking branch 'origin/stable' into dev 2013-02-14 14:24:57 +01:00
config.tests Clean up how we build against SDKs on Mac OS 2013-02-19 07:56:34 +01:00
dist Merge remote-tracking branch 'origin/stable' into dev 2013-02-18 16:14:52 +01:00
doc Merge remote-tracking branch 'origin/stable' into dev 2013-02-18 16:14:52 +01:00
examples Merge remote-tracking branch 'origin/stable' into dev 2013-02-14 14:24:57 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Always build against an SDK on Mac OS 2013-02-20 00:46:50 +01:00
qmake Unify win32-g++ and Unix qmake Makefiles. 2013-02-19 10:35:06 +01:00
src Fix QTBUG-18934 by checking return value of qt_safe_pipe 2013-02-20 02:47:32 +01:00
tests Don't run qmake test that requires macx makespec on non Mac OS platforms 2013-02-20 00:46:50 +01:00
tools Unify win32-g++ and Unix qmake Makefiles. 2013-02-19 10:35:06 +01:00
util Merge remote-tracking branch 'origin/stable' into dev 2013-02-14 14:24:57 +01:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Add qmake generated files to .gitignore. 2012-12-19 21:31:58 +01:00
.qmake.conf don't auto-install example sources by default for all modules 2012-12-03 15:56:28 +01:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
configure Unify win32-g++ and Unix qmake Makefiles. 2013-02-19 10:35:06 +01:00
configure.bat Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.BSD Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.FDL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL-ONLY Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
INSTALL fix links in INSTALL 2012-10-10 08:45:22 +02:00
LGPL_EXCEPTION.txt Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL Add the LICENSE.GPL file to the module referenced from license headers 2012-05-20 22:41:08 +02:00
LICENSE.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
LICENSE.PREVIEW.COMMERCIAL Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qtbase.pro create tool pri file for syncqt 2013-02-11 18:00:12 +01:00
sync.profile syncqt: Don't check for QT_{BEGIN,END}_HEADER macros 2013-01-26 18:18:46 +01:00