Crash with referencing other part

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
sjgallagher2
Posts: 12
Joined: Fri Mar 03, 2017 2:51 am

Crash with referencing other part

Post by sjgallagher2 »

FreeCAD 0.17 (full info below) crashes when creating a sketch in one part using a reference plane in another part.
Steps for reproduction:
  1. Open FreeCAD
  2. Create two parts
    Part and Part001 by default
  3. Make a new body in Part
    Make Part active and make new body
  4. Create a datum plane
    Show the object origin and use e.g. XY-Plane, offset by 20 units in Z just because
  5. Make Part001 active, make a new body in it
  6. Create a new sketch for this body
  7. Use Allow external features > From other parts or free features
  8. Select the datum plane
    Keep option for reference as Make independent copy (Recommended)
  9. Click Okay, FreeCAD crashes
FreeCAD Information:
OS: Debian GNU/Linux 9.4 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13509 (Git) AppImage
Build type: None
Branch: master
Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7
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)
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash with referencing other part

Post by chrisb »

is it the same with current stable 0.17.13519?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Crash with referencing other part

Post by NormandC »

I confirm the crash on

OS: Ubuntu 18.04 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/Canada (fr_CA)

and

OS: Ubuntu 18.04 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13934 (Git)
Build type: None
Branch: master
Hash: b77b77c0def23f2abb9b0c96ed9c50076906be6a
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/Canada (fr_CA)

@sjgallagher2

It would help to provide a backtrace. Debugging
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Crash with referencing other part

Post by GeneFC »

I don't see a crash on Windows, because errors are typically trapped rather than allowed to cause a crash, but the creation of the sketch fails. The only message in the Report view panel is,

App::DocumentObject has no view provider specified


OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13510 +12 (Git)
Build type: Release
Branch:
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)


Gene
Max452
Posts: 17
Joined: Fri Mar 23, 2018 9:09 pm

Re: Crash with referencing other part

Post by Max452 »

I've got a crash too.

OS: Debian GNU/Linux 9.4 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)

From terminal.

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x34f00) [0x7fa191a04f00]
#1  0x7fa193fca989 in App::Property::aboutToSetValue() from /usr/lib/freecad/lib/libFreeCADApp.so+0x9
#2  0x7fa1609b27cf in Part::PropertyPartShape::setValue(TopoDS_Shape const&) from /usr/lib/freecad/lib/Part.so+0xf
#3  0x7fa11a7c2c34 in PartDesignGui::TaskFeaturePick::makeCopy(App::DocumentObject*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool) from /usr/lib/freecad/lib/PartDesignGui.so+0x464
#4  0x7fa11a7c3c1b in PartDesignGui::TaskFeaturePick::buildFeatures() from /usr/lib/freecad/lib/PartDesignGui.so+0x21b
#5  0x7fa11a7c40a4 in PartDesignGui::TaskDlgFeaturePick::~TaskDlgFeaturePick() from /usr/lib/freecad/lib/PartDesignGui.so+0x144
#6  0x7fa11a7c41f9 in PartDesignGui::TaskDlgFeaturePick::~TaskDlgFeaturePick() from /usr/lib/freecad/lib/PartDesignGui.so+0x9
#7  0x7fa19482453c in Gui::TaskView::TaskView::removeDialog() from /usr/lib/freecad/lib/libFreeCADGui.so+0xdc
#8  0x7fa194824a41 in Gui::TaskView::TaskView::accept() from /usr/lib/freecad/lib/libFreeCADGui.so+0x91
#9  0x7fa1924cf660 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x4d0
#10  0x7fa1924cf660 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x4d0
#11  0x7fa19308bc72 in QAbstractButton::clicked(bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x42
#12  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x59a5c3) [0x7fa192dc25c3]
#13  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x59b944) [0x7fa192dc3944]
#14  0x7fa192dc3a54 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x74
#15  0x7fa192a42e80 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x290
#16  0x7fa1929ec54c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x8c
#17  0x7fa1929f4ca7 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x1a47
#18  0x7fa194642468 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x88
#19  0x7fa1924baf1d in QCoreApplication::notifyInternal(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x8d
#20  0x7fa1929f2ccb in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0x14b
#21  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x2461a9) [0x7fa192a6e1a9]
#22  0x7fa192a6cb5c in QApplication::x11ProcessEvent(_XEvent*) from /usr/lib/x86_64-linux-gnu/libQtGui.so.4+0xc9c
#23  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26e502) [0x7fa192a96502]
#24  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2a7) [0x7fa18afc27f7]
#25  /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4aa60) [0x7fa18afc2a60]
#26  /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7fa18afc2b0c]
#27  0x7fa1924eb854 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x64
#28  /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26e5d6) [0x7fa192a965d6]
#29  0x7fa1924b97ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x3f
#30  0x7fa1924b9b55 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x1b5
#31  0x7fa1924bfbd9 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4+0x99
#32  0x7fa1945fa160 in Gui::Application::runApplication() from /usr/lib/freecad/lib/libFreeCADGui.so+0x13a0
#33  freecad(main+0x6db) [0x563c1add44db]
#34  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fa1919f1a87]
#35  freecad(_start+0x2a) [0x563c1add568a]
Ramses
Posts: 31
Joined: Fri Sep 28, 2018 6:16 pm

Re: Crash with referencing other part

Post by Ramses »

Me too !
OS: Linux Mint 18.3 Sylvia
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)

What I did:
Image
and just before the crash:
Image

In the terminal:

Code: Select all

jean@jean-X750LN ~ $ freecad -l
FreeCAD 0.17, Libs: 0.17R13541 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Fasteners workbench Loaded
Sheet Metal workbench loaded
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f9edc58e4b0]
#1  /lib/x86_64-linux-gnu/libc.so.6(+0x3c4d28) [0x7f9edc91dd28]
[1]+  Processus arrêté      freecad --help
Then the end of the log:

Code: Select all

...
Log: Loading PartDesign module... done
Log: Init: Showing main window
Log: Main window restored
Log: Show main window
Log: Toolbars restored
Log: Couldn't connect to spacenav daemon
Log: Init: Entering event loop
Log: Init: Processing command line files
Log: Ignore recovery file  "/tmp/FreeCAD_Doc_c392ca2a-f39d-4e1a-b3ae-bd89deab2b2b_ec0f98_24632/fc_recovery_file.fcstd"  because it is older than the project file "/media/DATA/Developpement/3D/FreeCad17/test_body.fcstd" 
 
Log: Save AutoRecovery file: Needed time: 4ms
Log: Save AutoRecovery file: Needed time: 0ms
Log: QAccessibleTree::indexFromLogical: invalid index:  9 0  for  Gui::PropertyEditor::PropertyEditor(0x1cc8850) 
Log: QAccessibleTree::indexFromLogical: invalid index:  9 0  for  Gui::PropertyEditor::PropertyEditor(0x1cc8850) 
Log: App::DocumentObject has no view provider specified
Err: Program received signal SIGSEGV, Segmentation fault.
Err: #0  /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f9edc58e4b0]
Err: #1  /lib/x86_64-linux-gnu/libc.so.6(+0x3c4d28) [0x7f9edc91dd28]
I hope it'll be possible to use references from one body to an other one in a close future ?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Crash with referencing other part

Post by wmayer »

Fixed with git commit dc46910231d

The problem was the use of "getClassTypeId()" instead of "getTypeId()" because it then created a new object of type "App::DocumentObject" instead of "PartDesign::Plane" and thus the cast to a Part::Datum returned an invalid object and assigning the shape the led to the segfault.
Ramses
Posts: 31
Joined: Fri Sep 28, 2018 6:16 pm

Re: Crash with referencing other part

Post by Ramses »

Thanks for your action, now it's well working on Freecad 18. But can we expect the same with Freecad 17 ?
Post Reply