[Kst] Mysterious crash, please help!

Barth Netterfield barth.netterfield at utoronto.ca
Tue Nov 12 22:07:06 UTC 2013

Here is what I have learned:

The offending call to setStatusMessage occurs from ViewItem::paint() 
(down several layers) which is only supposed to be called in response to a 
main window update, which is only supposed to happen in the main (GUI) 

All indications are it *is* only happening in the main (GUI) thread.

In fact, the only other threads are the validateDSThread and threads 
created by data sources.  But I can get the crash with just an empty plot 
and no data
objects and no data sources.  So it isn't threading.

The setStatusMessage call also happens in the hoverMoveEvent.  And it is 
just fine from there.  No crashes.

If I put in a setStatusMessage("test message") at the end of 
ViewItem::paint() (with the processHoverMoveEvent removed) then "test 
Message" gets written *over* the status message written in from 
hoverMoveEvent(), without erasing it first.

So: it seems that you can't make the call from inside a main window paint 
event - which is where paint gets called from.  So you can't set the 
message from inside ::paint().

Seems like a Qt bug to me, though I can't find any reference to it anywhere 

In any case - making sure we delay actually updating the statusMessage 
until after the painting is done fixes the problem.

I will push the fix.


On November 12, 2013 2:09:00 PM Barth Netterfield wrote:

> I'm going to start looking at... right now.
> On November 12, 2013 8:06:28 PM Nicolas Brisset wrote:
> > Hi Peter,
> > 
> > I tried your suggestion below, but it does not work. I don't get 
> > and it still crashes. Also tried Qt::BlockingQueuedConnection, which
> > raises
> > the following message: Qt: Dead lock detected while activating a
> > BlockingQueuedConnection: Sender is AsciiSource(0x7f3864c72010), 
> > is Kst::MainWindow(0x13b2680)
> > 
> > The other problem is that the other places which trigger messages 
don't do
> > it with signals but by calling setMessage() directly. What I don't get is
> > why it works to call setText() on a QLabel and not showMessage on the
> > QStatusBar object.
> > 
> > Looks like I'm still stuck.
> > 
> > Nicolas
> > 
> > > You could try to connect all signals to setMessage() with
> > > Qt::QueuedConnection.
> > 
> > _______________________________________________
> > Kst mailing list
> > Kst at kde.org
> > https://mail.kde.org/mailman/listinfo/kst

Barth Netterfield
University of Toronto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20131112/5efd1180/attachment-0001.html>

More information about the Kst mailing list