Closed FreeCAD-Bug-Importer closed 1 month ago
Easily reproducible on
The problem is caused by BRepLib::EncodeRegularity(TopoDS_Shape const&, double)
and BRepOffsetAPI_ThruSections::Build()
.
It's creating an error but not crashing at my side
``` OS: Windows 11 build 22631 Word size of FreeCAD: 64-bit Version: 0.22.0dev.36082 (Git) Build type: Release Branch: main Hash: 7a025e4e60a607bdbdd1599627ce13bb8eeda071 Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3 Locale: German/Germany (de_DE) Installed mods: * 3DfindIT 1.2.0 * BIM 2021.12.0 * CfdOF 1.25.2 * CurvedShapes 1.0.5 * Curves 0.6.23 * Defeaturing 1.2.2 * fasteners 0.5.12 * FEMbyGEN 2.1.0 * freecad.gears 1.0.0 * freecad_metal_workbench 0.0.1 * OpenDark 2023.12.17 * sheetmetal 0.4.2 ```
Crash still happens in latest code:
OS: Ubuntu 20.04.6 LTS (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 1.1.0dev.38842 (Git)
Build type: Debug
Branch: main
Hash: 69676a0f9d2d5b288bda3d1c6dbad5a6ec26bfaa
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: unset/FreeCAD Classic/Qt default
206.449 Tree.cpp(295): [ComboView] duplicate child item Unnamed#AdditiveLoft.Sketch
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7f6d0c423090]
#1 /usr/lib/x86_64-linux-gnu/libTKTopAlgo.so.7(+0x1d61ca) [0x7f6ce54fa1ca]
#2 0x7f6ce54fadbf in BRepLib::EncodeRegularity(TopoDS_Shape const&, double) from /usr/lib/x86_64-linux-gnu/libTKTopAlgo.so.7+0x15f
#3 0x7f6ce4452d00 in BRepOffsetAPI_ThruSections::Build(Message_ProgressRange const&) from /usr/lib/x86_64-linux-gnu/libTKOffset.so.7+0x13a0
#4 0x7f6ce60ff342 in Part::TopoShape::makeElementLoft(std::vector<Part::TopoShape, std::allocator<Part::TopoShape> > const&, Part::IsSolid, Part::IsRuled, Part::IsClosed, int, char const*) from ~/src/FreeCAD/main/Mod/Part/Part.so+0x500
#5 0x7f6cdbf44198 in PartDesign::Loft::execute() from ~/src/FreeCAD/main/Mod/PartDesign/_PartDesign.so+0x71a
#6 0x7f6d0f2c3628 in App::DocumentObject::recompute() from ~/src/FreeCAD/main/lib/libFreeCADApp.so+0x88
#7 0x7f6ce5db0695 in Part::Feature::recompute() from ~/src/FreeCAD/main/Mod/Part/Part.so+0x1f
#8 0x7f6cdbe4ecb6 in PartDesign::Feature::recompute() from ~/src/FreeCAD/main/Mod/PartDesign/_PartDesign.so+0xe2
#9 0x7f6d0f1d3b90 in App::Document::_recomputeFeature(App::DocumentObject*) from ~/src/FreeCAD/main/lib/libFreeCADApp.so+0x1fe
#10 0x7f6d0f1d49cc in App::Document::recomputeFeature(App::DocumentObject*, bool) from ~/src/FreeCAD/main/lib/libFreeCADApp.so+0x112
#11 0x7f6c6223e1f5 in PartDesignGui::TaskFeatureParameters::recomputeFeature() from ~/src/FreeCAD/main/Mod/PartDesign/PartDesignGui.so+0x7b
#12 0x7f6c62303712 in PartDesignGui::TaskLoftParameters::onSelectionChanged(Gui::SelectionChanges const&) from ~/src/FreeCAD/main/Mod/PartDesign/PartDesignGui.so+0x42a
here's a file to reproduce.
steps:
expected outcome: no crash
actual outcome segfault
can also be reproduced in CLI
recompute.py:
import FreeCAD
FreeCAD.ActiveDocument.recompute()
freecadCmd loftcrash.FCStd recompute.py
---> segfault
as a workaround i would propose to check whether the first section is "identical" to the base - however I haven't found any method or other functionality to test for identity between shapes.
this PR goes too short.
the segfault can be triggered if any two consecutive shapes in the loft are identical - an easy way to make identical distinct shapes to trigger that is use shapebinders of sketches and add those to the loft. - the binders can be moved independently, if they are in a different spot, they don#t trigger the crash, if they are in the same spot, they do
ok new version of PR should fix this.
Issue imported from https://tracker.freecad.org/view.php?id=3751
Original report text
May be related to #5642 Reproduces if the master-sketch added as a not last section of Loft.
Additional information
Steps to reproduce
https://youtu.be/fKxVAzo2-0A
Other bug information
Discussion from Mantis ticket
Comment by sleeply4cat 2018-12-28 11:12
omg, sorry. Attached a log by the right way.
Also, build info: OS: Ubuntu 18.04.1 LTS Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.15495 (Git) Build type: Release Branch: master Hash: 9c7128ea77fc1046e11ebf2fbeb41216446eac4f Python version: 2.7.15rc1 Qt version: 4.8.7 Coin version: 4.0.0a OCC version: 7.3.0 Locale: English/UnitedStates (en_US)