0.18.4 crash with gdb trace

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

0.18.4 crash with gdb trace

Post by Hermit » Fri Aug 21, 2020 11:52 pm

This is a fresh build of 0.18.4 on Fedora 31. I'm using python 3.7m. I get the following error when I try to:

1) Create a new document, give it a name and save as..
2) Create a new active PartBody.
3) Create a new Sketch on the XY plane.

FreeCAD will crash immediately.

So, looks like an error or incompatibility with one of the Part WB python scripts. Is it possible to obtain a Python stack trace before segfault occurs? Take a look:

Code: Select all

** (FreeCAD:93531): WARNING **: 16:08:19.137: invalid source position for vertical gradient
[Thread 0x7fff838bc700 (LWP 93563) exited]
Show.TempoVis.isIn3DView error: 'NoneType' object has no attribute 'getTail'Show.TempoVis.isIn3DView error: 'NoneType' object has no attribute 'getTail'
Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee878c40 (LWP 93531)]
0x00007ffff5f8fecf in SoState::getElement(int) () from /lib64/libCoin.so.80
Missing separate debuginfos, use: dnf debuginfo-install Coin3-3.1.3-25.fc31.x86_64 OCE-foundation-0.18.3-7.fc31.x86_64 OCE-modeling-0.18.3-7.fc31.x86_64 OCE-ocaf-0.18.3-7.fc31.x86_64 OCE-visualization-0.18.3-7.fc31.x86_64 cairo-gobject-1.16.0-7.fc31.x86_64 libcroco-0.6.13-2.fc31.x86_64 libgfortran-9.3.1-2.fc31.x86_64 librsvg2-2.46.4-1.fc31.x86_64 python3-numpy-1.17.4-2.fc31.x86_64 python3-pivy-0.6.5-0.2.fc31.x86_64 tbb-2020.1-1.fc31.x86_64
(gdb) bt
#0  0x00007ffff5f8fecf in SoState::getElement(int) () at /lib64/libCoin.so.80
#1  0x00007ffff5ea6a8c in SoInt32Element::set(int, SoState*, SoNode*, int) () at /lib64/libCoin.so.80
#2  0x00007ffff5fe3eee in SoSwitch::doAction(SoAction*) () at /lib64/libCoin.so.80
#3  0x00007ffff5de5837 in SoAction::traverse(SoNode*) () at /lib64/libCoin.so.80
#4  0x00007ffff5f7ba38 in SoChildList::traverse(SoAction*, int, int) () at /lib64/libCoin.so.80
#5  0x00007ffff5fc6b5c in SoGroup::doAction(SoAction*) () at /lib64/libCoin.so.80
#6  0x00007ffff5fe076c in SoSeparator::doAction(SoAction*) () at /lib64/libCoin.so.80
#7  0x00007ffff5de5837 in SoAction::traverse(SoNode*) () at /lib64/libCoin.so.80
#8  0x00007ffff5df56a4 in SoSearchAction::beginTraversal(SoNode*) () at /lib64/libCoin.so.80
#9  0x00007ffff5de5cda in SoAction::apply(SoNode*) () at /lib64/libCoin.so.80
#10 0x00007ffff7704709 in Gui::View3DInventorViewer::searchNode(SoNode*) const () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#11 0x00007ffff74a3404 in Gui::Document::getViewOfNode(SoNode*) const () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#12 0x00007fff4fedd01e in SketcherGui::ViewProviderSketch::getScaleFactor() () at /home/joya/devtree/FreeCAD/Mod/Sketcher/SketcherGui.so
#13 0x00007fff4fee03ec in SketcherGui::ViewProviderSketch::combineConstraintIcons(std::vector<SketcherGui::ViewProviderSketch::constrIconQueueItem, std::allocator<SketcherGui::ViewProviderSketch::constrIconQueueItem> >) () at /home/joya/devtree/FreeCAD/Mod/Sketcher/SketcherGui.so
#14 0x00007fff4fedb72b in SketcherGui::ViewProviderSketch::drawConstraintIcons() () at /home/joya/devtree/FreeCAD/Mod/Sketcher/SketcherGui.so
#15 0x00007fff4fed7eeb in SketcherGui::ViewProviderSketch::draw(bool, bool) () at /home/joya/devtree/FreeCAD/Mod/Sketcher/SketcherGui.so
#16 0x00007fff4fee597c in SketcherGui::ViewProviderSketch::setEdit(int) () at /home/joya/devtree/FreeCAD/Mod/Sketcher/SketcherGui.so
#17 0x00007ffff7732061 in Gui::ViewProvider::startEditing(int) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#18 0x00007ffff7704ce6 in Gui::View3DInventorViewer::setEditingViewProvider(Gui::ViewProvider*, int) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#19 0x00007ffff749debe in Gui::Document::setEdit(Gui::ViewProvider*, int) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#20 0x00007ffff74c0bee in Gui::DocumentPy::setEdit(_object*) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#21 0x00007ffff74bcb41 in Gui::DocumentPy::staticCallback_setEdit(_object*, _object*) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#22 0x00007ffff68c285e in _PyMethodDef_RawFastCallKeywords () at /lib64/libpython3.7m.so.1.0
#23 0x00007ffff68c2993 in _PyCFunction_FastCallKeywords () at /lib64/libpython3.7m.so.1.0
#24 0x00007ffff68f6443 in call_function () at /lib64/libpython3.7m.so.1.0
#25 0x00007ffff6931d6a in _PyEval_EvalFrameDefault () at /lib64/libpython3.7m.so.1.0
#26 0x00007ffff68e31b0 in _PyEval_EvalCodeWithName () at /lib64/libpython3.7m.so.1.0
#27 0x00007ffff68e3f59 in PyEval_EvalCodeEx () at /lib64/libpython3.7m.so.1.0
#28 0x00007ffff6973e5b in PyEval_EvalCode () at /lib64/libpython3.7m.so.1.0
#29 0x00007ffff69b4e43 in run_mod () at /lib64/libpython3.7m.so.1.0
#30 0x00007ffff69b4edd in PyRun_StringFlags () at /lib64/libpython3.7m.so.1.0
#31 0x00007ffff6c1ca15 in Base::InterpreterSingleton::runString[abi:cxx11](char const*) () at /home/joya/devtree/FreeCAD/lib/libFreeCADBase.so
#32 0x00007ffff74f959f in Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#33 0x00007fff501c1dac in CmdPartDesignNewSketch::activated(int)::$_1::operator()(std::vector<App::DocumentObject*, std::allocator<App::DocumentObject*> > const&) const ()
    at /home/joya/devtree/FreeCAD/Mod/PartDesign/PartDesignGui.so
#34 0x00007fff501f3a0c in boost::function1<void, std::vector<App::DocumentObject*, std::allocator<App::DocumentObject*> > >::operator()(std::vector<App::DocumentObject*, std::allocator<App::DocumentObject*> >) const () at /home/joya/devtree/FreeCAD/Mod/PartDesign/PartDesignGui.so
#35 0x00007fff501f26bf in PartDesignGui::TaskDlgFeaturePick::~TaskDlgFeaturePick() () at /home/joya/devtree/FreeCAD/Mod/PartDesign/PartDesignGui.so
#36 0x00007fff501f28c9 in PartDesignGui::TaskDlgFeaturePick::~TaskDlgFeaturePick() () at /home/joya/devtree/FreeCAD/Mod/PartDesign/PartDesignGui.so
#37 0x00007ffff76be7fc in Gui::TaskView::TaskView::removeDialog() () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#38 0x00007ffff76beaed in Gui::TaskView::TaskView::accept() () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#39 0x00007ffff246f9d6 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /lib64/libQtCore.so.4
#40 0x00007ffff246f9d6 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /lib64/libQtCore.so.4
#41 0x00007ffff30a31e6 in QAbstractButton::clicked(bool) () at /lib64/libQtGui.so.4
#42 0x00007ffff2de21f9 in QAbstractButtonPrivate::emitClicked() () at /lib64/libQtGui.so.4
#43 0x00007ffff2de370a in QAbstractButtonPrivate::click() () at /lib64/libQtGui.so.4
#44 0x00007ffff2de37f8 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /lib64/libQtGui.so.4
#45 0x00007ffff2a7daa6 in QWidget::event(QEvent*) () at /lib64/libQtGui.so.4
#46 0x00007ffff2a28301 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#47 0x00007ffff2a2fef4 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#48 0x00007ffff74d59f8 in Gui::GUIApplication::notify(QObject*, QEvent*) () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#49 0x00007ffff245b29f in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /lib64/libQtCore.so.4
#50 0x00007ffff2a2e6a5 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /lib64/libQtGui.so.4
#51 0x00007ffff2aa52c0 in QETWidget::translateMouseEvent(_XEvent const*) () at /lib64/libQtGui.so.4
#52 0x00007ffff2aa41c9 in QApplication::x11ProcessEvent(_XEvent*) () at /lib64/libQtGui.so.4
#53 0x00007ffff2acb18f in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQtGui.so.4
#54 0x00007fffef063570 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#55 0x00007fffef063900 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#56 0x00007fffef0639a3 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#57 0x00007ffff2489276 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#58 0x00007ffff2acb32b in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtGui.so.4
#59 0x00007ffff2459a73 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#60 0x00007ffff2459d86 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#61 0x00007ffff245f1ce in QCoreApplication::exec() () at /lib64/libQtCore.so.4
#62 0x00007ffff7447cd7 in Gui::Application::runApplication() () at /home/joya/devtree/FreeCAD/lib/libFreeCADGui.so
#63 0x0000000000403e56 in main ()
Maybe a related question would be: what is the best version of Python 3 to use with 0.18.4.

Edit: This issue and stacktrace is tracked here, and here as a problem with FreeCAD 0.18.4 on recent versions of Fedora. This is why they offer 0.18.3 in their repository. I have not seen a fix for 0.18.4 offered as of Aug2020.
Last edited by Hermit on Sun Aug 23, 2020 6:51 pm, edited 1 time in total.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: 0.18.4 crash with gdb trace

Post by vocx » Sat Aug 22, 2020 12:59 am

Hermit wrote:
Fri Aug 21, 2020 11:52 pm
This is a fresh build of 0.18.4 on Fedora 31. I'm using python 3.7m. I get the following error when I try to:
...Coin3-3.1.3-25.fc31.x86_64 OCE-foundation-0.18.3-7.fc31.x86_64...
You are using Coin 3.1.x which is an old version of Coin. You also are using OCE which is the community edition of OpenCASCADE, based on an old 6.9.x version. If you are using the packages from your distribution's repository you are probably getting old packages; you should get newer packages or compile the newer versions from source.

I don't know Fedora, but I hear about this COPR with nightly builds?

Anyway, you should be using Coin 4.0.0 and OCCT (official), 7.3 or 7.4.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

Re: 0.18.4 crash with gdb trace

Post by Hermit » Sat Aug 22, 2020 1:10 am

Thank you for your reply. And if I want to try to build 0.19-pre where is the best place to find the exact versions for the dependencies?
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

Re: 0.18.4 crash with gdb trace

Post by Hermit » Sat Aug 22, 2020 1:12 am

Also, I have Coin4 installed but it seems that the 0.18.4 build system always finds Coin3.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: 0.18.4 crash with gdb trace

Post by vocx » Sat Aug 22, 2020 1:20 am

Hermit wrote:
Sat Aug 22, 2020 1:10 am
... best place to find the exact versions for the dependencies?
This doesn't exist. In Linux, usually using the latest available packages works best, with certain exceptions.

Compile on Linux describes the process quite well, particularly for Debian and Ubuntu, as many people here in the forum use these distributions. In order to improve the situation for Fedora, Fedora users need to do more work to keep their packages and documentation up to date.

I think an exception of compiling FreeCAD with the latest package is VTK; I think it doesn't work with the absolute latest, VTK9 or so; and also SMESH (Salome Mesh).
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

Re: 0.18.4 crash with gdb trace

Post by Hermit » Sat Aug 22, 2020 1:39 am

Yes I am currently broken on some salomemesh header files:

In file included from /home/joya/devtree/FreeCAD/src/3rdParty/salomesmesh/src/MEFISTO2/aptrte.cpp:27:
/home/joya/devtree/FreeCAD/src/3rdParty/salomesmesh/inc/Rn.h:183:10: error: unknown type name 'istream'; did you mean 'std::istream'?
friend istream& operator >>(istream& f, R4 & P)
^~~~~~~
std::istream

...etc.

There is only one version in the Fedora repo (smesh-6.7.5) so I am looking for alternatives. Since it is just namespace qualifiers I might just make the change myself and see what happens.
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

Re: 0.18.4 crash with gdb trace

Post by Hermit » Sat Aug 22, 2020 3:00 am

Unfortunately, migrating to Coin4 and OCCT 7.4 did not solve this problem. I fixed all of the "std::" namespace qualifiers, but I still get the original crash and stack trace above. I still think the PySide/Shiboken interface is to blame; it looks like there is a Python error right before the segfault:

Show.TempoVis.isIn3DView error: 'NoneType' object has no attribute 'getTail'Show.TempoVis.isIn3DView error: 'NoneType' object has no attribute 'getTail'Program received signal SIGSEGV, Segmentation fault.

#0 /lib64/libc.so.6(+0x3c6b0) [0x7f7c89fd76b0]
#1 0x7f7c8e34eecf in SoState::getElement(int) from /lib64/libCoin.so.80+0x15f
#2 0x7f7c8e265a8c in SoInt32Element::set(int, SoState*, SoNode*, int) from /lib64/libCoin.so.80+0x2c
#3 0x7f7c8e3a2eee in SoSwitch::doAction(SoAction*) from /lib64/libCoin.so.80+0x7e
...etc...

The gold part looks like a Python problem but I need to get a Python stack trace to find it. Is there a way?
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: 0.18.4 crash with gdb trace

Post by vocx » Sat Aug 22, 2020 4:04 am

Hermit wrote:
Sat Aug 22, 2020 3:00 am
...

The gold part looks like a Python problem but I need to get a Python stack trace to find it. Is there a way?
Python won't just magically crash. The crash is probably due to Coin, as shown by your trace.

Show.TempoVis.isIn3DView is probably trying to do something with the Coin 3D view, and crashing.

I think Smesh 6.x is too old. The FreeCAD sources include 7.7, but some people were trying to migrate it to 8.3 (1, 2).

I think most people who want to use external SMESH are using this repository, trelau/SMESH, from LaughlinResearch. But there are some standing issues pending with Vtk9 and Netgen 6, I think. The information is somewhere in this forum but I haven't been paying close attention because it doesn't impact me at the moment; it would be more important for those working with meshes, particularly FEM.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Hermit
Posts: 18
Joined: Sat Sep 30, 2017 12:00 am
Location: Victoria, Canada
Contact:

Re: 0.18.4 crash with gdb trace

Post by Hermit » Sat Aug 22, 2020 1:33 pm

The Python message actually seems unrelated to the segfault and I was able to fix it by inserting a proper check for 'None' in a PathWB script. After looking into it I think it's a separate issue.

As for SMESH, the sketch creation / view initialization operation that I'm performing shouldn't invoke it, I will get the new version later.

The Coin segfault happens when the UI generates the command 'Gui.activeDocument().setEdit("Sketch")' on the newly created Sketch object. This is a good place for me to start learning the codebase. I wanted to learn about OpenInventor and OCCT.

This issue was tracked by RedHat/Fedora within the last year and it's why they only ship FreeCAD 0.18.3 for Fedora 31. So if I can fix it, maybe they can update their package.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: 0.18.4 crash with gdb trace

Post by vocx » Sun Aug 23, 2020 3:28 pm

Hermit wrote:
Sat Aug 22, 2020 1:33 pm
...
it's why they only ship FreeCAD 0.18.3 for Fedora 31. So if I can fix it, maybe they can update their package.
There are a few users here who are maintaining this COPR package for Fedora. I think they have packaged FreeCAD v0.19 for all recent versions, Fedora 30, 31, 32, etc., but I'm not entirely sure. Look for Richard Hobbes, and somebody else, Przemo, I think.

So, we know FreeCAD works in Fedora, but perhaps you need the right combination of dependencies and a few tricks.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests