MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027125Community[OCCT] OCCT:Modeling Algorithmspublic2016-02-01 12:392017-12-05 17:09
ReporterIstvan Csanady 
Assigned Tojgv 
PrioritylowSeverityminor 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
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 Filescpp file icon main.cpp (505,946 bytes) 2016-02-01 12:40
? file icon shape.brep (504,845 bytes) 2016-02-01 16:17

- Relationships

-  Notes
(0050281)
abv (manager)
2016-02-01 12:54

Hello Istvan, do you observe this issue on iOS / OS X only (with CLang), or on some another platform?
(0050282)
Istvan Csanady (developer)
2016-02-01 12:56

Clang + iOS/Mac
(0050287)
Istvan Csanady (developer)
2016-02-01 13:15

Have you tried the repro code I attached on Windows?
(0050309)
msv (developer)
2016-02-01 16:16

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.
(0050310)
msv (developer)
2016-02-01 16:18

I have put the draw script in steps to reproduce.
(0050326)
Istvan Csanady (developer)
2016-02-02 09:09

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()
(0050327)
Istvan Csanady (developer)
2016-02-02 09:11

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()
(0050328)
Istvan Csanady (developer)
2016-02-02 09:13

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()

- 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 View Revisions
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*


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker