Unknown C++ exception raised in activateWorkbench

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
hkroeger
Posts: 15
Joined: Mon Jan 13, 2014 1:27 pm

Unknown C++ exception raised in activateWorkbench

Post by hkroeger »

Dear experts,

I built the latest master branch from http://git.code.sf.net/p/free-cad/code on my ubuntu 13.10 system.
When I try to switch the workbench from PartDesign to Draw or Arch, I get the error "Unknown C++ exception raised in activateWorkbench". No more information on the error is emitted.
This error occurs when I run the executable built from the master branch as well as the one of the "jriegel/dev-assembly" branch.

What might be the reason for this error? How can I get more informations?

Thanks for any hints.

Regards, Hannes
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by shoogen »

I haven't done this before. But maybe you can try stop execution right at the place where the exception is thrown.
http://stackoverflow.com/questions/1115 ... ion-occurs
http://www.radford.edu/~nokie/classes/320/gdb.html
hkroeger
Posts: 15
Joined: Mon Jan 13, 2014 1:27 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by hkroeger »

Ah, thanks for the tip. Just tried it.

It results in 4 breaks during startup (not reported in the gui, obviously catched somewhere?) and 2 break during workbench switch:

Backtrace of the first:
#0 0x00007ffff4aa1a50 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007fffefec3b20 in xercesc_3_1::IconvGNULCPTranscoder::calcRequiredSize(unsigned short const*, xercesc_3_1::MemoryManager*) ()
from /usr/lib/x86_64-linux-gnu/libxerces-c-3.1.so
#2 0x00007fffefec37bc in xercesc_3_1::IconvGNULCPTranscoder::transcode(unsigned short const*, xercesc_3_1::MemoryManager*) ()
from /usr/lib/x86_64-linux-gnu/libxerces-c-3.1.so
#3 0x00007ffff6793fe9 in StrX::StrX(unsigned short const*) () from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADBase.so
#4 0x00007ffff6791b92 in ParameterGrp::FindElement(xercesc_3_1::DOMElement*, char const*, char const*) const ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADBase.so
#5 0x00007ffff678e98e in ParameterGrp::GetBool(char const*, bool) const ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADBase.so
#6 0x00007ffff7745625 in Gui::ToolBarManager::setup(Gui::ToolBarItem*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#7 0x00007ffff7749422 in Gui::Workbench::activate() () from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#8 0x00007ffff7754fcd in Gui::WorkbenchManager::activate(std::string const&, std::string const&) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#9 0x00007ffff744c552 in Gui::Application::activateWorkbench(char const*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so

And the second:
#0 0x00007ffff4aa1a50 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff677328a in Base::InterpreterSingleton::runString(char const*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADBase.so
#2 0x00007ffff74c692b in Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#3 0x00007ffff74db928 in StdCmdWorkbench::activated(int) () from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#4 0x00007ffff74c61a5 in Gui::Command::invoke(int) () from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#5 0x00007ffff74be0d3 in Gui::ActionGroup::onActivated(QAction*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#6 0x00007ffff74c2531 in Gui::ActionGroup::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#7 0x00007ffff4ed5a58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8 0x00007ffff563397f in QActionGroup::triggered(QAction*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9 0x00007ffff56339ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff4ed5a58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007ffff5630a32 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff5632403 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff74c2fdb in QAction::trigger() () from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#14 0x00007ffff74bf8ac in Gui::WorkbenchGroup::customEvent(QEvent*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#15 0x00007ffff4ed9e5d in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff5636dfc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff563d470 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff7455d03 in Gui::GUIApplication::notify(QObject*, QEvent*) ()
from /home/hannes/Programme/freecad-official/build-master/lib/libFreeCADGui.so
#19 0x00007ffff4ec18bd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x00007ffff4ec4e1f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff4eef073 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

Hmm, what does this tell us?
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by shoogen »

can you extract the string parameter from the stack for the second backtrace?
#1 0x00007ffff677328a in Base::InterpreterSingleton::runString(char const*) ()
hkroeger
Posts: 15
Joined: Mon Jan 13, 2014 1:27 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by hkroeger »

Dear shoogen,

I just did a "Debug"-rebuild and repeated the steps (note: switching to Arch instead to Drawing workbench and dev-assembly branch instead of master, but seems to fail at the same location). The second backtrace then is:

#0 0x00007ffff4abba50 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff678b890 in Base::InterpreterSingleton::runString (this=0x645cb0, sCmd=0x201fe70 "Gui.activateWorkbench(\"ArchWorkbench\")")
at /home/hannes/Programme/freecad-official/src/Base/Interpreter.cpp:163
#2 0x00007ffff74c9875 in Gui::Command::doCommand (eType=Gui::Command::Gui, sCmd=0x7ffff79e0385 "Gui.activateWorkbench(\"%s\")")
at /home/hannes/Programme/freecad-official/src/Gui/Command.cpp:427
#3 0x00007ffff74de8b2 in StdCmdWorkbench::activated (this=0xd89f10, i=1) at /home/hannes/Programme/freecad-official/src/Gui/CommandStd.cpp:100
#4 0x00007ffff74c9133 in Gui::Command::invoke (this=0xd89f10, i=1) at /home/hannes/Programme/freecad-official/src/Gui/Command.cpp:288
#5 0x00007ffff74c0da5 in Gui::ActionGroup::onActivated (this=0xab39a0, a=0xabecf0)
at /home/hannes/Programme/freecad-official/src/Gui/Action.cpp:336
#6 0x00007ffff74c533e in Gui::ActionGroup::qt_static_metacall (_o=0xab39a0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffc1f0)
at /home/hannes/Programme/freecad-official/build/src/Gui/moc_Action.cpp:129
#7 0x00007ffff4eefa58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8 0x00007ffff564d97f in QActionGroup::triggered(QAction*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9 0x00007ffff564d9ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff4eefa58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007ffff564aa32 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff564c403 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff74c5e21 in QAction::trigger (this=0xabecf0) at /usr/include/qt4/QtGui/qaction.h:218
#14 0x00007ffff74c25c4 in Gui::WorkbenchGroup::customEvent (this=0xab39a0, e=0x1ddf480)
at /home/hannes/Programme/freecad-official/src/Gui/Action.cpp:557
#15 0x00007ffff4ef3e5d in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff5650dfc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff5657470 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff745a1f3 in Gui::GUIApplication::notify (this=0x7fffffffcf60, receiver=0xab39a0, event=0x1ddf480)
at /#0 0x00007ffff4abba50 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff678b890 in Base::InterpreterSingleton::runString (this=0x645cb0, sCmd=0x201fe70 "Gui.activateWorkbench(\"ArchWorkbench\")")
at /home/hannes/Programme/freecad-official/src/Base/Interpreter.cpp:163
#2 0x00007ffff74c9875 in Gui::Command::doCommand (eType=Gui::Command::Gui, sCmd=0x7ffff79e0385 "Gui.activateWorkbench(\"%s\")")
at /home/hannes/Programme/freecad-official/src/Gui/Command.cpp:427
#3 0x00007ffff74de8b2 in StdCmdWorkbench::activated (this=0xd89f10, i=1) at /home/hannes/Programme/freecad-official/src/Gui/CommandStd.cpp:100
#4 0x00007ffff74c9133 in Gui::Command::invoke (this=0xd89f10, i=1) at /home/hannes/Programme/freecad-official/src/Gui/Command.cpp:288
#5 0x00007ffff74c0da5 in Gui::ActionGroup::onActivated (this=0xab39a0, a=0xabecf0)
at /home/hannes/Programme/freecad-official/src/Gui/Action.cpp:336
#6 0x00007ffff74c533e in Gui::ActionGroup::qt_static_metacall (_o=0xab39a0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffc1f0)
at /home/hannes/Programme/freecad-official/build/src/Gui/moc_Action.cpp:129
#7 0x00007ffff4eefa58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8 0x00007ffff564d97f in QActionGroup::triggered(QAction*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9 0x00007ffff564d9ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff4eefa58 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007ffff564aa32 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff564c403 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff74c5e21 in QAction::trigger (this=0xabecf0) at /usr/include/qt4/QtGui/qaction.h:218
#14 0x00007ffff74c25c4 in Gui::WorkbenchGroup::customEvent (this=0xab39a0, e=0x1ddf480)
at /home/hannes/Programme/freecad-official/src/Gui/Action.cpp:557
#15 0x00007ffff4ef3e5d in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff5650dfc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff5657470 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff745a1f3 in Gui::GUIApplication::notify (this=0x7fffffffcf60, receiver=0xab39a0, event=0x1ddf480)
at /home/hannes/Programme/freecad-official/src/Gui/Application.cpp:1510
#19 0x00007ffff4edb8bd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x00007ffff4edee1f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff4f09073 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007fffee4863b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
home/hannes/Programme/freecad-official/src/Gui/Application.cpp:1510
#19 0x00007ffff4edb8bd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x00007ffff4edee1f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff4f09073 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007fffee4863b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

So the parameter is obviously "Gui.activateWorkbench(\"ArchWorkbench\")"
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by shoogen »

Have you tried to enter the python string on the python commandline. As it seems to have better eroor reporting then the function that handles GUI events?
hkroeger
Posts: 15
Joined: Mon Jan 13, 2014 1:27 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by hkroeger »

I just tried. But this not more enlighting:

>>> Gui.activateWorkbench("ArchWorkbench")
Traceback (most recent call last):
File "<input>", line 1, in <module>
Exception: Unknown C++ exception raised in activateWorkbench
>>>
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by shoogen »

I would simply abbandon the master for a moment and try if it works in version 698899e6d70d89da70f9fa205bb75a136ac63351. Because werner did something i did not understand in 7506e740e076f27f6619618ec4cda5762ec5acfb concerning the activation of Workbenches.
hkroeger
Posts: 15
Joined: Mon Jan 13, 2014 1:27 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by hkroeger »

Ok, I did a
$ git checkout master
and then
$ git checkout 698899e6d70d89da70f9fa205bb75a136ac63351
on my working copy and recompiled everything with BUILD_TYPE "Debug"

Unfortunately, this gives the same error.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Unknown C++ exception raised in activateWorkbench

Post by shoogen »

sorry it was just, an idea in the mean time i complied the master version and could not reporduce your problem.
I guess you need to set a breakpoint in Base::Interpreter line 160 and singlestep through the python interpreter.
Post Reply