fix infinite loop in QProcessPrivate::drainOutputPipes
When drainOutputPipes is called, the process is already dead. If readyReadEmitted is false, there was no data in the pipes. As the process is dead, there won't be data in the pipes in future iterations. The situation that triggered the infinite loop was this: process A starts console process B. B starts console process C. C inherits stdout/err of B. B dies. C runs forever and does not close the stdout/err handles. A notices that B died and calls drainOutputPipes. Task-number: QTBUG-29391 Change-Id: I4819901df307be684c6ad70753a5f964a834704a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
ee73f7b7db
commit
568f82fba3
@ -641,7 +641,7 @@ bool QProcessPrivate::drainOutputPipes()
|
||||
readyReadEmitted |= stderrReader->waitForReadyRead(0);
|
||||
readOperationActive |= stderrReader->isReadOperationActive();
|
||||
}
|
||||
if (!readOperationActive)
|
||||
if (!readOperationActive || !readyReadEmitted)
|
||||
break;
|
||||
Sleep(100);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user