Review Request: Workaround for the hang (freeze) when opening VLC's file dialog under KDE...

Thiago Macieira thiago at
Fri Feb 4 22:00:02 GMT 2011

On Friday, 4 de February de 2011 16:35:32 Dawit A wrote:
> Let us take out terminate from the equation. It is my mistake I
> included it here because its documentation states that "The process
> may not exit as a result of calling this function". However, I really
> do not understand why what you stated matters for the kill() and timed
> out scenarios...
> QProcess process;
> process.start(...);
> If the next command I issue is
> process.waitForFinished();
> I expect it to wait 30 secs since that is what the default value for
> the timeout parameter states. There is no way I would expect it to
> block for another 30 sec when the variable goes out of scope because
> of its own internal implementation issues. It is doing waitForFinished
> on a child process it created itself. Nothing to do with the API
> caller.

Ok, that sounds like unexpected behaviour. Has this been filed as a bug?

> The case of the kill is even more baffling to me because its
> documentation clearly says "Kills the current process, causing it to
> exit immediately". So If I kill is invoked as such
> process.kill();
> what should a reasonable expectation be ? To me the process gets
> killed immediately. Done, poof, gone. Instead that too blocks for the
> default amount of period if there are internally forked processes that
> are still running when the dtor is encountered yet again.

A killed process is still not reaped. Subprocesses need to be reaped by their 
parents to be cleaned up. There is more information that you can extract from 
a process after death, like CPU time consumed. So the implementation will have 
to clean up after the child process anyway.

Is the problem that you're encountering that kill() doesn't kill the 
grandchildren processes?

But I also don't see why a killed process would cause waitForFinished() to 
take more than some microseconds to complete. Do you have a testcase?

> Oh well, perhaps I am simply expecting QProcess to work the way it
> makes sense to me and am simply missing a larger point which I fail to
> recognize.

Thiago Macieira - thiago (AT) - thiago (AT)
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list