Bug 271083 - cad/freecad: Transform causes FreeCAD to crash
Summary: cad/freecad: Transform causes FreeCAD to crash
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-26 16:44 UTC by denverh
Modified: 2024-07-21 14:15 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (cmt)


Attachments
Patch to resolve crash after transform (1.12 KB, patch)
2023-11-14 15:41 UTC, Jason W. Bacon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description denverh 2023-04-26 16:44:11 UTC
FreeCAD-0.20.2_1
13.1-RELEASE-p6

Transform operation causes memory fault.  This happens with FreeCAD built from ports or installed with pkg.  Same with libCoin.  Transforms using an object's data properties directly do not do this.

In a new project, use the Part workbench to create a primitive object, like a sphere or a cube.  Right click on the object in the Combo View and select Transform.  Move or rotate the object a bit then either click the OK button or hit escape.  This always results in a Memory Fault.

GDB says this:
Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x0000000803436310 in SoCallbackAction::~SoCallbackAction() () from /usr/local/lib/libCoin.so.80

I can supply BT output if necessary, but there's a lot of it.  Hopefully this isn't unique to my system, but I don't have another one running right now that I can try this on.
Comment 1 Sergiy 2023-04-27 20:16:41 UTC
(In reply to denverh from comment #0)
> Hopefully this isn't unique to my system, but I don't have another one running right now that I can try this on.

I had FreeCAD installed and tried this.
I have a problem too.

$ freebsd-version -kru
13.1-RELEASE-p6
13.1-RELEASE-p6
13.1-RELEASE-p7

FreeCAD-0.20.2_1
Comment 2 Stephen Hurd freebsd_committer freebsd_triage 2023-05-12 01:12:54 UTC
Crash occurs in FreeCAD-0.20.2_3 on 12.4-RELEASE-p2 as well.
Comment 3 Neal Nelson 2023-08-14 08:04:15 UTC
This problem seems to have been fixed in 0.21.0.
Comment 4 denverh 2023-08-19 20:39:09 UTC
Still happens on my system:
13.2-RELEASE-p2
FreeCAD-0.21.0
Comment 5 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-12 15:02:11 UTC
Same happens to me with 0.21.1_1 on 13.2-RELEASE.

Seems to be a known issue upstream:

https://forum.freecad.org/viewtopic.php?t=78077
Comment 6 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-13 01:16:21 UTC
Looks like there have been issues in the past on Mac due to libcoin 4.0.0.  It might be worth trying an older coin version as a diagnostic.

lldb -c FreeCAD.core FreeCAD
(lldb) target create "FreeCAD" --core "FreeCAD.core"
Core file '/home/bacon/FreeCAD.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'FreeCAD', stop reason = signal SIGSEGV
  * frame #0: 0x000000082d839db0 libCoin.so.80`SoCallbackAction::~SoCallbackAction() + 144
    frame #1: 0x000000082d839f0e libCoin.so.80`SoCallbackAction::~SoCallbackAction() + 14
    frame #2: 0x000000082dac7956 libCoin.so.80`SoDragger::~SoDragger() + 198
    frame #3: 0x0000000828615c3e libFreeCADGui.so`Gui::RDragger::~RDragger() + 14
    frame #4: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #5: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #6: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #7: 0x000000082da33dd9 libCoin.so.80`SoGroup::~SoGroup() + 41
    frame #8: 0x000000082da4df7e libCoin.so.80`SoSeparator::~SoSeparator() + 14
    frame #9: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #10: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #11: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #12: 0x000000082da33dd9 libCoin.so.80`SoGroup::~SoGroup() + 41
    frame #13: 0x000000082da51efe libCoin.so.80`SoSwitch::~SoSwitch() + 14
    frame #14: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #15: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #16: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #17: 0x000000082da33dd9 libCoin.so.80`SoGroup::~SoGroup() + 41
    frame #18: 0x000000082da1dd1e libCoin.so.80`SoAnnotation::~SoAnnotation() + 14
    frame #19: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #20: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #21: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #22: 0x000000082da33dd9 libCoin.so.80`SoGroup::~SoGroup() + 41
    frame #23: 0x000000082da4df7e libCoin.so.80`SoSeparator::~SoSeparator() + 14
    frame #24: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #25: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #26: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #27: 0x000000082da33dd9 libCoin.so.80`SoGroup::~SoGroup() + 41
    frame #28: 0x000000082da4df7e libCoin.so.80`SoSeparator::~SoSeparator() + 14
    frame #29: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #30: 0x000000082da0830c libCoin.so.80`SoBaseList::truncate(int) + 76
    frame #31: 0x000000082d965e11 libCoin.so.80`SoChildList::~SoChildList() + 17
    frame #32: 0x000000082da0e7b9 libCoin.so.80`SoBaseKit::~SoBaseKit() + 41
    frame #33: 0x000000082861be4e libFreeCADGui.so`Gui::SoFCCSysDragger::~SoFCCSysDragger() + 14
    frame #34: 0x000000082d961b2e libCoin.so.80`SoBase::destroy() + 174
    frame #35: 0x0000000828469774 libFreeCADGui.so`Gui::TaskCSysDragger::~TaskCSysDragger() + 36
    frame #36: 0x000000082846980e libFreeCADGui.so`Gui::TaskCSysDragger::~TaskCSysDragger() + 14
    frame #37: 0x0000000828671579 libFreeCADGui.so`Gui::TaskView::TaskView::removeDialog() + 313
    frame #38: 0x0000000828671bed libFreeCADGui.so`Gui::TaskView::TaskView::accept() + 205
    frame #39: 0x0000000838862c73 libQt5Core.so.5`___lldb_unnamed_symbol9680 + 1075
    frame #40: 0x0000000836c25685 libQt5Widgets.so.5`___lldb_unnamed_symbol15883 + 197
    frame #41: 0x0000000838862d44 libQt5Core.so.5`___lldb_unnamed_symbol9680 + 1284
    frame #42: 0x0000000836b7c1d2 libQt5Widgets.so.5`___lldb_unnamed_symbol14651 + 114
    frame #43: 0x0000000836b7c049 libQt5Widgets.so.5`___lldb_unnamed_symbol14649 + 233
    frame #44: 0x0000000836b7d062 libQt5Widgets.so.5`QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 290
    frame #45: 0x0000000836ad69c5 libQt5Widgets.so.5`QWidget::event(QEvent*) + 533
    frame #46: 0x0000000836c21216 libQt5Widgets.so.5`QPushButton::event(QEvent*) + 182
    frame #47: 0x0000000836a9d3c9 libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 265
    frame #48: 0x0000000836aa0326 libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 7574
    frame #49: 0x000000082837e97b libFreeCADGui.so`Gui::GUIApplication::notify(QObject*, QEvent*) + 91
    frame #50: 0x000000083882e97d libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 173
    frame #51: 0x0000000836a9dd3e libQt5Widgets.so.5`QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 942
    frame #52: 0x0000000836af44c5 libQt5Widgets.so.5`___lldb_unnamed_symbol14078 + 2117
    frame #53: 0x0000000836af3381 libQt5Widgets.so.5`___lldb_unnamed_symbol14072 + 225
    frame #54: 0x0000000836a9d3c9 libQt5Widgets.so.5`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 265
    frame #55: 0x0000000836a9e7a5 libQt5Widgets.so.5`QApplication::notify(QObject*, QEvent*) + 533
    frame #56: 0x000000082837e97b libFreeCADGui.so`Gui::GUIApplication::notify(QObject*, QEvent*) + 91
    frame #57: 0x000000083882e97d libQt5Core.so.5`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 173
    frame #58: 0x00000008346bb713 libQt5Gui.so.5`QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 3331
    frame #59: 0x000000083469f3ac libQt5Gui.so.5`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 220
    frame #60: 0x000000086c005ef9 libQt5XcbQpa.so.5`___lldb_unnamed_symbol3540 + 41
    frame #61: 0x000000083882b2a6 libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 566
    frame #62: 0x000000083882f01e libQt5Core.so.5`QCoreApplication::exec() + 142
    frame #63: 0x00000008282b5421 libFreeCADGui.so`Gui::Application::runApplication() + 13185
    frame #64: 0x000000000020ca9e FreeCAD`___lldb_unnamed_symbol303 + 5614
    frame #65: 0x000000000020b2c0 FreeCAD`___lldb_unnamed_symbol310 + 256
Comment 7 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-13 14:55:53 UTC
I just verified that using the latest commit of Coin does not help:

https://github.com/outpaddling/freebsd-ports-wip/tree/master/Coin
Comment 8 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-14 15:41:32 UTC
Created attachment 246309 [details]
Patch to resolve crash after transform

Problem solved with some help from the FreeCAD forum.

https://forum.freecad.org/viewtopic.php?p=718951#p718951
Comment 9 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-14 15:46:27 UTC
An updated port with the patch and some other minor clean-up is here:

https://github.com/outpaddling/freebsd-ports-wip/tree/master/freecad
Comment 10 Jason W. Bacon freebsd_committer freebsd_triage 2023-11-20 12:28:14 UTC
(In reply to Jason W. Bacon from comment #9)

Regarding the WIP port:

I added some missing dependencies, like mpich, which the build picks up if present, leading to stage-qa warnings.  Not sure how important MPI is, so maybe this could be made an option?

Also removed a couple dependencies that are no longer needed.

There are still some stage-qa warnings, but they appear to be spurious.

It has been poudriere-tested on 12.4, 13.2, and 14.0.
Comment 11 Jason W. Bacon freebsd_committer freebsd_triage 2024-07-21 14:15:49 UTC
This does not seem to be an issue with the latest port, so closing. Feel free to reopen if the problem recurs.