[Qt-interest] [Qt-embedded-interest] QProcess::execute() results in arbitrary "segmenation faults" or "illegal instructions"

Markus Franke Franke.M at sebakmt.com
Mon Jul 5 10:33:36 CEST 2010


Hi Rohan,

thanks for your reply.

Well, I agree with you that it's quiet hard to determine the cause of the 
problem having just a couple of lines of code.

So far I determined that the application crashes at this line 
(QProcess::execute()) of code by using qDebug() before and after the 
function call. 
Furthermore, I now found out that removing a usleep() function call in 
another thread solves or at least avoids the problem. I am still stuck and 
don't have clue what might cause this behaviour.

I also tried to catch the "Segmentation Fault" with gdb in order to get a 
backtrace but once the application crashed gdb simply says "No stack" when 
trying to retrieve the stack via "bt".

What do you mean by "calling through a dangling pointer"? I printed the 
pointer of the object to which getLanguageUpdates() belongs to and 
everything seems to be allright. Also the object never get's destroyed as 
far as I can see.

Thanks for any comments on this,

Markus

Rohan McGovern <rohan.mcgovern at nokia.com> schrieb am 05.07.2010 03:02:53:

> On Thursday 01 July 2010, ext Markus Franke wrote:
> > Dear all,
> >
> > I am observing a strange behaviour of the QProcess::execute()
> > function resulting in segmentation faults.
> >
> > I have an object (see sample code below) which installs a timer.
> > The timer function is called every 100ms and executes within a
> > loop an external process with the help of the QProcess::execute()
> > function.
> >
> > For a couple of minutes everything is working fine and the
> > processes are being executed. But then, at some point in time my
> > whole application crashes with a "Segmentation fault" or "Illegal
> > instruction" right before or just after the call to
> > QProcess::execute().
> 
> Hi Markus,
> 
> Unfortunately there's an infinite amount of coding errors which 
> could cause this and the code you pasted isn't precise enough to 
> determine which one is causing the problem :-(
> 
> For example, you could be calling getLanguageUpdates through a 
> dangling pointer.
> 
> I think you should use general debugging techniques to determine the 
> problem, and if you want help with your code again, you should at 
> least describe how it is that you know the application is crashing 
> before or after QProcess::execute();
> 
> Also, for getting help with code, I think you'll get faster 
> turnaround asking for help on #qt on IRC (freenode) :-)
> 
> -- 
> Rohan



"Disclaimer: This message is intended only for the use of the individual 
or entity to
which it is addressed and may contain information which is privileged, 
confidential, proprietary,
or exempt from disclosure under applicable law. If you are not the 
intended recipient or the person
responsible for delivering the message to the intended recipient, you are 
strictly prohibited from
disclosing, distributing, copying, or in any way using this message. If 
you have received this 
communication in error, please notify the sender and destroy and delete 
any copies you may have
received."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100705/bb58bccb/attachment.html 


More information about the Qt-interest-old mailing list