[Qt-interest] QProcess could close the reading pipe, thus killing the child process with SIGPIPE

Jan Kundrát jkt at gentoo.org
Mon May 4 03:38:28 CEST 2009


Thiago Macieira wrote:
> As I said before, there's nothing that stands out to the eye. But there's 
> a lot of things I wouldn't do, starting with the use of a thread. If you 
> remove the reason you added the thread in the first place (the 
> waitForBytesWritten and waitForReadyRead calls), you won't need a thread 
> and your problem should disappear.

Hi Thiago,
thanks a *lot* for your thorough review. Indeed, the use of thread dates
back to the time when the class was implemented in Python with no sign
of Qt. Since then, the whole logic has been rewritten at least three
times, but the thread persisted. By now, I've gotten rid of it and
reworked the code to use your suggestions (as well as various other
comments, thanks for them). Now everything seems to work nicely, I no
longer see mysterious child process deaths. If I ever meet you, I owe
you a beer.

The issue with previous version wasn't completely deterministic. I have,
however, created a procedure that usually led to the problem in less
than twenty iterations (that's about three minutes of clicking in the
GUI). I would hit that with the version of my code that I linked to in
the original e-mail when talking to Dovecot 1.1.7 (via QProcess) which
was set to serve data from a test mailbox. I can provide the set of
mailboxes as well as a detailed steps to reproduce, but I guess we can
move this off-list. I'll ping you tomorrow on IRC after I get some sleep
with that nice feeling that it WORKS NOW :)

Cheers,
-jkt

-- 
cd /local/pub && more beer > /dev/mouth

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090504/42af9286/attachment.bin 


More information about the Qt-interest-old mailing list