[Qt-interest] Problems running QProcess under linux
Thiago Macieira
thiago at kde.org
Mon Sep 26 20:04:13 CEST 2011
On Monday, 26 de September de 2011 13:37:19 Bill Crocker wrote:
> Scott Aron Bloom wrote:
> > Thanks.. the problem here is the crash takes 3-4 hours of running to
> > crash.. and has yet to be reproduced when run with the same command
> > line arguments from the CLI only... hence my thoughts that it might be
> > a QProcess settings issue...
>
> Create a small program which dumps all resource
> limits using getrlimit. Run this from a QProcess
> and see if the limits differ from a command line run.
>
> You can also dump its list of env vars and see if there
> are any differences there.
Usually, the only difference between running from the command line and using
QProcess is stdin, stdout and stderr. From the command-line, they are
connected to a terminal; from QProcess, they are connected to a pipe.
By default, libc uses line-buffering with stdout when connected to a terminal,
but full buffering when it's a file or pipe,
Also, reading from a terminal respects terminal settings (canonical mode, for
example), whereas reading from a file or pipe is just that: reading.
It might be that the child process attempts to read a chunk of data expecting
to get at most one line, but it eventually gets more than that and then falls
out of sync.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110926/7c9bd6b5/attachment.bin
More information about the Qt-interest-old
mailing list