View Issue Details

IDProjectCategoryView StatusLast Update
0001720FreeCADBugpublic2014-12-28 16:39
Reporterrenn0xtek9 Assigned Towmayer  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinux 32 bitOSKubuntuOS Version14.04 w
Product Version0.14 
Summary0001720: Freecad crash when handling invalid sketches
Description(removed useless stacktrace)
Steps To ReproduceCreate an empty part in partDesign mode
Execure the macro above
Additional InformationIt most likely fails in the last part of the macro
Tagssketcher
FreeCAD Information

Relationships

related to 0001060 closedwmayer Editing sketch crashes FreeCAD 
related to 0001759 closed python interface allows to break sketches by invalid GeomIds 

Activities

yorik

2014-08-31 16:57

administrator   ~0005034

This is probably not be a bug in FreeCAD but in your macro. Can you attach it here?

shoogen

2014-08-31 17:13

developer   ~0005035

and please provide the first part of the backtrace

renn0xtek9

2014-08-31 18:57

reporter  

freecadbug.txt (Attachment missing)

renn0xtek9

2014-08-31 18:57

reporter   ~0005038

Macro and backtrace are in the file I have just attached

shoogen

2014-09-19 09:37

developer   ~0005131

Last edited: 2014-09-19 09:38

i can reproduce the problem
the offending line is
profil_plateau.addConstraint(Sketcher.Constraint('Coincident',0+numb,2+numb,1+numb,1+numb))
FreeCAD should not crash.
Maybe we should raise an exception instead of an __assert_fail

But you should save and use the geomIds returned by the addGeometry calls.

shoogen

2014-09-19 10:49

developer   ~0005132

When i skip the assertion i get a new problem when i try to edit the resulting sketch. After entering edit mode an zooming out, i hit a SIGSEGV
(gdb) bt
#0 0x00007fff76f04ac6 in SketcherGui::ViewProviderSketch::updateColor (this=
    0x43e2c80)
    at free-cad/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp:1975
#1 0x00007fff76f004b0 in SketcherGui::ViewProviderSketch::onSelectionChanged (
    this=0x43e2c80, msg=...)
    at free-cad/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp:1459
0000002 0x00007ffff773a3ce in boost::_mfi::mf1<void, Gui::SelectionObserver, Gui::SelectionChanges const&>::operator() (this=0x43f1440, p=0x43e3280, a1=...)
    at build/boost_1_56_0/boost/bind/mem_fn_template.hpp:165
0000003 0x00007ffff7739ed0 in boost::_bi::list2<boost::_bi::value<Gui::SelectionObserver*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, Gui::SelectionObserver, Gui::SelectionChanges const&>, boost::_bi::list1<Gui::SelectionChanges const&> > (this=0x43f1450, f=..., a=...)
    at build/boost_1_56_0/boost/bind/bind.hpp:313
0000004 0x00007ffff77396e0 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, Gui::SelectionObserver, Gui::SelectionChanges const&>, boost::_bi::list2<boost::_bi::value<Gui::SelectionObserver*>, boost::arg<1> > >::operator()<Gui::SelectionChanges> (this=0x43f1440, a1=...)
    at build/boost_1_56_0/boost/bind/bind_template.hpp:47
0000005 0x00007ffff7738a48 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Gui::SelectionObserver, Gui::Selec-
tionChanges const&>, boost::_bi::list2<boost::_bi::value<Gui::SelectionObserver*>, boost::arg<1> > >, void, Gui::SelectionChanges const&>::invoke (
    function_obj_ptr=..., a0=...)
    at build/boost_1_56_0/boost/function/function_template.hpp:153
0000006 0x00007ffff773a865 in boost::function1<void, Gui::SelectionChanges const&>::operator() (this=0x43f1438, a0=...)
    at build/boost_1_56_0/boost/function/function_template.hpp:767

(gdb) frame
#0 0x00007fff76f04ac6 in SketcherGui::ViewProviderSketch::updateColor (this=
    0x43e2c80)
    at free-cad/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp:1975
1975 int GeoId = edit->CurvIdToGeoId[i];

(gdb) p i
$4 = 0
(gdb) p edit->CurvIdToGeoId
$6 = std::vector of length 0, capacity 0

shoogen

2014-09-20 09:49

developer  

sketcher.py (Attachment missing)

shoogen

2014-09-20 09:50

developer   ~0005135

I modified your script to work, without crashing FreeCAD

Related Changesets

FreeCAD: master 7d8b1f30

2014-12-28 17:10:54

wmayer

Details Diff
+ fixes 0001720: Freecad crash when handling invalid sketches Affected Issues
0001720
mod - src/Mod/Sketcher/App/SketchObject.cpp Diff File
mod - src/Mod/Sketcher/App/SketchObject.h Diff File
mod - src/Mod/Sketcher/App/SketchObjectPyImp.cpp Diff File

Issue History

Date Modified Username Field Change
2014-08-31 15:52 renn0xtek9 New Issue
2014-08-31 16:57 yorik Note Added: 0005034
2014-08-31 17:13 shoogen Note Added: 0005035
2014-08-31 18:57 renn0xtek9 File Added: freecadbug.txt
2014-08-31 18:57 renn0xtek9 Note Added: 0005038
2014-08-31 20:49 shoogen Tag Attached: sketcher
2014-09-19 09:37 shoogen Note Added: 0005131
2014-09-19 09:38 shoogen Note Edited: 0005131
2014-09-19 10:49 shoogen Note Added: 0005132
2014-09-19 10:50 shoogen Description Updated
2014-09-19 10:51 shoogen Status new => acknowledged
2014-09-19 10:51 shoogen Summary Freecad crash when executing a very small macros => Freecad crash when handling invalid sketches
2014-09-20 09:49 shoogen File Added: sketcher.py
2014-09-20 09:50 shoogen Note Added: 0005135
2014-09-20 10:02 shoogen Relationship added related to 0001759
2014-12-28 11:23 shoogen Relationship added related to 0001060
2014-12-28 16:39 wmayer Changeset attached => FreeCAD Master master 7d8b1f30
2014-12-28 16:39 wmayer Assigned To => wmayer
2014-12-28 16:39 wmayer Status acknowledged => closed
2014-12-28 16:39 wmayer Resolution open => fixed