summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
authorSimeon Bird <bladud@gmail.com>2013-02-13 19:56:02 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-20 02:47:32 +0100
commit8efad82d6c8b0f59c5acb7f355ad2742f17b91df (patch)
treefb4bfa9eb91bb8949255e2749f894174e69227dc /src/widgets/widgets/qprogressbar.cpp
parentc3a5681225fa332dd2b2ac3c08b00c670e0a2d82 (diff)
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>
Diffstat (limited to 'src/widgets/widgets/qprogressbar.cpp')
0 files changed, 0 insertions, 0 deletions