Ticket #4431 - Crash after editing Part Design feature links with DAGView active

Discussion about the development of the Assembly workbench.
User avatar
Gregory son of Carl
Posts: 99
Joined: Mon Apr 06, 2020 7:42 pm
Location: California

Ticket #4431 - Crash after editing Part Design feature links with DAGView active

Postby Gregory son of Carl » Sat Sep 05, 2020 2:49 am

I've been having issues only recently where FreeCAD crashes after editing Part Design elements, but only when in context as linked objects.
I have no problems when editing the source file directly or even when editing the linked element through the Properties panel. The crash only occurs after closing the task panel for a linked part design element such as editing a sketch. This is true both when confirming and cancelling changes.

I appreciate any suggestions.


Here's my info and console output:

OS: Debian GNU/Linux 10 (buster) (KDE/default)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git) AppImage
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

Code: Select all

gregory@gerg:~/FreeCAD_Projects/FreeCAD_Builds$ ./FreeCAD_0.19-22284-Linux-Conda_glibc2.12-x86_64.AppImage 
FreeCAD 0.19, Libs: 0.19R22284 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Loading Assembly4 WorkBench
Sheet Metal workbench loaded
During initialization the error "'backend.qt4 is not a valid rc parameter (see rcParams.keys() for a list of valid parameters)'" occurred in /home/gregory/.FreeCAD/Mod/animation/InitGui.py
Please look into the log file for further information
During initialization the error "inconsistent use of tabs and spaces in indentation (<string>, line 48)" occurred in /home/gregory/.FreeCAD/Mod/GDT/InitGui.py
Please look into the log file for further information
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7fd13613f840]
#1  0x7fd138ba2f54 in Gui::DAG::Model::slotResetEdit(Gui::ViewProviderDocumentObject const&) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x44
#2  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so(+0x382d1c) [0x7fd13892ad1c]
#3  0x7fd138981c35 in Gui::Document::_resetEdit() from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x1f5
#4  0x7fd13891022a in Gui::Application::setEditDocument(Gui::Document*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x3a
#5  0x7fd13899177c in Gui::DocumentPy::resetEdit(_object*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x2c
#6  0x7fd1389917c4 in Gui::DocumentPy::staticCallback_resetEdit(_object*, _object*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x24
#7  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(PyCFunction_Call+0xf7) [0x7fd138393d87]
#8  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(_PyObject_MakeTpCall+0x250) [0x7fd138348850]
#9  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4e36) [0x7fd1383d77d6]
#10  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x2e2) [0x7fd138344f92]
#11  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(PyEval_EvalCodeEx+0x44) [0x7fd138345d54]
#12  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(PyEval_EvalCode+0x1c) [0x7fd1383fb6ac]
#13  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(+0x219ecf) [0x7fd138419ecf]
#14  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(+0x252b84) [0x7fd138452b84]
#15  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libpython3.8.so.1.0(PyRun_StringFlags+0x7d) [0x7fd138452c1d]
#16  0x7fd137c4d2ba in Base::InterpreterSingleton::runString[abi:cxx11](char const*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADBase.so+0x6a
#17  0x7fd1389ec3b8 in Gui::Command::_runCommand(char const*, int, Gui::Command::DoCmd_Type, char const*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x98
#18  0x7fd1389ec5a2 in Gui::Command::_doCommand(char const*, int, Gui::Command::DoCmd_Type, char const*, ...) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x102
#19  0x7fd04a7a9e35 in PartDesignGui::TaskDlgFeatureParameters::reject() from /tmp/.mount_FreeCAbs6iBc/usr/lib/PartDesignGui.so+0x105
#20  0x7fd04a7aeaa1 in PartDesignGui::TaskDlgSketchBasedParameters::reject() from /tmp/.mount_FreeCAbs6iBc/usr/lib/PartDesignGui.so+0x31
#21  0x7fd138c85819 in Gui::TaskView::TaskView::reject() from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x59
#22  0x7fd1366867b8 in QMetaObject::activate(QObject*, int, int, void**) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x780
#23  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5(+0x274bbb) [0x7fd136f9cbbb]
#24  0x7fd1366867b8 in QMetaObject::activate(QObject*, int, int, void**) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x780
#25  0x7fd136f351fe in QAbstractButton::clicked(bool) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0x32
#26  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5(+0x20d8b7) [0x7fd136f358b7]
#27  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5(+0x20e14c) [0x7fd136f3614c]
#28  0x7fd136f361e8 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0x88
#29  0x7fd136ec7c3e in QWidget::event(QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0xce
#30  0x7fd136e9c82a in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0xde
#31  0x7fd136ea1095 in QApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0x79d
#32  0x7fd1389baab9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x89
#33  0x7fd136670186 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x88
#34  0x7fd136ea053f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0x283
#35  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5(+0x1af554) [0x7fd136ed7554]
#36  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5(+0x1b03a6) [0x7fd136ed83a6]
#37  0x7fd136e9c82a in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0xde
#38  0x7fd136ea23f1 in QApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Widgets.so.5+0x1af9
#39  0x7fd1389baab9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x89
#40  0x7fd136670186 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x88
#41  0x7fd136a1640b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Gui.so.5+0x6d3
#42  0x7fd136a16ff7 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Gui.so.5+0x175
#43  0x7fd136a03dd4 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Gui.so.5+0x64
#44  /tmp/.mount_FreeCAbs6iBc/usr/plugins/platforms/../../lib/libQt5XcbQpa.so.5(+0x5af0e) [0x7fd132402f0e]
#45  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/./libglib-2.0.so.0(g_main_context_dispatch+0x2cb) [0x7fd13364cb3b]
#46  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/./libglib-2.0.so.0(+0x54d81) [0x7fd13364cd81]
#47  /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/./libglib-2.0.so.0(g_main_context_iteration+0x2e) [0x7fd13364ce0e]
#48  0x7fd13669f42b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x63
#49  0x7fd13666cbc1 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x187
#50  0x7fd136670a39 in QCoreApplication::exec() from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libQt5Core.so.5+0x105
#51  0x7fd138932ca2 in Gui::Application::runApplication() from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x15a2
#52  /tmp/.mount_FreeCAbs6iBc/usr/bin/freecad(+0x37cd) [0x560a04df97cd]
#53  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7fd13612c09b]
#54  /tmp/.mount_FreeCAbs6iBc/usr/bin/freecad(+0x4521) [0x560a04dfa521]
Last edited by Kunda1 on Thu Sep 10, 2020 2:49 pm, edited 1 time in total.
Reason: Added ticket number to thread title + ticket name
vocx
Posts: 5068
Joined: Thu Oct 18, 2018 9:18 pm

Re: Crash After Editing Linked Part Design Features

Postby vocx » Sat Sep 05, 2020 8:22 pm

Gregory son of Carl wrote:
Sat Sep 05, 2020 2:49 am
I've been having issues only recently where FreeCAD crashes after editing Part Design elements, but only when in context as linked objects...
I'm not following. Are you editing entire PartDesign Bodies, or the features (internal shapes)?

It's hard to see your crash if you don't provide an image of how your tree view looks like, or a test file.
#1 0x7fd138ba2f54 in Gui::DAG::Model::slotResetEdit(Gui::ViewProviderDocumentObject const&) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x44
Are you using the DAG view? If you do, try removing it.
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
Zolko
Posts: 1007
Joined: Mon Dec 17, 2018 10:02 am

Re: Crash After Editing Linked Part Design Features

Postby Zolko » Mon Sep 07, 2020 8:27 am

vocx wrote:
Sat Sep 05, 2020 8:22 pm
Gregory son of Carl wrote:
Sat Sep 05, 2020 2:49 am
#1 0x7fd138ba2f54 in Gui::DAG::Model::slotResetEdit(Gui::ViewProviderDocumentObject const&) from /tmp/.mount_FreeCAbs6iBc/usr/bin/../lib/libFreeCADGui.so+0x44
Are you using the DAG view? If you do, try removing it.
yes, DAG-view crashes FreeCAD a lot
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
vocx
Posts: 5068
Joined: Thu Oct 18, 2018 9:18 pm

Re: Crash After Editing Linked Part Design Features

Postby vocx » Mon Sep 07, 2020 5:19 pm

Zolko wrote:
Mon Sep 07, 2020 8:27 am
yes, DAG-view crashes FreeCAD a lot
I remember some discussion that mentioned that the DAG view hasn't been updated in a while, so it probably cannot handle intricate dependency chains when using App Links. And I haven't heard realthunder particularly address this, so unless somebody does the work, I guess the DAG view will remain like it is right now.
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
Gregory son of Carl
Posts: 99
Joined: Mon Apr 06, 2020 7:42 pm
Location: California

Re: Crash After Editing Linked Part Design Features

Postby Gregory son of Carl » Wed Sep 09, 2020 12:18 am

vocx wrote:
Sat Sep 05, 2020 8:22 pm
Are you using the DAG view? If you do, try removing it.
I was using DAG view, and it looks like removing it did the trick. Thank you!

I'm not following. Are you editing entire PartDesign Bodies, or the features (internal shapes)?

It's hard to see your crash if you don't provide an image of how your tree view looks like, or a test file.
The crash was happening on all PartDesign features that were linked. Here's an example with steps for completeness:
.
  1. Download both attached files into the same folder
  2. Activate DAG view. (Tools> Edit Parameters...> BaseApp> Preferences> DockWindows> DAGView> Enabled=True)
  3. Restart FreeCAD
  4. Open Assembly3Test.FCStd
  5. Double-click the Pad feature in Assembly3Test (shown below)
  6. Click Cancel or OK in the task window.
The crash happens immediately after releasing the mouse button
.
CrashPad.png
CrashPad.png (59.95 KiB) Viewed 245 times
Attachments
Assembly3TestCube2.FCStd
(10.54 KiB) Downloaded 7 times
Assembly3Test.FCStd
(2.71 KiB) Downloaded 7 times
Last edited by Gregory son of Carl on Wed Sep 09, 2020 7:08 pm, edited 1 time in total.
vocx
Posts: 5068
Joined: Thu Oct 18, 2018 9:18 pm

Re: Crash After Editing Linked Part Design Features

Postby vocx » Wed Sep 09, 2020 3:22 am

Gregory son of Carl wrote:
Wed Sep 09, 2020 12:18 am
...
The crash was happening on all PartDesign features that were linked. Here's an example with steps for completeness:
Okay, so I think you are linking the entire Body, but it also shows the individual features as links.

And to reiterate, the DAG view was implemented in the development of v0.17, before App Link was conceived. Since then I think it has only received small changes, so I don't think it works correctly when using Links in your model.
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.
chrisb
Posts: 27297
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash After Editing Linked Part Design Features

Postby chrisb » Wed Sep 09, 2020 5:40 am

I can confirm the bug. I remember realthunder saying quite some time ago that Link isn't implemented on PartDesign features yet. I may have missed the update. But whoever is responsible, Link or DAGView or both, due to the crash it is at the end of this discussion worth a bug report. For the sake of completeness you may add a step 0 to your step by step description:

0) Download both files and put them in the same directory.
User avatar
Gregory son of Carl
Posts: 99
Joined: Mon Apr 06, 2020 7:42 pm
Location: California

Re: Crash After Editing Linked Part Design Features

Postby Gregory son of Carl » Wed Sep 09, 2020 7:10 pm

Bug Report #0004431 submitted.

Instructions also updated