Crash opening file containing PDN hole feature

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
tom
Posts: 65
Joined: Sun Mar 29, 2015 9:20 pm

Crash opening file containing PDN hole feature

Postby tom » Sun Aug 27, 2017 10:32 pm

Hi,

I have a problem opening my latest design, which uses the PDN hole feature. I get following crash when opening the file:

Code: Select all

 lldb /Applications/FreeCAD.app/Contents/MacOS/FreeCAD
(lldb) target create "/Applications/FreeCAD.app/Contents/MacOS/FreeCAD"
Current executable set to '/Applications/FreeCAD.app/Contents/MacOS/FreeCAD' (x86_64).
(lldb) r
Process 23874 launched: '/Applications/FreeCAD.app/Contents/MacOS/FreeCAD' (x86_64)
FreeCAD 0.17, Libs: 0.17R11919 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Fasteners workbench Loaded
Sheet Metal workbench loaded
Process 23874 stopped
* thread #1: tid = 0x284b45, 0x00007fff962e9132 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00007fff962e9132 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
->  0x7fff962e9132 <+18>: pcmpeqb (%rdi), %xmm0
    0x7fff962e9136 <+22>: pmovmskb %xmm0, %esi
    0x7fff962e913a <+26>: andq   $0xf, %rcx
    0x7fff962e913e <+30>: orq    $-0x1, %rax
(lldb) bt
* thread #1: tid = 0x284b45, 0x00007fff962e9132 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00007fff962e9132 libsystem_c.dylib`strlen + 18
    frame #1: 0x00007fff8ed097a3 libc++.1.dylib`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*) + 21
    frame #2: 0x0000000100ce6f64 libFreeCADApp.dylib`App::Enumeration::setEnums(char const**) + 84
    frame #3: 0x0000000100c825a7 libFreeCADApp.dylib`App::PropertyEnumeration::setEnums(char const**) + 23
    frame #4: 0x000000016700bef9 _PartDesign.so`PartDesign::Hole::onChanged(App::Property const*) + 1353
    frame #5: 0x0000000100c5806e libFreeCADApp.dylib`App::Property::hasSetValue() + 30
    frame #6: 0x0000000100c82cc5 libFreeCADApp.dylib`App::PropertyEnumeration::Restore(Base::XMLReader&) + 357
    frame #7: 0x0000000166ff8171 _PartDesign.so`PartDesign::ProfileBased::Restore(Base::XMLReader&) + 625
    frame #8: 0x000000016700c8ce _PartDesign.so`PartDesign::Hole::Restore(Base::XMLReader&) + 14
    frame #9: 0x0000000100bad4d5 libFreeCADApp.dylib`App::Document::readObjects(Base::XMLReader&) + 1125
    frame #10: 0x0000000100bac7a6 libFreeCADApp.dylib`App::Document::Restore(Base::XMLReader&) + 710
    frame #11: 0x0000000100baf514 libFreeCADApp.dylib`App::Document::restore() + 628
    frame #12: 0x0000000100ca6954 libFreeCADApp.dylib`App::Application::openDocument(char const*) + 1908
    frame #13: 0x0000000100ccf4e3 libFreeCADApp.dylib`App::Application::sOpenDocument(_object*, _object*, _object*) + 115
    frame #14: 0x0000000101063907 Python`PyEval_EvalFrameEx + 26252
    frame #15: 0x000000010105d089 Python`PyEval_EvalCodeEx + 1583
    frame #16: 0x000000010105ca54 Python`PyEval_EvalCode + 54
    frame #17: 0x0000000101080259 Python`run_mod + 53
    frame #18: 0x0000000101080416 Python`PyRun_StringFlags + 109
    frame #19: 0x0000000100e91d75 libFreeCADBase.dylib`Base::InterpreterSingleton::runString(char const*) + 85
    frame #20: 0x0000000100092504 libFreeCADGui.dylib`Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) + 292
    frame #21: 0x000000010001a327 libFreeCADGui.dylib`Gui::Application::open(char const*, char const*) + 487
    frame #22: 0x000000010009cc06 libFreeCADGui.dylib`StdCmdOpen::activated(int) + 2294
    frame #23: 0x0000000100091e10 libFreeCADGui.dylib`Gui::Command::invoke(int) + 80
    frame #24: 0x0000000102f85eb4 QtCore`QMetaObject::activate(QObject*, int, int, void**) + 3060
    frame #25: 0x000000010211b05f QtWidgets`QAction::activate(QAction::ActionEvent) + 319
    frame #26: 0x0000000102f85eb4 QtCore`QMetaObject::activate(QObject*, int, int, void**) + 3060
    frame #27: 0x0000000102f7e9d8 QtCore`QObject::event(QEvent*) + 744
    frame #28: 0x00000001021245c6 QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 294
    frame #29: 0x0000000102127b78 QtWidgets`QApplication::notify(QObject*, QEvent*) + 8680
    frame #30: 0x000000010006c45b libFreeCADGui.dylib`Gui::GUIApplication::notify(QObject*, QEvent*) + 75
    frame #31: 0x0000000102f513b7 QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
    frame #32: 0x0000000102f52024 QtCore`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 596
    frame #33: 0x000000010825fbbe libqcocoa.dylib`___lldb_unnamed_symbol452$$libqcocoa.dylib + 190
    frame #34: 0x00000001082604c1 libqcocoa.dylib`___lldb_unnamed_symbol464$$libqcocoa.dylib + 33
    frame #35: 0x00007fff9680b7e1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #36: 0x00007fff967eaf0c CoreFoundation`__CFRunLoopDoSources0 + 556
    frame #37: 0x00007fff967ea42f CoreFoundation`__CFRunLoopRun + 927
    frame #38: 0x00007fff967e9e28 CoreFoundation`CFRunLoopRunSpecific + 296
    frame #39: 0x00007fff8e00d935 HIToolbox`RunCurrentEventLoopInMode + 235
    frame #40: 0x00007fff8e00d677 HIToolbox`ReceiveNextEventCommon + 184
    frame #41: 0x00007fff8e00d5af HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #42: 0x00007fff9e6b6df6 AppKit`_DPSNextEvent + 1067
    frame #43: 0x00007fff9e6b6226 AppKit`-[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
    frame #44: 0x00007fff9e6aad80 AppKit`-[NSApplication run] + 682
    frame #45: 0x000000010825f38a libqcocoa.dylib`___lldb_unnamed_symbol446$$libqcocoa.dylib + 2170
    frame #46: 0x0000000102f4d761 QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 401
    frame #47: 0x0000000102f51a6a QtCore`QCoreApplication::exec() + 346
    frame #48: 0x0000000100023415 libFreeCADGui.dylib`Gui::Application::runApplication() + 7509
    frame #49: 0x0000000100008cef FreeCAD`main + 4063
    frame #50: 0x00007fff9e3b95ad libdyld.dylib`start + 1
    frame #51: 0x00007fff9e3b95ad libdyld.dylib`start + 1
(lldb)
Does anybody has an idea how to fix the problem?

Regards,
Thomas

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11919 (Git)
Build type: Release
Branch: (detached from fccb5db)
Hash: fccb5dbc87b919164610296adc96aa8b4fe4825e
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
Attachments
USB-C-Plug.FCStd
(185.5 KiB) Downloaded 7 times
tom
Posts: 65
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash opening file containing PDN hole feature

Postby tom » Sun Aug 27, 2017 11:02 pm

The bug is reproducible with an even much simpler file. The attached test file was created using following steps:
  • create new document
  • switch to PDN workbench
  • create sketch in XY plane
  • draw a rectangle
  • close sketch
  • pad the sketch
  • select the top face of the created pad
  • create a new sketch
  • draw a circle
  • close sketch
  • select the sketch and apply the hole feature
  • use ISO metric coarse profile, M2 as parameters
  • apply hole
  • save the document
  • restart FreeCAD
  • load the document
The bug is not triggered, if no hole profile is selected or if ISO metric coarse profile is selected, but leaving the size at the default value of 1.6mm.

Regards,
Thomas

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11919 (Git)
Build type: Release
Branch: (detached from fccb5db)
Hash: fccb5dbc87b919164610296adc96aa8b4fe4825e
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
Attachments
test1.FCStd
(13.69 KiB) Downloaded 4 times
chrisb
Posts: 19042
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash opening file containing PDN hole feature

Postby chrisb » Sun Aug 27, 2017 11:26 pm

I get something similar on Ubuntu with a possibly remarkable additional line
not a freecad file: .OBJ

Code: Select all

freecad-daily
FreeCAD 0.17, Libs: 0.17R11919 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

not a freecad file: .OBJ
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7fd035c35cb0]
#1  /lib/x86_64-linux-gnu/libc.so.6(strlen+0x2a) [0x7fd035c87dfa]
...
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11919 (Git)
Build type: None
Branch: master
Hash: fccb5dbc87b919164610296adc96aa8b4fe4825e
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
wmayer
Site Admin
Posts: 14896
Joined: Thu Feb 19, 2009 10:32 am

Re: Crash opening file containing PDN hole feature

Postby wmayer » Mon Aug 28, 2017 10:56 am

chrisb
Posts: 19042
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash opening file containing PDN hole feature

Postby chrisb » Mon Aug 28, 2017 2:20 pm

wmayer wrote:
Mon Aug 28, 2017 10:56 am
git commit d93f9b1
Thanks for the very fast repair.
tom
Posts: 65
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash opening file containing PDN hole feature

Postby tom » Mon Aug 28, 2017 7:57 pm

@wmayer: That was fast. Thank you so much. You saved my day.

Regards,
Thomas