View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000665||FreeCAD||Bug||public||2012-04-07 13:40||2012-10-01 10:45|
|Target Version||Fixed in Version||0.13|
|Summary||0000665: Follow up 0000640: This file crashes FreeCAD UI latest Git|
While looking at this crash 640, I seem to have investigated an other issue.
The information I added there where related to a crash in the UI.
I pulled git, and seen the patch for 640 beeing executed (breakpoint).
However, I still get the same crash in QT.
Log: Sel : Rmv Selection "pole_piece_2_baffles___linked.Pocket002.(null)"
Log: QWidget::repaint: Recursive repaint detected
>tar -xvf test.tar
(gdb) > cd testDir
(gdb) > run -l pole+piece+2+baffles+-+linked.FCStd
-> wait until open
-> scroll Label & Attributes dock window all the way down.
-> Place the cursor on the last elt ("Pocket Groove0,1,2").
-> left click to select and do not move the cursor (I have a laptop with touchpad)
-> press the 'suppr' key on the keyboard (might be 'Del' on english keyboard)
Program received signal SIGSEGV, Segmentation fault.
QRasterPaintEngine::brushOriginChanged (this=0x8324c18) at painting/qpaintengine_raster.cpp:809
I'm new using freecad, so I'm not completely sure I have the exact correct configuration. I ran the freecad test and they pass. So I assume it's ok.
I could not add a note on the previous bug, and it seems to be a different issue so I open this new bug.
qWarning("QWidget::repaint: Recursive repaint detected");
|Tags||No tags attached.|
I am far from being a QT expert, so the proposed solution might not be correct but it stop the crash so I post it.
Proof of concept:
gibus@gibusPc:~/Dvp/FreeCad/freecad$ git diff
diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp
index 9d19c5b..860ed6d 100644
@@ -1167,7 +1167,11 @@ void DocumentObjectItem::displayStatusInfo()
QString info = QString::fromAscii(Obj->getStatusString());
if ( Obj->mustExecute() == 1 )
info += QString::fromAscii(" (but must be executed)");
- getMainWindow()->statusBar()->showMessage( info );
+ QMetaObject::invokeMethod(getMainWindow()->statusBar(), "showMessage",
+ //getMainWindow()->statusBar()->showMessage( info );
Note: this is a proof of concept, copied from ProgressBar.cpp.
I think a proper fix would be done in 2 times (as the problem might appear in different circumstance)
1 - refactor all calls to getMainWindow()->statusBar()->showMessage to be getMainWindow()->showMessage (slight behavior change(use fontMetric::elidedText before callingQStqtusBar::showMessage. would it be correct)
2 - change MainWindow::showMessage from calling 'this->statusBar()->showMessage(msg, timeout);'
to use QMetaObject::invokeMethod with QueuedConnection
If this is not too urgent, I would be happy to code that for you in a branch(jeanphilippe/dev) if the solution seems right to people more knowledgeable with QT.
Should there be a regression test associated with it?
I set up a github. (safer and cleaner, don't need write access to sourceforge): github.com/jeanphilippeD/FreeCAD
The proposed fix are in the last 2 commits:
1 - the name of MainWindow::showMessage could be changed to 'queueStatusMsg' or something better to reflect the new usage(I could do that in a further commit)
2 - should MainWindow::statusBar() be made private or protected to avoid bad use. (the few remaining use of it would have to be redirected through MainWindow).
3 - found something strange, connect 1 slot and disconnect an other:
connect(view, SIGNAL(message(const QString&, int)),
statusBar(), SLOT(showMessage(const QString&, int)));
disconnect(view, SIGNAL(message(const QString&, int)),
statusBar(), SLOT(message(const QString&, int )));
Also, are they needed?
Hope it is helpful.
Note on reproductibility:
The main window need to be small enough for a vertical scroll bar on the tree to be there. resize main window if needed to reproduce crash.
What Qt version do you use? To me it seems it's rather a Qt bug than a FreeCAD bug because the way how we show the information in displayStatusInfo() is OK IMO.
And with Qt 4.5.3 and 4.8.4 I was not able to reproduce any crashes.
Thanks for the answer.
$ qmake --version
QMake version 2.01a
Using Qt version 4.8.1 in /usr/lib/i386-linux-gnu
I'll upgrade to 4.8.4 when I come back from holiday next monday.
||Oops, it's not Qt 4.8.4 but also 4.8.1 and still no luck to reproduce this crash.|
I'm on ubuntu 12.04 (last beta), all updated today.
used the software center to install freecad 0.12.5284-dfsg-5ubuntu1
The crash still occurs.
I uploaded screenShots.tar which contain screenShots of the 5 steps I took and the logFile.
2 things seem key:
- the window need to be small enough so that you need to scroll.
- the cursor need to be on the selected item when pressing 'suppr' (you can move the cursor away and place it back (as I did when taking screenshots))
The crash do not occur on windows.
The end of the log:
Log: ESC[31mvoid DBusMenuExporterPrivate::addAction(QAction*, int)ESC[0m: Already tracking action "Toggle visibility" under id 218
Log: ESC[31mvoid DBusMenuExporterPrivate::addAction(QAction*, int)ESC[0m: Already tracking action "Chamfer..." under id 330
Log: Active view is pole+piece+2+baffles+-+linked : 1
Log: QWidget::repaint: Recursive repaint detected
Err: Illegal storage access...Err:
||git show 58da2ebbcc94d0bb203b0ce70069abd77c2b8bab|
|2012-04-07 13:40||jeanphilippe||New Issue|
|2012-04-07 13:40||jeanphilippe||File Added: test.tar|
|2012-04-07 13:42||jeanphilippe||File Added: crashLogAndStack.tar|
|2012-04-07 15:45||jeanphilippe||Note Added: 0001901|
|2012-04-08 08:52||jeanphilippe||Note Added: 0001907|
|2012-04-08 16:07||jeanphilippe||Note Added: 0001910|
|2012-04-10 14:57||wmayer||Note Added: 0001915|
|2012-04-10 15:33||jeanphilippe||Note Added: 0001920|
|2012-04-12 12:03||wmayer||Note Added: 0001932|
|2012-04-17 08:00||jeanphilippe||File Added: screenShots.tar|
|2012-04-17 08:13||jeanphilippe||Note Added: 0001953|
|2012-10-01 10:45||wmayer||Note Added: 0002437|
|2012-10-01 10:45||wmayer||Status||new => closed|
|2012-10-01 10:45||wmayer||Resolution||open => fixed|
|2012-10-01 10:45||wmayer||Fixed in Version||=> 0.13|