Closed leventelist closed 2 weeks ago
It seems that it is not Assembly specific. It crashes all the time.
Please check out how to report issues which could help us diagnose and fix it.
Macro > Macro recording...
and repeat all steps until the issue occurs.Further analyzing the issue, I discovered it is only present when there is a grounded object in the assembly.
crash.zip Attached is the test case for the crash. I started to build everything from scratch, and it crashed after a while. To reproduce the issue, start adding more joints to the pushbuttons. Please use the assembly.FCStd for test.
@leventelist can you reproduce on latest dev ? (https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds)
Here is some gdb trace...
assembly_new#Distance006 is unconnected to a grounded part so it is ignored.
Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007ffff5936966 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy() () from /usr/local/lib/libFreeCADGui.so
(gdb) where
#0 0x00007ffff5936966 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy() () at /usr/local/lib/libFreeCADGui.so
#1 0x00007ffff5b29f07 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) ()
at /usr/local/lib/libFreeCADGui.so
#2 0x00007fff76d881ef in std::__shared_ptr<Part::TopoShapeCache, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<Part::TopoShapeCache, (__gnu_cxx::_Lock_policy)2> const&) () at /usr/local/lib/Part.so
#3 0x00007fff76d88219 in std::shared_ptr<Part::TopoShapeCache>::operator=(std::shared_ptr<Part::TopoShapeCache> const&) () at /usr/local/lib/Part.so
#4 0x00007fff76d8a4a1 in Part::TopoShape::operator=(Part::TopoShape const&) () at /usr/local/lib/Part.so
#5 0x00007fff76d58398 in Part::TopoShape::TopoShape(Part::TopoShape const&) () at /usr/local/lib/Part.so
#6 0x00007fff0da5e34a in Assembly::AssemblyObject::isFaceType(App::DocumentObject*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, GeomAbs_SurfaceType) () at /usr/local/lib/AssemblyApp.so
#7 0x00007fff0da5eb5f in Assembly::AssemblyObject::getDistanceType(App::DocumentObject*) () at /usr/local/lib/AssemblyApp.so
#8 0x00007fff0da58874 in Assembly::AssemblyObject::makeMbdJointDistance(App::DocumentObject*) () at /usr/local/lib/AssemblyApp.so
#9 0x00007fff0da5837d in Assembly::AssemblyObject::makeMbdJointOfType(App::DocumentObject*, Assembly::JointType) () at /usr/local/lib/AssemblyApp.so
#10 0x00007fff0da5985b in Assembly::AssemblyObject::makeMbdJoint(App::DocumentObject*) () at /usr/local/lib/AssemblyApp.so
#11 0x00007fff0da580bc in Assembly::AssemblyObject::jointParts(std::vector<App::DocumentObject*, std::allocator<App::DocumentObject*> >) ()
at /usr/local/lib/AssemblyApp.so
#12 0x00007fff0da53d19 in Assembly::AssemblyObject::solve(bool, bool) () at /usr/local/lib/AssemblyApp.so
#13 0x00007fff0daabdfe in Assembly::AssemblyObjectPy::solve(_object*) () at /usr/local/lib/AssemblyApp.so
#14 0x00007fff0daaa363 in Assembly::AssemblyObjectPy::staticCallback_solve(_object*, _object*) () at /usr/local/lib/AssemblyApp.so
#15 0x00007ffff25c9bc1 in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#16 0x00007ffff257be8d in _PyObject_MakeTpCall () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#17 0x00007ffff2509c63 in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#18 0x00007ffff266ab6a in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#19 0x00007ffff257ed76 in _PyObject_FastCallDictTstate () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
--Type <RET> for more, q to quit, c to continue without paging--c
#20 0x00007ffff257efa0 in _PyObject_Call_Prepend () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#21 0x00007ffff25f07a6 in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#22 0x00007ffff25e078e in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#23 0x00007ffff257be8d in _PyObject_MakeTpCall () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#24 0x00007ffff2509c63 in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#25 0x00007ffff266ab6a in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#26 0x00007ffff257f6ac in () at /lib/x86_64-linux-gnu/libpython3.11.so.1.0
#27 0x00007ffff2fe4925 in PP_Run_Method () at /usr/local/lib/libFreeCADBase.so
#28 0x00007ffff2efd101 in Base::InterpreterSingleton::runMethodVoid(_object*, char const*) () at /usr/local/lib/libFreeCADBase.so
#29 0x00007ffff5a347e8 in Gui::PythonCommand::activated(int) () at /usr/local/lib/libFreeCADGui.so
#30 0x00007ffff5a2f268 in Gui::Command::_invoke(int, bool) () at /usr/local/lib/libFreeCADGui.so
#31 0x00007ffff5a2efc8 in Gui::Command::invoke(int, Gui::Command::TriggerSource) () at /usr/local/lib/libFreeCADGui.so
#32 0x00007ffff5a19ce6 in Gui::Action::onActivated() () at /usr/local/lib/libFreeCADGui.so
#33 0x00007ffff5a28629 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Gui::Action::*)()>::call(void (Gui::Action::*)(), Gui::Action*, void**) () at /usr/local/lib/libFreeCADGui.so
#34 0x00007ffff5a27b95 in void QtPrivate::FunctionPointer<void (Gui::Action::*)()>::call<QtPrivate::List<>, void>(void (Gui::Action::*)(), Gui::Action*, void**) () at /usr/local/lib/libFreeCADGui.so
#35 0x00007ffff5a26b6b in QtPrivate::QSlotObject<void (Gui::Action::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) () at /usr/local/lib/libFreeCADGui.so
#36 0x00007ffff10e8f8f in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007ffff1d5c782 in QAction::triggered(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007ffff1d5f3ab in QAction::activate(QAction::ActionEvent) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007ffff1e56e8a in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#40 0x00007ffff1e56fd7 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#41 0x00007ffff1f4faaa in QToolButton::mouseReleaseEvent(QMouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#42 0x00007ffff1da4db8 in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#43 0x00007ffff1d62fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#44 0x00007ffff1d6b552 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#45 0x00007ffff59d07d4 in Gui::GUIApplication::notify(QObject*, QEvent*) () at /usr/local/lib/libFreeCADGui.so
#46 0x00007ffff10b1738 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#47 0x00007ffff1d6965e in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#48 0x00007ffff1dbdbd8 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#49 0x00007ffff1dc0f60 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#50 0x00007ffff1d62fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#51 0x00007ffff59d07d4 in Gui::GUIApplication::notify(QObject*, QEvent*) () at /usr/local/lib/libFreeCADGui.so
#52 0x00007ffff10b1738 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#53 0x00007ffff153d42d in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#54 0x00007ffff1511cec in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#55 0x00007fffeb74eeca in () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#56 0x00007fffef31e7a9 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#57 0x00007fffef31ea38 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#58 0x00007fffef31eacc in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#59 0x00007ffff1109876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#60 0x00007ffff10b01bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#61 0x00007ffff10b8316 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#62 0x00007ffff586e3da in (anonymous namespace)::tryRunEventLoop(Gui::GUISingleApplication&) () at /usr/local/lib/libFreeCADGui.so
#63 0x00007ffff586e68f in (anonymous namespace)::runEventLoop(Gui::GUISingleApplication&) () at /usr/local/lib/libFreeCADGui.so
#64 0x00007ffff586e96c in Gui::Application::runApplication() () at /usr/local/lib/libFreeCADGui.so
#65 0x0000555555581683 in main ()
@luzpaz I try it. Compiling the latest main.
@luzpaz I can confirm, that the same issue happens with latest main. 1.0rc1-285-ga9bff78974
OS: Debian GNU/Linux 12 (bookworm) (XFCE/lightdm-xsession) Word size of FreeCAD: 64-bit Version: 1.1.0dev.30133 Build type: Unknown Python 3.11.2, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3 Locale: English/United States (en_US) Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Qt default Installed mods:
I cannot get it to crash. Can you record a macro or screencast of what you are doing? @PaddleStroke FYI
https://github.com/user-attachments/assets/b787eafb-7f27-425d-9264-41d87299f6ed
I falsely enable A2P, but when I select the assembly, the right WB is selected.
This is how I configure FreeCAD:
cmake ../ -DFREECAD_QT_VERSION:=5 -DBUILD_DESIGNER_PLUGIN:=ON -DPYTHON_EXECUTABLE=/usr/bin/python3
could you try it with the weekly builds: https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds
I tested it yesterday on this commit: 1.0rc1-285-ga9bff78974, and it still had that bug.
An aside, @leventelist can you put your backtraces in triple back-tick code blocks. This way you aren't triggering links to non-relevant tickets when you paste backtraces. TIA
I cannot reproduce the bug. However looking at the trace the problem seems to come fromAssemblyObject::isFaceType
I think perhaps the problem came from the use of static_cast to Part::Feature
.
Which is coincidentally fixed in the PR https://github.com/FreeCAD/FreeCAD/pull/17205 @leventelist can you try this PR and feedback if it still crashes? Alternatively if you can't build this PR can you try after this PR merges?
As a side note, when filling a bug report, could you please post a minimal example and clear reproduction steps? ie clear the document to remove as much as possible to keep only the minimum objects that trigger the problem. This way it is easier to reproduce and fix.
I have just tested your file again after building out of https://github.com/FreeCAD/FreeCAD/pull/17205, and opening the file and calling a solve of your assembly does crash freecad.
So it looks like this bug is fixed by https://github.com/FreeCAD/FreeCAD/pull/17205.
Is there an existing issue for this?
Problem description
When creating a distance joint, I get segfault.
Full version info
Subproject(s) affected?
Assembly
Anything else?
No response
Code of Conduct