View Issue Details

IDProjectCategoryView StatusLast Update
0000640FreeCADBugpublic2012-04-10 15:50
Reporterariel-coAssigned Towmayer 
Status closedResolutionfixed 
Product Version0.12 
Target VersionFixed in Version0.13 
Summary0000640: This file crashes FreeCAD
DescriptionThe attached file used to work fine in FreeCAD 0.13 builds 0681-0699. SOmething happened to it and now every 0.13 version crashes if I delete certain element (labeled "Pocket Groove0,1,2") and save.

The file may be corrupt or inconsistent but I think FreeCAD should handle it better.
Additional InformationVersions: 0.13 - all builds
Platform: Windows 7 32-bits
TagsNo tags attached.


2012-03-14 22:30


pole piece 2 baffles - linked.FCStd (Attachment missing)


2012-03-15 15:25

administrator   ~0001779

There is something strange in that file indeed...

1) Opening and Saving-as the file, the saved file doesn't contain any brep, only the 2 xml files
2) Opening, deleting the "Pocket Groove0,1,2" object and Saving-as, produces a file that contains 0kb shapes, and the GuiDocument.xml is also 0kb
3) The following code "cleans" the file, after that it can be saved normally:

for o in App.ActiveDocument.Objects:

Might be related with the tree bug 0000415 , Werner, if you read this, what do you think?


2012-03-15 23:05

reporter   ~0001780

Last edited: 2012-03-16 22:40

Python 2.6.2 (r262:71600, Jun 22 2009, 21:44:05) [MSC v.1500 32 bit (Intel)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> execfile('C:/Program Files/FreeCAD0.13/data/Mod/Start/StartPage/')
>>> App.setActiveDocument("pole_piece_2_baffles___linked")
>>> App.ActiveDocument=App.getDocument("pole_piece_2_baffles___linked")
>>> Gui.ActiveDocument=Gui.getDocument("pole_piece_2_baffles___linked")
>>> for o in App.ActiveDocument.Objects:
... 	print o.Name," = ",o.Label
... 	o.touch()
Sketch002 = SketchBaffle - peanut
Sketch003 = SketchBaffle2
Cylinder = CylinderBase
Sketch007 = Sketch Groove0
Sketch006 = Sketch Groove1
Sketch001 = SketchBaffle1
Pocket002 = Pocket Groove0,1,2
>>> App.getDocument("pole_piece_2_baffles___linked").removeObject("Pocket002")

Then I try to save, and it segfaults.

2012-03-16 22:33


pole piece 2x3 baffles.FCStd (Attachment missing)


2012-03-16 22:33

reporter   ~0001783

Also, what is supposed to happen if I delete the sketch underlying a Pocket object? I managed to produce another crash-y file (attached), and I noticed that I can delete "Sketch Groove 0+1+2" but the "Pocket Groove 0+1+2" made from it stays there, unchanged; that doesn't make much sense to me, but I'm new at this.

FreeCAD also crashes if I delete that Pocket and save. BTW, "Save As" crashes too. Maybe it's because I'm running 0.13?


2012-03-17 00:22

reporter   ~0001784

Last edited: 2012-03-17 00:25

For what it's worth, I was able to delete the "dangling" Pocket and save with 0.12.5284 just fine. What may be going on is that another Sketch has an "edge linked to External Geometry" that depends on the Pocket I deleted.

2012-04-06 16:20


crashLogAndStack.tar (Attachment missing)


2012-04-06 16:34

reporter   ~0001892

Attached crashLogAndStack.tar.

Reproduced on ubuntu 12.04 (thought the first time it did not crash, might be random)

Compiled optimized so the stack might not be that useful.
>gdb ../../freecad-build/bin/FreeCAD
>run -l pole+piece+2+baffles+-+linked.FCStd
-> select "Pocket Groove0,1,2" and use suppress key.

Note at the end of the log might be some useful info:
Log: Sel : Rmv Selection "pole_piece_2_baffles___linked.Pocket002.(null)"
Log: QWidget::repaint: Recursive repaint detected

Optimized Stack.

Program received signal SIGSEGV, Segmentation fault.
0xb6844931 in ?? () from /usr/lib/i386-linux-gnu/
(gdb) bt
#0 0xb6844931 in ?? () from /usr/lib/i386-linux-gnu/
#1 0xb67c0f46 in QPainter::setBrushOrigin(QPointF const&) () from /usr/lib/i386-linux-gnu/
0000002 0xb66a5749 in QWidgetPrivate::paintBackground(QPainter*, QRegion const&, int) const () from /usr/lib/i386-linux-gnu/
0000003 0xb66aaf95 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/i386-linux-gnu/
0000004 0xb68a3d4b in ?? () from /usr/lib/i386-linux-gnu/
0000005 0xb66a09db in QWidgetPrivate::syncBackingStore() () from /usr/lib/i386-linux-gnu/
0000006 0xb66afae7 in QWidget::event(QEvent*) () from /usr/lib/i386-linux-gnu/
0000007 0xb6aea2ac in QMainWindow::event(QEvent*) () from /usr/lib/i386-linux-gnu/
0000008 0xb7c0ca4d in Gui::MainWindow::event(QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000009 0xb6654ed4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/
0000010 0xb665a3a2 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/
0000011 0xb79c758c in Gui::GUIApplication::notify(QObject*, QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000012 0xb637997e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/
0000013 0xb637dad8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/i386-linux-gnu/
0000014 0xb637de0c in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/i386-linux-gnu/
0000015 0xb63ac494 in ?? () from /usr/lib/i386-linux-gnu/
0000016 0xb4ad8d7a in g_main_context_dispatch () from /lib/i386-linux-gnu/
0000017 0xb4ad9185 in ?? () from /lib/i386-linux-gnu/
0000018 0xb4ad9261 in g_main_context_iteration () from /lib/i386-linux-gnu/
0000019 0xb63ac887 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/
0000020 0xb670daaa in ?? () from /usr/lib/i386-linux-gnu/
0000021 0xb637850d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/
0000022 0xb63787a9 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/
0000023 0xb637deba in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/
0000024 0xb6652a74 in QApplication::exec() () from /usr/lib/i386-linux-gnu/
0000025 0xb79c3cb5 in Gui::Application::runApplication() () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000026 0x0804fa73 in main ()
(gdb) quit

$ qmake --version
QMake version 2.01a
Using Qt version 4.8.1 in /usr/lib/i386-linux-gnu

Will compile debug and try to rerun the testCase.


2012-04-06 18:26

reporter   ~0001893

when not in gdb this message appear at the end of the log (end in the shell)
Log: Sel : Rmv Selection "pole_piece_2_baffles___linked.Pocket002.(null)"
Log: QWidget::repaint: Recursive repaint detected
Err: Illegal storage access...Err:


2012-04-07 10:06

reporter   ~0001897

Note NULL Pointer use and crash.

void QRasterPaintEngine::brushOriginChanged()
    QRasterPaintEngineState *s = state();
    qDebug() << "QRasterPaintEngine::brushOriginChanged()" << s->brushOrigin;

>>>> s->fillFlags |= DirtyBrushOrigin;

More relevant stack.
add a breakpoint on the QT warning:
                qWarning("QWidget::repaint: Recursive repaint detected");
(gdb) bt
#0 QWidgetPrivate::drawWidget (this=0x835ed40, pdev=0x93ce6c8, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8f71820) at kernel/qwidget.cpp:5534
#1 0xb68a3d4b in QWidgetBackingStore::sync (this=0x8f71820) at painting/qbackingstore.cpp:1365
0000002 0xb66a09db in QWidgetPrivate::syncBackingStore (this=0x8314fc0) at kernel/qwidget.cpp:1891
0000003 0xb66afae7 in QWidget::event (this=0xbfffee94, event=0xbfffd680) at kernel/qwidget.cpp:8655
0000004 0xb6aea2ac in QMainWindow::event (this=0xbfffee94, event=0xbfffd680) at widgets/qmainwindow.cpp:1478
0000005 0xb7c0ca4d in Gui::MainWindow::event(QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000006 0xb6654ed4 in notify_helper (e=0xbfffd680, receiver=0xbfffee94, this=0x81845c8) at kernel/qapplication.cpp:4559
0000007 QApplicationPrivate::notify_helper (this=0x81845c8, receiver=0xbfffee94, e=0xbfffd680) at kernel/qapplication.cpp:4531
0000008 0xb665a3a2 in QApplication::notify (this=0x81845c8, receiver=0xbfffee94, e=0xbfffd680) at kernel/qapplication.cpp:4524
0000009 0xb79c758c in Gui::GUIApplication::notify(QObject*, QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000010 0xb637997e in QCoreApplication::notifyInternal (this=0xbfffeeac, receiver=0xbfffee94, event=0xbfffd680) at kernel/qcoreapplication.cpp:876
0000011 0xb689edec in sendEvent (event=0xbfffd67c, receiver=0xbfffee94) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
0000012 sendUpdateRequest (updateImmediately=true, widget=0xbfffee94) at painting/qbackingstore.cpp:534
0000013 QWidgetBackingStore::markDirty (this=0x8f71820, rect=..., widget=0x8315ca0, updateImmediately=true, invalidateBuffer=false) at painting/qbackingstore.cpp:722
0000014 0xb669fff2 in repaint (rect=..., this=0x8315ca0) at kernel/qwidget.cpp:10457
0000015 QWidget::repaint (this=0x8315ca0, rect=...) at kernel/qwidget.cpp:10435
0000016 0xb6b35749 in QStatusBar::hideOrShow (this=0x8315ca0) at widgets/qstatusbar.cpp:695
0000017 0xb6b358c2 in QStatusBar::showMessage (this=0x8315ca0, message=..., timeout=0) at widgets/qstatusbar.cpp:614
0000018 0xb7aff5af in Gui::DocumentObjectItem::displayStatusInfo() () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000019 0xb7afbcf1 in Gui::TreeWidget::onItemEntered(QTreeWidgetItem*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000020 0xb7aff809 in Gui::TreeWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000021 0xb63906b1 in QMetaObject::activate (sender=0x835e8a8, m=0xb6fdb154, local_signal_index=4, argv=0xbfffd8f4) at kernel/qobject.cpp:3547
0000022 0xb6c89ccd in QTreeWidget::itemEntered (this=0x835e8a8, _t1=0x99786f8, _t2=0) at .moc/release-shared/moc_qtreewidget.cpp:242
0000023 0xb6c89d4d in QTreeWidgetPrivate::_q_emitItemEntered (this=0x835e908, index=...) at itemviews/qtreewidget.cpp:2259
0000024 0xb63906b1 in QMetaObject::activate (sender=0x835e8a8, m=0xb6fd9b7c, local_signal_index=4, argv=0xbfffda08) at kernel/qobject.cpp:3547
0000025 0xb6c07a55 in QAbstractItemView::entered (this=0x835e8a8, _t1=...) at .moc/release-shared/moc_qabstractitemview.cpp:369
0000026 0xb6c07bf0 in QAbstractItemViewPrivate::checkMouseMove (this=0x835e908, index=...) at itemviews/qabstractitemview.cpp:172
0000027 0xb6c07e59 in checkMouseMove (pos=..., this=0x835e908) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:156
0000028 QAbstractItemView::verticalScrollbarValueChanged (this=0x835e8a8, value=4) at itemviews/qabstractitemview.cpp:2664
0000029 0xb6c0832b in qt_static_metacall (_a=0xbfffdbe8, _id=26, _o=0x835e8a8, _c=<optimized out>) at .moc/release-shared/moc_qabstractitemview.cpp:223
0000030 QAbstractItemView::qt_static_metacall (_o=0x835e8a8, _c=QMetaObject::InvokeMetaMethod, _id=26, _a=0xbfffdbe8) at .moc/release-shared/moc_qabstractitemview.cpp:191
0000031 0xb63906b1 in QMetaObject::activate (sender=0x835f8a0, m=0xb6fe0900, local_signal_index=0, argv=0xbfffdbe8) at kernel/qobject.cpp:3547
0000032 0xb6d8cf65 in QAbstractSlider::valueChanged (this=0x835f8a0, _t1=4) at .moc/release-shared/moc_qabstractslider.cpp:196
0000033 0xb6a83fb5 in QAbstractSlider::setValue (this=0x835f8a0, value=4) at widgets/qabstractslider.cpp:543
0000034 0xb6a8408f in QAbstractSlider::setRange (this=0x835f8a0, min=0, max=4) at widgets/qabstractslider.cpp:252
0000035 0xb6c4f817 in QTreeViewPrivate::updateScrollBars (this=0x835e908) at itemviews/qtreeview.cpp:3513
0000036 0xb6c4fd28 in QTreeView::updateGeometries (this=0x835e8a8) at itemviews/qtreeview.cpp:2721
0000037 0xb6c06054 in QAbstractItemView::doItemsLayout (this=0x835e8a8) at itemviews/qabstractitemview.cpp:1164
0000038 0xb6c57598 in QTreeView::doItemsLayout (this=0x835e8a8) at itemviews/qtreeview.cpp:2064
#39 0xb6c5100c in executePostedLayout (this=0x835e908) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:212
#40 executePostedLayout (this=0x835e908) at itemviews/qtreeview.cpp:2100
0000041 QTreeView::verticalOffset (this=0x835e8a8) at itemviews/qtreeview.cpp:2109
0000042 0xb6c132b5 in QAbstractItemViewPrivate::contentsOffset (this=0x835e908) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:294
0000043 0xb66a5709 in QWidgetPrivate::paintBackground (this=0x40000001, painter=0xbfffe0e8, rgn=..., flags=0) at kernel/qwidget.cpp:2413
0000044 0xb66aaf95 in QWidgetPrivate::drawWidget (this=0x835ed40, pdev=0x93ce6c8, rgn=..., offset=..., flags=68, sharedPainter=0x0, backingStore=0x8f71820) at kernel/qwidget.cpp:5563
0000045 0xb68a3d4b in QWidgetBackingStore::sync (this=0x8f71820) at painting/qbackingstore.cpp:1365
0000046 0xb66a09db in QWidgetPrivate::syncBackingStore (this=0x8314fc0) at kernel/qwidget.cpp:1891
0000047 0xb66afae7 in QWidget::event (this=0xbfffee94, event=0x9245db8) at kernel/qwidget.cpp:8655
0000048 0xb6aea2ac in QMainWindow::event (this=0xbfffee94, event=0x9245db8) at widgets/qmainwindow.cpp:1478
0000049 0xb7c0ca4d in Gui::MainWindow::event(QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000050 0xb6654ed4 in notify_helper (e=0x9245db8, receiver=0xbfffee94, this=0x81845c8) at kernel/qapplication.cpp:4559
0000051 QApplicationPrivate::notify_helper (this=0x81845c8, receiver=0xbfffee94, e=0x9245db8) at kernel/qapplication.cpp:4531
0000052 0xb665a3a2 in QApplication::notify (this=0x81845c8, receiver=0xbfffee94, e=0x9245db8) at kernel/qapplication.cpp:4524
0000053 0xb79c758c in Gui::GUIApplication::notify(QObject*, QEvent*) () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000054 0xb637997e in QCoreApplication::notifyInternal (this=0xbfffeeac, receiver=0xbfffee94, event=0x9245db8) at kernel/qcoreapplication.cpp:876
0000055 0xb637dad8 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
0000056 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x806ae20) at kernel/qcoreapplication.cpp:1500
0000057 0xb637de0c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1393
0000058 0xb63ac494 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
0000059 postEventSourceDispatch (s=0x8182308) at kernel/qeventdispatcher_glib.cpp:279
0000060 0xb4ad8d7a in g_main_context_dispatch () from /lib/i386-linux-gnu/
0000061 0xb4ad9185 in ?? () from /lib/i386-linux-gnu/
0000062 0xb4ad9261 in g_main_context_iteration () from /lib/i386-linux-gnu/
0000063 0xb63ac887 in QEventDispatcherGlib::processEvents (this=0x818fe20, flags=...) at kernel/qeventdispatcher_glib.cpp:424
0000064 0xb670daaa in QGuiEventDispatcherGlib::processEvents (this=0x818fe20, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
0000065 0xb637850d in QEventLoop::processEvents (this=0xbfffecf4, flags=...) at kernel/qeventloop.cpp:149
0000066 0xb63787a9 in QEventLoop::exec (this=0xbfffecf4, flags=...) at kernel/qeventloop.cpp:204
0000067 0xb637deba in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
0000068 0xb6652a74 in QApplication::exec () at kernel/qapplication.cpp:3820
0000069 0xb79c3cb5 in Gui::Application::runApplication() () from /home/gibus/Dvp/FreeCad/freecad-build/lib/
0000070 0x0804fa73 in main ()


2012-04-07 11:21

reporter   ~0001898

1 - Do not crash if the mouse is moved away from the tree before suppressing the element.

2 - Warning in log which might be unrelated.
Log: Loading Start module... done
Wrn: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "Toggle visibility" under id 220


2012-04-07 12:00

administrator   ~0001899

OK, there are actually two bugs here:
1. when removing the pocket object there is used a non-initialized pointer which leads to an undefined behaviour. I think this is what happens to Jean-Philippe. The bug is already there in v0.12 and that it doesn't crash is only luck

2. There is a second problem when removing the pocket (in case it didn't already crash). The relate sketch still has some references to the removed pocket and when saving the document we write a 0-string to the file. In Windows this crashes but apparently only Linux it may throw an exception (not sure about that). At least this causes the empty project file.


2012-04-07 12:02

administrator   ~0001900

Fixed in 255d6b40115e029e6451e906419c255f23d0563b

Issue History

Date Modified Username Field Change
2012-03-14 22:30 ariel-co New Issue
2012-03-14 22:30 ariel-co File Added: pole piece 2 baffles - linked.FCStd
2012-03-15 15:25 yorik Note Added: 0001779
2012-03-15 23:05 ariel-co Note Added: 0001780
2012-03-16 22:33 ariel-co File Added: pole piece 2x3 baffles.FCStd
2012-03-16 22:33 ariel-co Note Added: 0001783
2012-03-16 22:40 ariel-co Note Edited: 0001780
2012-03-17 00:22 ariel-co Note Added: 0001784
2012-03-17 00:25 ariel-co Note Edited: 0001784
2012-04-06 16:20 jeanphilippe File Added: crashLogAndStack.tar
2012-04-06 16:34 jeanphilippe Note Added: 0001892
2012-04-06 18:26 jeanphilippe Note Added: 0001893
2012-04-07 10:06 jeanphilippe Note Added: 0001897
2012-04-07 11:21 jeanphilippe Note Added: 0001898
2012-04-07 12:00 wmayer Note Added: 0001899
2012-04-07 12:02 wmayer Note Added: 0001900
2012-04-07 12:02 wmayer Status new => resolved
2012-04-07 12:02 wmayer Fixed in Version => 0.13
2012-04-07 12:02 wmayer Resolution open => fixed
2012-04-07 12:02 wmayer Assigned To => wmayer
2012-04-10 15:50 wmayer Status resolved => closed