[Qt-interest] spurious output messages in QProcess - SunOS
Sarvesh Saran
Sarvesh.Saran at synopsys.com
Fri Dec 11 10:19:33 CET 2009
Hi Thiago,
I was able to locate the spurious string..turns out it originated from a printf that got accidently introduced during debugging of one of our libraries.
Thanks a lot for your help...at least I learnt how to use truss in the process.
P.S I referred to it as SunOS because that's what I got from typing uname -sr in my host machine.
Thanks,
Sarvesh
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Thiago Macieira
Sent: Friday, December 11, 2009 1:07 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] spurious output messages in QProcess - SunOS
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(read
> maste
> routput()));
>
> connect(masterprocess,SIGNAL(readyReadStandardError()),this,SLOT(readm
> aste
> 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
More information about the Qt-interest-old
mailing list