[solved] Weekly 021-31527 TechDraw dimensions cause crashes

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by chrisb »

I'm downloading the current version for retest.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by wandererfan »

FBXL5 wrote: Mon Jan 16, 2023 8:18 am @wandererfan Does this help to track the problem? I used "TechDrawCrash.FCStd" and other files. Same errors, different numbers (0x...)
It is a clue, but not enough information. Have you ever used "lldb"? It is Apple's native debugger. Try the following in a terminal:

Code: Select all

$ lldb /Users/FBXL5/Apps/FreeCAD_021-31598.app/Contents/MacOS/FreeCAD
(lldb) run
<<crash>>
(lldb) bt
bt (backtrace) will tell us what code was executing just before the crash.

There is some background on lldb here:
https://julien.danjou.info/debugging-c-code-on-macoss/
and here
https://developer.apple.com/library/arc ... 17-CH1-SW1
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by FBXL5 »

chrisb wrote: Mon Jan 16, 2023 11:57 am Sorry, I had missed your request. I have no problem to create e.g. this from scratch:
Chris, you cheated! ;) You used version: 0.21.0.31513 (Git). This is the last one that works without problems. Please check one of the newer weekly builds. My problems started with version Version: 0.21.0.31527 and still continues with version Version: 0.21.0.31598 (Git). :(

Edit: Sorry I didn't see your second reply.
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by FBXL5 »

wandererfan wrote: Mon Jan 16, 2023 3:06 pm Have you ever used "lldb"? It is Apple's native debugger.
Not yet. My life was debugger-free until today, but I'm curious if can handle a debugger. :)

Edit: After more than an hour I just can't run FreeCAD but can trigger one error message repeatedly:

Code: Select all

(lldb) file /Users/FBXL5/Apps/FreeCAD_021-31598.app/Contents/MacOS/FreeCAD
error: '/Users/FBXL5/Apps/FreeCAD_021-31598.app/Contents/MacOS/FreeCAD' doesn't contain any 'host' platform architectures: x86_64, i386, x86_64
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by chrisb »

I can confirm the crash. And also the reordering of the dimensioning icons.
I don't like this reordering very much, because adding dimensions is the most frequent action I use in TechDraw workbench. And now it is less smooth to select different kinds of dimensions.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.0.31598 (Git)
Build type: Release
Branch: master
Hash: f7db685a2821adaf23c85a25855401ecc1eeff2c
Python 3.10.8, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * DynamicData 2.46.0
  * freecad.gears 1.0.0
  * FeedsAndSpeeds 0.4.0
  * dxf-library
  * fcgear 1.0.0
  * fasteners 0.4.16
  * sheetmetal 0.2.60
  * ExplodedAssembly
  * Curves 0.6.5
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by FBXL5 »

chrisb wrote: Mon Jan 16, 2023 10:30 pm I don't like this reordering very much, because adding dimensions is the most frequent action I use in TechDraw workbench. And now it is less smooth to select different kinds of dimensions.
+1 - A drawing workbench without working dimensioning tools is quite useless.
chrisb wrote: Mon Jan 16, 2023 10:30 pm I can confirm the crash.
OK, all Mac users involved in this thread confirm the crash but none of the Windows or Linux users; then I dare to say it is a MacOS specific problem.


@wandererfan I'm unable to run the debugger properly since I have no idea how to get past the first error message. :(
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by wandererfan »

chrisb wrote: Mon Jan 16, 2023 10:30 pm
FBXL5 wrote: Tue Jan 17, 2023 10:37 am
I can remove the grouping of the dimension commands.

I don't know what to do about the crash - I do not have a mac environment available. Maybe I'll post something in the Developer's forum asking a mac developer for help.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by chrisb »

@chennes, I remember you have access to a mac for compiling?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by FBXL5 »

I Dunnit! :D

@wandererfan I finaly managed to run the debugger. I hope this will help:

Code: Select all

???@MacBook-Pro bin % lldb FreeCAD
(lldb) target create "FreeCAD"
Current executable set to '/Users/FBXL5/Apps/FreeCAD_021-31598.app/Contents/Resources/bin/FreeCAD' (x86_64).
(lldb) run
Process 41171 launched: '/Users/FBXL5/Apps/FreeCAD_021-31598.app/Contents/Resources/bin/FreeCAD' (x86_64)
FreeCAD 0.21.0, Libs: 0.21.0R31598 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2023
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Sheet Metal workbench loaded
2023-01-17 18:42:06.172380+0100 FreeCAD[41171:2335132] flock failed to lock maps file: errno = 35
2023-01-17 18:42:06.173855+0100 FreeCAD[41171:2335132] flock failed to lock maps file: errno = 35
2023-01-17 18:42:20.928822+0100 FreeCAD[41171:2335775] GVA info: preferred scaler idx 0
[41183:14595:0117/184222.933643:ERROR:command_buffer_proxy_impl.cc(141)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
Populating font family aliases took 443 ms. Replace uses of missing font family "Sans" with one that exists to avoid this cost. 
2023-01-17 18:43:17.797895+0100 FreeCAD[41171:2335075] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=41171
2023-01-17 18:43:17.797996+0100 FreeCAD[41171:2335075] SecTaskCopyDebugDescription: FreeCAD[41171]/0#-1 LF=0
2023-01-17 18:43:45.441304+0100 FreeCAD[41171:2335075] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=41171
2023-01-17 18:43:45.441438+0100 FreeCAD[41171:2335075] SecTaskCopyDebugDescription: FreeCAD[41171]/0#-1 LF=0
View is finding hidden lines
View has finished finding hidden lines
View is extracting faces
View has finished extracting faces
FreeCAD(41171,0x1000d6dc0) malloc: *** error for object 0x11000000017e6300: pointer being freed was not allocated
FreeCAD(41171,0x1000d6dc0) malloc: *** set a breakpoint in malloc_error_break to debug
Process 41171 stopped
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff6ab1532a libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff6ab1532a <+10>: jae    0x7fff6ab15334            ; <+20>
    0x7fff6ab1532c <+12>: movq   %rax, %rdi
    0x7fff6ab1532f <+15>: jmp    0x7fff6ab0f619            ; cerror_nocancel
    0x7fff6ab15334 <+20>: retq   
Target 0: (FreeCAD) stopped.
(lldb) bt
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff6ab1532a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff6abd5e60 libsystem_pthread.dylib`pthread_kill + 430
    frame #2: 0x00007fff6aa9c808 libsystem_c.dylib`abort + 120
    frame #3: 0x00007fff6ab9650b libsystem_malloc.dylib`malloc_vreport + 548
    frame #4: 0x00007fff6ab9940f libsystem_malloc.dylib`malloc_report + 151
    frame #5: 0x00000001c034049c TechDrawGui.so`TechDraw::validateDimSelection(std::__1::vector<TechDraw::ReferenceEntry, std::__1::allocator<TechDraw::ReferenceEntry> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<int, std::__1::allocator<int> >) + 1404
    frame #6: 0x00000001c02f81cc TechDrawGui.so`execDistance(Gui::Command*) + 748
    frame #7: 0x00000001c02f7e4f TechDrawGui.so`CmdTechDrawLinearGroup::activated(int) + 383
    frame #8: 0x0000000100216525 libFreeCADGui.dylib`Gui::Command::_invoke(int, bool) + 613
    frame #9: 0x0000000100216286 libFreeCADGui.dylib`Gui::Command::invoke(int, Gui::Command::TriggerSource) + 342
    frame #10: 0x0000000100207d2c libFreeCADGui.dylib`Gui::ActionGroup::onActivated() + 76
    frame #11: 0x00000001027f7c5a libQt5Core.5.dylib`___lldb_unnamed_symbol5585$$libQt5Core.5.dylib + 907
    frame #12: 0x0000000101dbcd59 libQt5Widgets.5.dylib`QAction::triggered(bool) + 55
    frame #13: 0x0000000101dbcc46 libQt5Widgets.5.dylib`QAction::activate(QAction::ActionEvent) + 190
    frame #14: 0x0000000101e5b8a8 libQt5Widgets.5.dylib`___lldb_unnamed_symbol2524$$libQt5Widgets.5.dylib + 120
    frame #15: 0x0000000101e5c3b7 libQt5Widgets.5.dylib`QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 111
    frame #16: 0x0000000101ef7e5a libQt5Widgets.5.dylib`QToolButton::mouseReleaseEvent(QMouseEvent*) + 10
    frame #17: 0x0000000101de8121 libQt5Widgets.5.dylib`QWidget::event(QEvent*) + 1003
    frame #18: 0x0000000101ef838f libQt5Widgets.5.dylib`QToolButton::event(QEvent*) + 67
    frame #19: 0x0000000101dc2849 libQt5Widgets.5.dylib`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 207
    frame #20: 0x0000000101dc4b3a libQt5Widgets.5.dylib`QApplication::notify(QObject*, QEvent*) + 5782
    frame #21: 0x00000001001de5ea libFreeCADGui.dylib`Gui::GUIApplication::notify(QObject*, QEvent*) + 90
    frame #22: 0x00000001027da2da libQt5Core.5.dylib`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
    frame #23: 0x0000000101dc2f72 libQt5Widgets.5.dylib`QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 698
    frame #24: 0x0000000101df9ca5 libQt5Widgets.5.dylib`___lldb_unnamed_symbol1097$$libQt5Widgets.5.dylib + 1035
    frame #25: 0x0000000101df9182 libQt5Widgets.5.dylib`___lldb_unnamed_symbol1091$$libQt5Widgets.5.dylib + 310
    frame #26: 0x0000000101dc2849 libQt5Widgets.5.dylib`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 207
    frame #27: 0x0000000101dc366e libQt5Widgets.5.dylib`QApplication::notify(QObject*, QEvent*) + 458
    frame #28: 0x00000001001de5ea libFreeCADGui.dylib`Gui::GUIApplication::notify(QObject*, QEvent*) + 90
    frame #29: 0x00000001027da2da libQt5Core.5.dylib`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
    frame #30: 0x00000001022aa397 libQt5Gui.5.dylib`QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 1503
    frame #31: 0x000000010229cada libQt5Gui.5.dylib`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 82
    frame #32: 0x000000010c1f1da9 libqcocoa.dylib`___lldb_unnamed_symbol1044$$libqcocoa.dylib + 35
    frame #33: 0x00007fff30c93b64 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #34: 0x00007fff30c93b03 CoreFoundation`__CFRunLoopDoSource0 + 103
    frame #35: 0x00007fff30c9391d CoreFoundation`__CFRunLoopDoSources0 + 209
    frame #36: 0x00007fff30c92639 CoreFoundation`__CFRunLoopRun + 937
    frame #37: 0x00007fff30c91c33 CoreFoundation`CFRunLoopRunSpecific + 466
    frame #38: 0x00007fff2f8adaad HIToolbox`RunCurrentEventLoopInMode + 292
    frame #39: 0x00007fff2f8ad6e4 HIToolbox`ReceiveNextEventCommon + 359
    frame #40: 0x00007fff2f8ad569 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #41: 0x00007fff2def63c9 AppKit`_DPSNextEvent + 883
    frame #42: 0x00007fff2def4c10 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
    frame #43: 0x00007fff2dee691e AppKit`-[NSApplication run] + 658
    frame #44: 0x000000010c1f107f libqcocoa.dylib`___lldb_unnamed_symbol1019$$libqcocoa.dylib + 1339
    frame #45: 0x00000001027d83c4 libQt5Core.5.dylib`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 264
    frame #46: 0x00000001027da714 libQt5Core.5.dylib`QCoreApplication::exec() + 116
    frame #47: 0x0000000100127b49 libFreeCADGui.dylib`Gui::Application::runApplication() + 11705
    frame #48: 0x0000000100004804 FreeCAD`main + 6164
    frame #49: 0x00007fff6a9cdcc9 libdyld.dylib`start + 1
    frame #50: 0x00007fff6a9cdcc9 libdyld.dylib`start + 1
(lldb) 
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Weekly 021-31527 TechDraw dimensions cause crashes

Post by chennes »

chrisb wrote: Tue Jan 17, 2023 4:39 pm @chennes, I remember you have access to a mac for compiling?
Yep -- it's not crashing on my self-compiled version:

Code: Select all

OS: macOS 13.0
Word size of FreeCAD: 64-bit
Version: 0.21.0.31453 (Git)
Build type: Release
Branch: master
Hash: 3e8dff83dda55391994525bc6afd2525f57423ef
Python 3.10.8, Qt 5.15.7, Coin 4.0.0, Vtk 9.2.2, OCC 7.6.3
Locale: English/United States (en_US)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply