[Qt-interest] spurious output messages in QProcess - SunOS
Thiago Macieira
thiago at kde.org
Fri Dec 11 08:37:28 CET 2009
Em Sexta-feira 11. Dezembro 2009, às 08.16.57, Sarvesh Saran escreveu:
> Hi,
>
> I have an application that uses QProcess to start a binary and reads its
> standard output stream into a QString and displays this string onto a
> QTextEdit.
>
> The problem is that I see spurious output messages when I run my
> application in SunOS 5.10 (sun4v sparc SUNW,Sun-Fire-T200).
>
> My Qt version is qt4.3.3 commercial.
>
> The spurious output message strings I see is something like:
>
> change count = 1
> change count = 1
> change count = 1
> change count = 1
> change count = 1
> change count = 1
>
> I don't see these output strings when I launch the binary from the command
> line (no GUI/QProcess). Weird thing is we only see this on SunOS and not
> on other platforms.
>
> The QProcess code is very simple and looks something like this:
>
> masterprocess = new QProcess(this);
>
> masterprocess->start("myscript.sh",args);
>
> connect(masterprocess,SIGNAL(readyReadStandardOutput()),this,SLOT(readmaste
> routput()));
> connect(masterprocess,SIGNAL(readyReadStandardError()),this,SLOT(readmaste
> rerr()));
>
> and..
>
> void MyClass::readmasteroutput()
> {
> if(masterprocess != NULL && masterprocess->state()==QProcess::Running)
> {
> QByteArray bt = masterprocess->readAllStandardOutput();
> QString str(bt);
> qDebug()<<"read all out"<<str; //this is where the spurious
> strings can be seen. }
> }
>
> I would like to know how I can go about debugging this issue....or what
> could be a possible reason for this anomaly. Any help is welcome.
Hi Sarvesh
I can't find "change count" in any printable strings anywhere in Qt 4.3.3
source code. So this cannot be coming from Qt itself.
Does it happen with QProcess running any other processes? Or just this specific
script?
I suggest using truss/strace/dtrace/equivalent to find out which process is
printing that message.
PS: Why are you referring to Solaris as SunOS? Usually, when someone says
"SunOS" they mean the versions leading up to 4, since SunOS 5 is Solaris.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
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: 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/20091211/a0184533/attachment.bin
More information about the Qt-interest-old
mailing list