crash

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

crash

Post by tanderson69 »

Backtrace:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6cbe318 in App::DocumentObject::getNameInDocument (this=0x0) at /mnt/files/Programming/free-cad-git/src/App/DocumentObject.cpp:117
117         if (!pcNameInDocument) return 0;
(gdb) bt
#0  0x00007ffff6cbe318 in App::DocumentObject::getNameInDocument (this=0x0) at /mnt/files/Programming/free-cad-git/src/App/DocumentObject.cpp:117
#1  0x00007fffc5956aec in switchToDocument (doc=0x20143f0) at /mnt/files/Programming/free-cad-git/src/Mod/PartDesign/Gui/Workbench.cpp:278
#2  0x00007fffc595845d in PartDesignGui::Workbench::activated (this=0xbcd350) at /mnt/files/Programming/free-cad-git/src/Mod/PartDesign/Gui/Workbench.cpp:564
#3  0x00007ffff745fa2c in Gui::Application::activateWorkbench (this=0x7fffffffd510, name=0x7ffff7e3f444 "PartDesignWorkbench")
    at /mnt/files/Programming/free-cad-git/src/Gui/Application.cpp:1044
#4  0x00007ffff747c939 in Gui::Application::sActivateWorkbenchHandler (args=0x7ffff7e54890) at /mnt/files/Programming/free-cad-git/src/Gui/ApplicationPy.cpp:523
#5  0x00007ffff61b28d5 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#6  0x00007ffff62462fa in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#7  0x00007ffff6246622 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#8  0x00007ffff62466bd in PyRun_StringFlags () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#9  0x00007ffff6781226 in Base::InterpreterSingleton::runString (this=0x63d950, sCmd=0x24ed300 "Gui.activateWorkbench(\"PartDesignWorkbench\")")
    at /mnt/files/Programming/free-cad-git/src/Base/Interpreter.cpp:161
#10 0x00007ffff74d8a7b in Gui::Command::doCommand (eType=Gui::Command::Gui, sCmd=0x7ffff79d6fa4 "Gui.activateWorkbench(\"%s\")") at /mnt/files/Programming/free-cad-git/src/Gui/Command.cpp:427
#11 0x00007ffff74edfaf in StdCmdWorkbench::activated (this=0xbdc510, i=14) at /mnt/files/Programming/free-cad-git/src/Gui/CommandStd.cpp:99
#12 0x00007ffff74d8337 in Gui::Command::invoke (this=0xbdc510, i=14) at /mnt/files/Programming/free-cad-git/src/Gui/Command.cpp:288
#13 0x00007ffff74cff77 in Gui::ActionGroup::onActivated (this=0x1468b90, a=0x891df0) at /mnt/files/Programming/free-cad-git/src/Gui/Action.cpp:336
#14 0x00007ffff74d4522 in Gui::ActionGroup::qt_static_metacall (_o=0x1468b90, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffc380)
    at /mnt/files/Programming/free-cad-git-build/src/Gui/moc_Action.cpp:129
#15 0x00007ffff4f0e0ef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff566259f in QActionGroup::triggered(QAction*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff5662627 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff4f0e0ef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007ffff565f152 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007ffff5660580 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#21 0x00007ffff74d5003 in QAction::trigger (this=0x891df0) at /usr/include/qt4/QtGui/qaction.h:218
#22 0x00007ffff74d177c in Gui::WorkbenchGroup::customEvent (this=0x1468b90, e=0xb37a70) at /mnt/files/Programming/free-cad-git/src/Gui/Action.cpp:557
#23 0x00007ffff4f1361c in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#24 0x00007ffff56658ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007ffff566825b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#26 0x00007ffff7468b87 in Gui::GUIApplication::notify (this=0x7fffffffd360, receiver=0x1468b90, event=0xb37a70) at /mnt/files/Programming/free-cad-git/src/Gui/Application.cpp:1510
#27 0x00007ffff4ef963e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00007ffff4efd171 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x00007ffff4f27e83 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007fffee5def05 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007fffee5df248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007fffee5df304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff4f28016 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007ffff570b1ae in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007ffff4ef838f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007ffff4ef8618 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007ffff4efdcf6 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#38 0x00007ffff7463ed5 in Gui::Application::runApplication () at /mnt/files/Programming/free-cad-git/src/Gui/Application.cpp:1765
#39 0x0000000000408681 in main (argc=1, argv=0x7fffffffdf08) at /mnt/files/Programming/free-cad-git/src/Main/MainGui.cpp:310
(gdb) finish
Run till exit from #0  0x00007ffff6cbe318 in App::DocumentObject::getNameInDocument (this=0x0) at /mnt/files/Programming/free-cad-git/src/App/DocumentObject.cpp:117
*** Abort *** an exception was raised, but no catch was found.
        ... The exception is:SIGSEGV 'segmentation violation' detected. Address 48
[Thread 0x7fffdbc2e700 (LWP 30519) exited]
[Thread 0x7ffff7fb67c0 (LWP 30512) exited]
[Inferior 1 (process 30512) exited with code 01]
(gdb) quit

diff that is fixing it here:

Code: Select all

git diff --no-prefix
diff --git src/Mod/PartDesign/Gui/Workbench.cpp src/Mod/PartDesign/Gui/Workbench.cpp
index 1e228e9..8361c04 100644
--- src/Mod/PartDesign/Gui/Workbench.cpp
+++ src/Mod/PartDesign/Gui/Workbench.cpp
@@ -275,7 +275,8 @@ void switchToDocument(const App::Document* doc)
                                                 sketch->getNameInDocument(), Datum.c_str(), side.c_str());
 
                         Gui::Selection().clearSelection();
-                        Gui::Selection().addSelection(doc->getName(), oldTip->getNameInDocument());
+                        if (oldTip)
+                          Gui::Selection().addSelection(doc->getName(), oldTip->getNameInDocument());
                         Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')");
                         Gui::Selection().clearSelection();
                     }
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: crash

Post by wmayer »

But that's not the master branch, is it?
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: crash

Post by tanderson69 »

wmayer wrote:But that's not the master branch, is it?
No.... Sorry.... This comes from the assembly branch which contains jans work in part design.
jrheinlaender
Posts: 554
Joined: Sat Apr 07, 2012 2:42 am

Re: crash

Post by jrheinlaender »

Thanks. I fixed it in my branch jrheinlaender/dev-assembly-partdesign. That has tons of other fixes and improvements but nobody has got around to merging them yet. See this pull request

viewtopic.php?f=17&t=4431
Post Reply