SIGSEGV in occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:2456 opening FreeCAD file

Forums: 

Hy,

the bug occured for me also with opencascade version 7.5 opening a FreeCAD .brp file.
Until now it was only reproduceable by another user but worked for others.
The file appears to be somehow broken, it produces, for those where it doesn't crash, a somehow strange geometry.
A discussion is going on in the FreeCAD Forum here (including geometry screenshot): https://forum.freecadweb.org/viewtopic.php?f=8&t=68497

The backtrace was:

Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007fffcc62e659 in BRepMesh_Edge::Movability (this=0x0) at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Edge.hxx:48
48          return myMovability;
(gdb) bt
#0  0x00007fffcc62e659 in BRepMesh_Edge::Movability() const (this=0x0)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Edge.hxx:48
#1  BRepMesh_Delaun::Contains(int, BRepMesh_Vertex const&, double, int&) const
    (this=0x7fffffff4570, theTriangleId=<optimized out>, theVertex=..., theSqTolerance=6.7999999999999991e+187, theEdgeOn=@0x7fffffff41b4: 0)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:2456
#2  0x00007fffcc629c57 in BRepMesh_Delaun::createTrianglesOnNewVertices(NCollection_Shared<NCollection_Vector<int>, void>&, Message_ProgressRange const&) (this=0x7fffffff4570, theVertexIndexes=..., theRange=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:584
#3  0x00007fffcc62a1b2 in BRepMesh_Delaun::compute(NCollection_Shared<NCollection_Vector<int>, void>&)
    (this=0x7fffffff4570, theVertexIndexes=...) at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:380
#4  0x00007fffcc62a4d9 in BRepMesh_Delaun::perform(NCollection_Shared<NCollection_Vector<int>, void>&, int, int)
    (this=0x7fffffff4570, theVertexIndices=..., theCellsCountU=<optimized out>, theCellsCountV=2)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:282
#5  0x00007fffcc62a849 in BRepMesh_Delaun::BRepMesh_Delaun(opencascade::handle<BRepMesh_DataStructureOfDelaun> const&, NCollection_Shared<NCollection_Vector<int>, void>&, int, int)
    (this=this@entry=0x7fffffff4570, theOldMesh=..., theVertexIndices=..., theCellsCountU=2, theCellsCountV=2, this=<optimized out>, theOldMesh=<optimized out>, theVertexIndices=<optimized out>, theCellsCountU=<optimized out>, theCellsCountV=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_Delaun.cxx:171
#6  0x00007fffcc633281 in BRepMesh_DelaunayBaseMeshAlgo::generateMesh(Message_ProgressRange const&) (this=0x2276db70, theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_DelaunayBaseMeshAlgo.cxx:54
#7  0x00007fffcc61efe8 in BRepMesh_BaseMeshAlgo::Perform(opencascade::handle<IMeshData_Face> const&, IMeshTools_Parameters const&, Message_ProgressRange const&) (this=0x2276db70, theDFace=..., theParameters=..., theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx:71
#8  0x00007fffcc647011 in BRepMesh_NodeInsertionMeshAlgo<BRepMesh_CylinderRangeSplitter, BRepMesh_DelaunayBaseMeshAlgo>::Perform(opencascade::handle<IMeshData_Face> const&, IMeshTools_Parameters const&, Message_ProgressRange const&)
    (this=0x2276db70, theDFace=..., theParameters=..., theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_NodeInsertionMeshAlgo.hxx:59
#9  0x00007fffcc637de3 in BRepMesh_FaceDiscret::process(int, Message_ProgressRange const&) const
    (this=0x226e90b0, theFaceIndex=<optimized out>, theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_FaceDiscret.cxx:135
#10 0x00007fffcc6381a9 in BRepMesh_FaceDiscret::FaceListFunctor::operator()(int) const (theFaceIndex=0, this=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_FaceDiscret.cxx:67
--Type <RET> for more, q to quit, c to continue without paging--
#11 OSD_Parallel::FunctorWrapperForThreadPool<BRepMesh_EdgeDiscret>::operator()(int, int) const
    (theElemIndex=0, theThreadIndex=<optimized out>, this=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_Parallel.hxx:256
#12 OSD_ThreadPool::Job<OSD_Parallel::FunctorWrapperForThreadPool<BRepMesh_EdgeDiscret> >::Perform(int)
    (this=0x7fffffff4d70, theThreadIndex=<optimized out>) at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_ThreadPool.hxx:299
#13 0x00007fffa35d875a in OSD_ThreadPool::performJob(opencascade::handle<Standard_Failure>&, OSD_ThreadPool::JobInterface*, int)
    (theFailure=..., theJob=0x7fffffff4d70, theThreadIndex=6) at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_ThreadPool.cxx:286
#14 0x00007fffa35d9156 in OSD_ThreadPool::Launcher::run(OSD_ThreadPool::JobInterface&) (this=this@entry=0x7fffffff4e10, theJob=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_ThreadPool.cxx:227
#15 0x00007fffa35d9179 in OSD_ThreadPool::Launcher::perform(OSD_ThreadPool::JobInterface&) (this=0x7fffffff4e10, theJob=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_ThreadPool.cxx:213
#16 0x00007fffcc63bf57 in OSD_ThreadPool::Launcher::Perform<OSD_Parallel::FunctorWrapperForThreadPool<BRepMesh_EdgeDiscret> >(int, int, OSD_Parallel::FunctorWrapperForThreadPool<BRepMesh_EdgeDiscret> const&)
    (theBegin=<optimized out>, theFunctor=..., theEnd=<optimized out>, this=0x7fffffff4e10)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_ThreadPool.hxx:228
#17 OSD_Parallel::For<BRepMesh_FaceDiscret::FaceListFunctor>(int, int, BRepMesh_FaceDiscret::FaceListFunctor const&, bool)
    (theBegin=0, isForceSingleThreadExecution=false, theFunctor=..., theEnd=7)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/OSD/OSD_Parallel.hxx:369
#18 BRepMesh_FaceDiscret::performInternal(opencascade::handle<IMeshData_Model> const&, IMeshTools_Parameters const&, Message_ProgressRange const&) (this=0x226e90b0, theModel=<optimized out>, theParameters=<optimized out>, theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_FaceDiscret.cxx:93
#19 0x00007fffcc60ccb1 in IMeshTools_ModelAlgo::Perform(opencascade::handle<IMeshData_Model> const&, IMeshTools_Parameters const&, Message_ProgressRange const&) (this=0x226e90b0, theModel=..., theParameters=..., theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/IMeshTools/IMeshTools_ModelAlgo.hxx:48
#20 0x00007fffcc60daaf in IMeshTools_Context::DiscretizeFaces(Message_ProgressRange const&) (theRange=..., this=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/IMeshTools/IMeshTools_Context.hxx:111
#21 IMeshTools_MeshBuilder::Perform(Message_ProgressRange const&) (this=0x7fffffff51f0, theRange=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/IMeshTools/IMeshTools_MeshBuilder.cxx:73
#22 0x00007fffcc6466de in BRepMesh_IncrementalMesh::Perform(opencascade::handle<IMeshTools_Context> const&, Message_ProgressRange const&)
    (this=0x7fffffff5c40, theContext=..., theRange=...) at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_IncrementalMesh.cxx:111
#23 0x00007fffcc646998 in BRepMesh_IncrementalMesh::Perform(Message_ProgressRange const&) (this=0x7fffffff5c40, theRange=...)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_IncrementalMesh.cxx:94
--Type <RET> for more, q to quit, c to continue without paging--
#24 0x00007fffcc646b03 in BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh(TopoDS_Shape const&, double, bool, double, bool)
    (this=0x7fffffff5c40, theShape=..., theLinDeflection=1.0000000149011621e+97, isRelative=<optimized out>, theAngDeflection=0.26179938779914941, isInParallel=<optimized out>, this=<optimized out>, theShape=<optimized out>, theLinDeflection=<optimized out>, isRelative=<optimized out>, theAngDeflection=<optimized out>, isInParallel=<optimized out>)
    at /usr/src/debug/occt-7.6.1-105.7.x86_64/src/BRepMesh/BRepMesh_IncrementalMesh.cxx:62
#25 0x00007fffa2965bb5 in PartGui::ViewProviderPartExt::updateVisual() (this=0xc98c9d0)
    at /home/system/usr/FreeCAD/src/src/Mod/Part/Gui/ViewProviderExt.cpp:955
#26 0x00007fffa2961627 in PartGui::ViewProviderPartExt::onChanged(App::Property const*) (this=0xc98c9d0, prop=0xc98cc30)
    at /home/system/usr/FreeCAD/src/src/Mod/Part/Gui/ViewProviderExt.cpp:362
#27 0x00007ffed5e36f11 in PartDesignGui::ViewProviderBody::onChanged(App::Property const*) (this=0xc98c9d0, prop=0xc98cc30)
    at /home/system/usr/FreeCAD/src/src/Mod/PartDesign/Gui/ViewProviderBody.cpp:386
#28 0x00007ffff583e1df in App::Property::hasSetValue() (this=0xc98cc30) at /home/system/usr/FreeCAD/src/src/App/Property.cpp:231
#29 0x00007ffff58b9a1a in App::PropertyBool::setValue(bool) (this=0xc98cc30, lValue=true)
    at /home/system/usr/FreeCAD/src/src/App/PropertyStandard.cpp:2053
#30 0x00007ffff58b9d6e in App::PropertyBool::Restore(Base::XMLReader&) (this=0xc98cc30, reader=...)
    at /home/system/usr/FreeCAD/src/src/App/PropertyStandard.cpp:2095
#31 0x00007ffff5843241 in App::PropertyContainer::Restore(Base::XMLReader&) (this=0xc98c9d0, reader=...)
    at /home/system/usr/FreeCAD/src/src/App/PropertyContainer.cpp:361
#32 0x00007ffff5704124 in App::ExtensionContainer::Restore(Base::XMLReader&) (this=0xc98c9d0, reader=...)
    at /home/system/usr/FreeCAD/src/src/App/ExtensionContainer.cpp:309
#33 0x00007ffff7347271 in Gui::ViewProvider::Restore(Base::XMLReader&) (this=0xc98c9d0, reader=...)
    at /home/system/usr/FreeCAD/src/src/Gui/ViewProvider.cpp:838
#34 0x00007ffff6dfe4f9 in Gui::Document::RestoreDocFile(Base::Reader&) (this=0x5a0b7f0, reader=...)
    at /home/system/usr/FreeCAD/src/src/Gui/Document.cpp:1431
#35 0x00007ffff4a48824 in Base::XMLReader::readFiles(zipios::ZipInputStream&) const (this=0x7fffffff68e0, zipstream=...)
    at /home/system/usr/FreeCAD/src/src/Base/Reader.cpp:334
#36 0x00007ffff55cb634 in App::Document::restore(char const*, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) (this=
    0x5ae6620, filename=0x5ae97d0 "/home/stone/home/doc/Privat/Projekte/2021-05-21 Standardteile/Standardteile.FCStd", delaySignal=true, objNames=std::vector of length 0, capacity 0) at /home/system/usr/FreeCAD/src/src/App/Document.cpp:2779
#37 0x00007ffff58fa682 in App::Application::openDocumentPrivate(char const*, char const*, char const*, bool, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::alloc--Type <RET> for more, q to quit, c to continue without paging--

Thanks,
Frank

Artem Zhidkov's picture

Dear Frank,

Thanks for the found issue. But, could you report it in OCCT bugtracker https://tracker.dev.opencascade.org/ ? Don't forget to attach the shape reproducing SIGSEGV.

Thank you in advance,

Artem