MantisBT - Community
View Issue Details
0031041Community[OCCT] OCCT:Modeling Algorithmspublic2019-10-07 11:452021-09-14 16:51
denix56 
jgv 
normalcrash 
assignedopen 
MSVC 2017 x64Windows10
[OCCT] 7.4.0 
 
0031041: Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
The following code causes access to null shape and as a result - crash. I think it was caused by 0029204: BRepOffsetAPI_MakePipeShell produces invalid result and raises exception in Draw

double tol = 6.2377018066812730e-07;

sweep.SetTransitionMode(BRepBuilderAPI_TransitionMode::BRepBuilderAPI_RightCorner);
sweep.Add(profile, location, Standard_False, Standard_False);
sweep.SetTolerance(tol, tol);
sweep.Build();


The fix is to add in BRepFill_TrimShellCorner::ChooseSection check if firstedge and lastedge is null.
restore location.brep loc
restore profile.brep pr
restore profile.brep sp
mksweep sp
addsweep pr loc
buildsweep r -C
No tags attached.
related to 0032444new msv BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 
? profile.brep (1,069) 2019-10-07 11:45
https://tracker.dev.opencascade.org/
? location.brep (228) 2019-10-07 11:45
https://tracker.dev.opencascade.org/
? spine.brep (796) 2019-10-15 15:06
https://tracker.dev.opencascade.org/
Issue History
2019-10-07 11:45denix56New Issue
2019-10-07 11:45denix56Assigned To => msv
2019-10-07 11:45denix56File Added: profile.brep
2019-10-07 11:45denix56File Added: location.brep
2019-10-14 14:46msvNote Added: 0088105
2019-10-14 14:46msvAssigned Tomsv => denix56
2019-10-14 14:46msvStatusnew => feedback
2019-10-14 14:47msvNote Edited: 0088105bug_revision_view_page.php?bugnote_id=88105#r22041
2019-10-15 15:06denix56File Added: spine.brep
2019-10-15 15:10denix56Note Added: 0088137
2019-10-16 16:45denix56Note Added: 0088185
2019-10-16 18:54msvNote Added: 0088194
2019-10-17 17:20msvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22068#r22068
2019-10-17 17:21msvNote Added: 0088264
2019-10-17 17:22msvNote Added: 0088265
2019-10-17 17:22msvAssigned Todenix56 => jgv
2019-10-17 17:22msvStatusfeedback => assigned
2019-10-17 19:37denix56Note Added: 0088282
2019-12-17 13:48kgvSummaryCrash in BRepOffsetAPI_MakePipeShell => Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
2019-12-17 13:48kgvProduct Version => 7.4.0
2021-09-14 16:51msvRelationship addedrelated to 0032444

Notes
(0088105)
msv   
2019-10-14 14:46   
(edited on: 2019-10-14 14:47)
It seems the test case is incomplete. What are the parameters passed to the constructor of the algorithm? Where is the spine contour?

I would expect to reproduce the bug using the following draw script:

mksweep sp
addsweep pr loc
buildsweep r -C

The shape sp is missing in your input data.

(0088137)
denix56   
2019-10-15 15:10   
Sorry, forgot about it. I`ve uploaded the missing file

Here is the full code
BRepOffsetAPI_MakePipeShell sweep(spine);
sweep.SetTransitionMode(BRepBuilderAPI_TransitionMode::BRepBuilderAPI_RightCorner);
sweep.Add(profile, location, Standard_False, Standard_False);
sweep.SetTolerance(tol, tol);
sweep.Build();
(0088185)
denix56   
2019-10-16 16:45   
Reminder sent to: msv

(0088194)
msv   
2019-10-16 18:54   
I'll look at it soon. Just too much urgent work currently.
(0088264)
msv   
2019-10-17 17:21   
I have added in steps to reproduce the draw script corresponding to the code snippet.
(0088265)
msv   
2019-10-17 17:22   
Now it gives access violation exception.
(0088282)
denix56   
2019-10-17 19:37   
Correct, I have the same behavior. The reason is described in my first post. In some cases the method in BRepFill_TrimShellCorner returns null shape and we do not check if it is null. (We do it only in one of 3 places where the method is used).