View Issue Details

IDProjectCategoryView StatusLast Update
0027125CommunityOCCT:Modeling Algorithmspublic2023-08-01 15:08
ReporterIstvan Csanady Assigned Tojgv 
PrioritylowSeverityminor 
Status assignedResolutionopen 
Target VersionUnscheduled 
Summary0027125: Crashes in BRepFilletAPI_MakeFillet
DescriptionWe have found some crashes in the fillet algorithm. The problematic area is the PerformOneCorner method, that has several problems. Currently I have reproduction for only one issue, and crash logs for many other. The reproduction for the other case is attached.

If I will find a reproduction for this case I will attach it, but I suppose they are somehow related.
Stack trace 1:

1
Crashed: AsyncProcessor
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
 raw
0 TKG2d
Geom2d_Curve::Value(double) const + 16
1
TKFillet
ChFi3d_Builder::PerformMoreThreeCorner(int, int) + 53440
2
TKFillet
ChFi3d_Builder::PerformIntersectionAtEnd(int) + 8000
3
TKFillet
ChFi3d_Builder::PerformOneCorner(int, unsigned int) + 4188
4
TKFillet
ChFi3d_Builder::PerformFilletOnVertex(int) + 1024
5
TKFillet
ChFi3d_Builder::Compute() + 1680
6 TKFillet
BRepFilletAPI_MakeFillet::Build() + 36


Steps To Reproducerestore shape.brep a
subshape a e 39
if {[catch {puts [blend r a 7.5 a_39]}]} {
  puts "Error: exception in blend"
}
TagsNo tags attached.
Test case number

Attached Files

  • main.cpp (505,946 bytes)
  • shape.brep (504,845 bytes)
  • fds.brep (744,528 bytes)

Activities

Istvan Csanady

2016-02-01 12:40

developer  

main.cpp (505,946 bytes)

abv

2016-02-01 12:54

manager   ~0050281

Hello Istvan, do you observe this issue on iOS / OS X only (with CLang), or on some another platform?

Istvan Csanady

2016-02-01 12:56

developer   ~0050282

Clang + iOS/Mac

Istvan Csanady

2016-02-01 13:15

developer   ~0050287

Have you tried the repro code I attached on Windows?

msv

2016-02-01 16:16

developer   ~0050309

I have reproduced the problem in main.cpp. I have got access violation signal. However the stack is slightly another:

> TKG2d.dll!Geom2d_Curve::Value(const double U) Line 88 C++
     TKFillet.dll!ChFi3d_Builder::PerformOneCorner(const int Index, const unsigned int thePrepareOnSame) Line 1249 C++
     TKFillet.dll!ChFi3d_Builder::PerformFilletOnVertex(const int Index) Line 747 C++
     TKFillet.dll!ChFi3d_Builder::Compute() Line 303 C++
     TKFillet.dll!BRepFilletAPI_MakeFillet::Build() Line 534 C++

When running this algorithm under Draw the exception is caught by try/catch block in the method ChFi3d_Builder::Compute(), and therefore it does not lead to application crash. It is because of call to OSD::SetSignal() method in main thread function of Draw application.

It is interesting if SetSignal can do its work under iOS. This could be a good work around crashes on this platform.

Meanwhile, this is a bug and the cause of calling Value() of null pcurve should be investigated.

msv

2016-02-01 16:17

developer  

shape.brep (504,845 bytes)

msv

2016-02-01 16:18

developer   ~0050310

I have put the draw script in steps to reproduce.

Istvan Csanady

2016-02-02 09:09

developer   ~0050326

Another similar issue:

8
Crashed: AsyncProcessor
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
 raw
0
TKFillet
ChFi3d_FilBuilder_C2.cxx line 520
ChFi3d_FilBuilder::PerformTwoCorner(int)
1
TKFillet
ChFi3d_Builder.cxx line 758
ChFi3d_Builder::PerformFilletOnVertex(int)
2
TKFillet
ChFi3d_Builder.cxx line 298
ChFi3d_Builder::Compute()
3
TKFillet
BRepFilletAPI_MakeFillet.cxx line 533
BRepFilletAPI_MakeFillet::Build()

Istvan Csanady

2016-02-02 09:11

developer   ~0050327

SImilar problems happen with chamfers:

10
Crashed: AsyncProcessor
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000060
 raw
0
TKBRep
NCollection_TListIterator.hxx line 44
BRep_Tool::CurveOnSurface(TopoDS_Edge const&, opencascade::handle<Geom_Surface> const&, TopLoc_Location const&, double&, double&)
1
TKBRep
Standard_Handle.hxx line 78
BRep_Tool::CurveOnSurface(TopoDS_Edge const&, TopoDS_Face const&, double&, double&)
2
TKBRep
BRepAdaptor_Curve2d.cxx line 56
BRepAdaptor_Curve2d::Initialize(TopoDS_Edge const&, TopoDS_Face const&)
3
TKFillet
Standard_Handle.hxx line 114
ChFi3d_Builder::StartSol(opencascade::handle<ChFiDS_Spine> const&, opencascade::handle<BRepAdaptor_HSurface>&, gp_Pnt2d&, opencascade::handle<BRepAdaptor_HCurve2d>&, double&, opencascade::handle<ChFiDS_SurfData> const&, unsigned int, int, opencascade::handle<BRepAdaptor_HSurface>&, opencascade::handle<BRepAdaptor_HCurve2d>&, unsigned int&, unsigned int&, unsigned int&, unsigned int&, opencascade::handle<BRepAdaptor_HSurface>&, gp_Pnt2d&, unsigned int, TopoDS_Vertex const&) const
4
TKFillet
ChFi3d_Builder_2.cxx line 1964
ChFi3d_Builder::PerformSetOfSurfOnElSpine(opencascade::handle<ChFiDS_HElSpine> const&, opencascade::handle<ChFiDS_Stripe>&, opencascade::handle<BRepTopAdaptor_TopolTool>&, opencascade::handle<BRepTopAdaptor_TopolTool>&, unsigned int)
5
TKFillet
NCollection_BaseList.hxx line 53
ChFi3d_Builder::PerformSetOfKGen(opencascade::handle<ChFiDS_Stripe>&, unsigned int)
6
TKFillet
ChFi3d_Builder_2.cxx line 2980
ChFi3d_Builder::PerformSetOfSurf(opencascade::handle<ChFiDS_Stripe>&, unsigned int)
7
TKFillet
ChFi3d_Builder.cxx line 268
ChFi3d_Builder::Compute()
8
TKFillet
BRepFilletAPI_MakeChamfer.cxx line 389
BRepFilletAPI_MakeChamfer::Build()

Istvan Csanady

2016-02-02 09:13

developer   ~0050328

Not sure if this is related, but can be (bad_alloc, and the user had lots of memory left)

9 libc++abi.dylib
std::__terminate(void (*)()) + 16
10
libc++abi.dylib
__cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 134
11 libc++abi.dylib
operator new(unsigned long) + 96
12
TKG3d
NCollection_Array1.hxx line 165
Geom_BSplineCurve::Segment(double, double)
13
TKFillet
ChFi3d_Builder_0.cxx line 4258
ChFi3d_PerformElSpine(opencascade::handle<ChFiDS_HElSpine>&, opencascade::handle<ChFiDS_Spine>&, GeomAbs_Shape, double)
14
TKFillet
NCollection_BaseList.hxx line 53
ChFi3d_Builder::PerformSetOfKPart(opencascade::handle<ChFiDS_Stripe>&, unsigned int)
15
TKFillet
ChFi3d_Builder_2.cxx line 2973
ChFi3d_Builder::PerformSetOfSurf(opencascade::handle<ChFiDS_Stripe>&, unsigned int)
16
TKFillet
ChFi3d_Builder.cxx line 268
ChFi3d_Builder::Compute()
17
TKFillet
BRepFilletAPI_MakeChamfer.cxx line 389
BRepFilletAPI_MakeChamfer::Build()

Matthias

2020-05-15 22:29

developer   ~0092167

Last edited: 2020-05-15 22:30

Just encountered the same reported issue on OCCT 7.3.0 and 7.4.0.

In DRAW:
restore fds.brep
explode fds E
if {[catch {puts [blend r fds 3.2 fds_6 3.2 fds_10]}]} {puts "Error: exception in blend"}

The try/catch block in the method ChFi3d_Builder::Compute() does not catch one of the occuring exceptions (there is a for-loop, where multiple exceptions are raised in this example). With fillet-radius 2.0 (instead of 3.2) the occuring exceptions are catched by the try/catch block.

However, the exceptions seem to be handled in DRAW always.

Matthias

2020-05-15 22:29

developer  

fds.brep (744,528 bytes)

Issue History

Date Modified Username Field Change
2016-02-01 12:39 Istvan Csanady New Issue
2016-02-01 12:39 Istvan Csanady Assigned To => msv
2016-02-01 12:40 Istvan Csanady File Added: main.cpp
2016-02-01 12:54 abv Note Added: 0050281
2016-02-01 12:56 Istvan Csanady Note Added: 0050282
2016-02-01 13:15 Istvan Csanady Note Added: 0050287
2016-02-01 16:16 msv Note Added: 0050309
2016-02-01 16:17 msv File Added: shape.brep
2016-02-01 16:18 msv Note Added: 0050310
2016-02-01 16:18 msv Steps to Reproduce Updated
2016-02-01 16:19 msv Assigned To msv => jgv
2016-02-01 16:19 msv Status new => assigned
2016-02-02 09:09 Istvan Csanady Note Added: 0050326
2016-02-02 09:11 Istvan Csanady Note Added: 0050327
2016-02-02 09:13 Istvan Csanady Note Added: 0050328
2016-02-02 10:15 msv Priority normal => low
2016-10-28 15:33 msv Target Version 7.1.0 => 7.2.0
2017-07-21 11:34 msv Target Version 7.2.0 => 7.3.0
2017-12-05 17:09 msv Target Version 7.3.0 => 7.4.0
2019-08-12 16:44 msv Target Version 7.4.0 => 7.5.0
2020-05-15 22:29 Matthias Note Added: 0092167
2020-05-15 22:29 Matthias File Added: fds.brep
2020-05-15 22:30 Matthias Note Edited: 0092167
2020-09-15 16:22 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:54 msv Target Version 7.6.0 => 7.7.0
2022-10-24 10:41 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:08 dpasukhi Target Version 7.8.0 => Unscheduled