Assembly2 Segfault when Importing a part

Discussion about the development of the Assembly workbench.
leoheck
Posts: 12
Joined: Tue Mar 13, 2018 5:56 pm

Assembly2 Segfault when Importing a part

Postby leoheck » Tue Nov 20, 2018 8:25 pm

Assembly2 segfault when "Importing a part from another Freecad document". It also happens when refreshing imported parts.

I am using Freecad 0.18 (AppImage) and Assembly2 for some time ago. Today I just removed the AppImage to install the PPA versions instead.
I also removed all extensions and installed them again.

I don't know what has caused the problem. Maybe it is related to the Assembly2 version that I installed. However, I have no idea about which version was installed before. I also updated my system (Ubutnu 18.04) like I usually do. This can be the culprit too.

It happens with freecad (0.17) and freecad-daily (0.18)

Running freecad-daily with GDB I got this:

Code: Select all

[New Thread 0x7fff52ffd700 (LWP 16084)]
[New Thread 0x7fff51191700 (LWP 16085)]
[New Thread 0x7fff50990700 (LWP 16086)]
importing part from /home/lheck/Dropbox/deepx/HOMEBASE/rpi-homebase-case-v0.2/homebase_logo.fcstd

Thread 1 "freecad-daily" received signal SIGSEGV, Segmentation fault.
0x00007fffe9ba5fcb in XML_SetHashSalt () from /lib/x86_64-linux-gnu/libexpat.so.1
The output running it from the CLI without GDB

Code: Select all

importing part from /home/lheck/Dropbox/deepx/HOMEBASE/rpi-homebase-case-v0.2/homebase_bottom.fcstd
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f9fcc5b9f20]
#1  /lib/x86_64-linux-gnu/libexpat.so.1(XML_SetHashSalt+0x1b) [0x7f9fc1c06fcb]
#2  /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so(+0x6865) [0x7f9f29ee5865]
#3  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8010) [0x7f9fce1a31d0]
#4  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7f9fce2d3278]
#5  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1646dd) [0x7f9fce2586dd]
#6  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#7  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1abd1c) [0x7f9fce29fd1c]
#8  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#9  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x12b622) [0x7f9fce21f622]
#10  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x13c8da) [0x7f9fce2308da]
#11  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#12  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x41e1) [0x7f9fce19f3a1]
#13  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7f9fce2d3278]
#14  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6) [0x7f9fce1a0db6]
#15  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7f9fce2d3278]
#16  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1645f9) [0x7f9fce2585f9]
#17  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#18  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1abd1c) [0x7f9fce29fd1c]
#19  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#20  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47) [0x7f9fce2d27a7]
#21  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyInstance_New+0x6c) [0x7f9fce28570c]
#22  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#23  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x41e1) [0x7f9fce19f3a1]
#24  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7f9fce2d3278]
#25  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5bf6) [0x7f9fce1a0db6]
#26  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8) [0x7f9fce2d3278]
#27  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1645f9) [0x7f9fce2585f9]
#28  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#29  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1abd1c) [0x7f9fce29fd1c]
#30  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x43) [0x7f9fce148333]
#31  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47) [0x7f9fce2d27a7]
#32  /usr/lib/freecad-daily/lib/libFreeCADBase.so(PP_Run_Method+0xe7) [0x7f9fce7b7f97]
#33  0x7f9fce72a679 in Base::InterpreterSingleton::runMethodVoid(_object*, char const*) from /usr/lib/freecad-daily/lib/libFreeCADBase.so+0x29
#34  0x7f9fcf374d50 in Gui::PythonCommand::activated(int) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x90
#35  0x7f9fcf3786eb in Gui::Command::invoke(int) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x7b
#36  0x7f9fcd0abf70 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x4d0
#37  0x7f9fcd5bddc2 in QAction::triggered(bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x42
#38  0x7f9fcd5bf113 in QAction::activate(QAction::ActionEvent) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x83
#39  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x5a0fa3) [0x7f9fcd99ffa3]
#40  0x7f9fcd9a00f4 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x74
#41  0x7f9fcda660aa in QToolButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0xa
#42  0x7f9fcd61a930 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x2a0
#43  0x7f9fcd5c403c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x8c
#44  0x7f9fcd5cb136 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x476
#45  0x7f9fcf34bbc8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x88
#46  0x7f9fcd0978ad in QCoreApplication::notifyInternal(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x8d
#47  0x7f9fcd5ca73d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x14d
#48  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x249452) [0x7f9fcd648452]
#49  0x7f9fcd647ce3 in QApplication::x11ProcessEvent(_XEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x16b3
#50  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272592) [0x7f9fcd671592]
#51  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7f9fc5e5e387]
#52  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c5c0) [0x7f9fc5e5e5c0]
#53  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f9fc5e5e64c]
#54  0x7f9fcd0c820e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x7e
#55  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x272666) [0x7f9fcd671666]
#56  0x7f9fcd09612f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x3f
#57  0x7f9fcd096495 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x1b5
#58  0x7f9fcd09c459 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x99
#59  0x7f9fcf2d817a in Gui::Application::runApplication() from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x16ba
#60  freecad-daily(main+0x6db) [0x560a2cbbc41b]
#61  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f9fcc59cb97]
#62  freecad-daily(_start+0x2a) [0x560a2cbbd5ca]
[/code]

Does someone have any idea on how to fix it?
leoheck
Posts: 12
Joined: Tue Mar 13, 2018 5:56 pm

Re: Assembly2 Segfault when Importing a part

Postby leoheck » Tue Nov 20, 2018 8:52 pm

Alright, found this: https://forum.freecadweb.org/viewtopic.php?t=26940

This actually this workaround just fixed the problem. But I still don't know the implications on my system.

Code: Select all

wget http://security.ubuntu.com/ubuntu/pool/main/e/expat/libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/e/expat/libexpat1_2.1.0-7ubuntu0.16.04.3_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/e/expat/libexpat1_2.1.0-7ubuntu0.16.04.3_i386.deb
wget http://security.ubuntu.com/ubuntu/pool/main/e/expat/libexpat1-dev_2.1.0-7ubuntu0.16.04.3_i386.deb
sudo dpkg -i *.deb
rpoisel
Posts: 12
Joined: Sat Jan 06, 2018 9:58 am

Re: Assembly2 Segfault when Importing a part

Postby rpoisel » Wed Dec 05, 2018 11:24 pm

Hi,

my "workaround" to this problem was to use something different than Assembly2.

Maybe A2plus is something for you: Appart from not causing the aforementioned SEGFAULT, A2plus seams to be superior to Assembly2 (more types of constraints, better solving, ...).