[Fixed] - Sketcher > Polyline Crashing FreeCAD

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!
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

[Fixed] - Sketcher > Polyline Crashing FreeCAD

Post by quick61 »

I thought I had seen something about this but I don't see and bug report.

To reproduce the crash, start a new sketch. Create two lines or any two line segments that are constrained with a coincidence constraint. Delete any one of the segments. FreeCAD crashes with.

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fffcfb4648b in Part::PropertyGeometryList::setValues(std::vector<Part::Geometry*, std::allocator<Part::Geometry*> > const&) ()
   from /home/mark/Build/FreeCAD-test/Mod/Part/Part.so
#2  0x00007fffc9f9bb58 in Sketcher::SketchObject::delGeometry(int) () from /home/mark/Build/FreeCAD-test/Mod/Sketcher/Sketcher.so
#3  0x00007fffc9fe79ae in Sketcher::SketchObjectPy::delGeometry(_object*) () from /home/mark/Build/FreeCAD-test/Mod/Sketcher/Sketcher.so
#4  0x00007fffc9fe7b7b in Sketcher::SketchObjectPy::staticCallback_delGeometry(_object*, _object*) ()
   from /home/mark/Build/FreeCAD-test/Mod/Sketcher/Sketcher.so
#5  0x00007ffff67a70d4 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#6  0x00007ffff67a917d in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#7  0x00007ffff67a9462 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#8  0x00007ffff66edac9 in PyRun_StringFlags () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#9  0x00007ffff6c3b556 in Base::InterpreterSingleton::runString(char const*) () from /home/mark/Build/FreeCAD-test/lib/libFreeCADBase.so
#10 0x00007ffff755cdac in Gui::Command::doCommand(Gui::Command::DoCmd_Type, char const*, ...) ()
   from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#11 0x00007fffc92b5b62 in SketcherGui::ViewProviderSketch::onDelete(std::vector<std::string, std::allocator<std::string> > const&) ()
   from /home/mark/Build/FreeCAD-test/Mod/Sketcher/SketcherGui.so
#12 0x00007ffff7567080 in StdCmdDelete::activated(int) () from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#13 0x00007ffff756040c in Gui::Command::invoke(int) () from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#14 0x00007ffff53fb87a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff5b57a62 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007ffff5b59433 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff5b5958c in QAction::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff5b5de2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00007ffff5b644a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007ffff7518abf in Gui::GUIApplication::notify(QObject*, QEvent*) () from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#21 0x00007ffff53e74dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007ffff5b8f2a6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#23 0x00007ffff5b8f3dc in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007ffff5b65773 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007ffff7518abf in Gui::GUIApplication::notify(QObject*, QEvent*) () from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#26 0x00007ffff53e74dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#27 0x00007ffff5bfd027 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#28 0x00007ffff5bfd3c9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#29 0x00007ffff5bd7417 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#30 0x00007ffff5bffb32 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#31 0x00007fffee962e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007fffee963048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007fffee9630ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff54147a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#35 0x00007ffff5bffbe6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#36 0x00007ffff53e60af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007ffff53e63a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007ffff53ebb79 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#39 0x00007ffff75104a8 in Gui::Application::runApplication() () from /home/mark/Build/FreeCAD-test/lib/libFreeCADGui.so
#40 0x000000000040400b in main ()


Mark

OS: Kubuntu 14.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5121 (Git)
Build type: Release
Branch: master
Hash: 9680f1385469ab7187ce16a284ca237562f1111c
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Last edited by quick61 on Wed Jun 24, 2015 9:08 pm, edited 1 time in total.
This post made with 0.0% Micro$oft products - GOT LINUX?
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher > Polyline Crashing FreeCAD

Post by chrisb »

No Crash here:

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4630 (Git)
Branch: master
Hash: 1b7c0e2a51bf4bffe5f345204c9c2bc6681e151d
Python version: 2.7.5
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1.oce-0.16
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Sketcher > Polyline Crashing FreeCAD

Post by bejant »

Confirmed here on:

OS: Ubuntu 14.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.5116 (Git)
Build type: None
Branch: master
Hash: cd25a3417194789b5da46a27f2cae10371c57562
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

But no crash on:

OS: Ubuntu 14.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.5036 (Git)
Build type: Release
Branch: master
Hash: a12f700aa27792f0ecdf09c5ee190d0bf88b0e81
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher > Polyline Crashing FreeCAD

Post by chrisb »

And no crash here:

I did the following:
  • Start Ubuntu
  • Login
  • Start FreeCAD
  • New Empty Document
  • Select Sketcher WB
  • Select Create single line
  • Draw Line from lower left to upper right
  • Draw (crossing) line from upper left to lower right
  • Select the two points at the right
  • Create coincidence
  • Delete upper line
I could upgrade to newest version to get this new feature if it helps detecting the crash ;) .

OS: Ubuntu 14.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.4928 (Git)
Branch: master
Hash: d8f63bcfd10301f3d1e141cced4370f0782238d0
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher > Polyline Crashing FreeCAD

Post by triplus »

Hi Mark.

I think you are talking about this issue #0002163. It should be fixed once this gets merged.
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Sketcher > Polyline Crashing FreeCAD

Post by quick61 »

triplus wrote:Hi Mark.

I think you are talking about this issue #0002163. It should be fixed once this gets merged.
Yea, that's it. I thought it was known but I must of looked right over that ticket. Thanks everyone!

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Sketcher > Polyline Crashing FreeCAD

Post by quick61 »

Looks like this issue is fixed. Things are back to normal. :) Thanks!
This post made with 0.0% Micro$oft products - GOT LINUX?
JMG
Posts: 288
Joined: Wed Dec 25, 2013 9:32 am
Location: Spain
Contact:

Re: [Fixed] - Sketcher > Polyline Crashing FreeCAD

Post by JMG »

I think that maybe this is the same bug:

FreeCAD info:

Code: Select all

OS: Linux Mint 17.1 Rebecca
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5119 (Git)
Build type: None
Branch: master
Hash: bc920f9a2482c78763dea98ac15791819592965a
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
At the sketch in the attached file, try to remove one line, FreeCAD crashes and complains about:

Code: Select all

freecad
FreeCAD 0.16, Libs: 0.16R5119 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

My Sheet Metal Loaded
freecad: SoGroup.cpp:292: virtual SoNode* SoGroup::getChild(int) const: Assertion `(index >= 0) && (index < this->getNumChildren())' failed.
Aborted
Or, depending of the deleted element

Code: Select all

freecad
FreeCAD 0.16, Libs: 0.16R5119 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

My Sheet Metal Loaded
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 8

CarroV1.fcstd
(7.92 KiB) Downloaded 56 times
Hope it helps.

Javier.
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Fixed] - Sketcher > Polyline Crashing FreeCAD

Post by wmayer »

At the sketch in the attached file, try to remove one line, FreeCAD crashes and complains about:
I can confirm this crash but according to the stack trace it seems to be a different issue. It crashes inside ViewProviderSketch::updateColor() because

Code: Select all

        }
        else if (getSketchObject()->getGeometry(GeoId)->Construction) {
        ...
getGeometry() returns a null pointer. So, accessing the "Construction" member raises the segmentation fault.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [Fixed] - Sketcher > Polyline Crashing FreeCAD

Post by abdullah »

Thank you so much JMG for posting this sketch. It covers a corner case to which I did not pay enough attention.

This is the fix:
https://github.com/abdullahtahiriyo/Fre ... 2fc97ad19c

I will issue a pull request.
wmayer wrote:I can confirm this crash but according to the stack trace it seems to be a different issue
Yes, it is. I will post more about it in the pull request post.
Post Reply