Archived issue #0031041
Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
Description
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.[revision removed]-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.
double tol = 6.[revision removed]-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.
Steps to reproduce
restore Attachment 1 (BREP) loc
restore Attachment 2 (BREP) pr
restore Attachment 2 (BREP) sp
mksweep sp
addsweep pr loc
buildsweep r -C
restore Attachment 2 (BREP) pr
restore Attachment 2 (BREP) sp
mksweep sp
addsweep pr loc
buildsweep r -C
Public activity
17 archived notes
Participants are labeled by their role within this record.
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.
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.
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();
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();
Reminder sent to: msv
I'll look at it soon. Just too much urgent work currently.
I have added in steps to reproduce the draw script corresponding to the code snippet.
Now it gives access violation exception.
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).
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Wed Jun 19 17:21:41 2024 +0100
0031041: Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
Removed unnecessary vertex initialization that caused the problem,
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Wed Jun 19 17:21:41 2024 +0100
0031041: Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
Removed unnecessary vertex initialization that caused the problem,
Looks like it is not unnecessary. It can be used below.
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Fixed. The initialization moved to another place.
TheV is always null.
The exception still will be in case if Vertex is null.
And there are still some possible crashes in case of empty vertex
Need to redesign solution.
The exception still will be in case if Vertex is null.
And there are still some possible crashes in case of empty vertex
Need to redesign solution.
if(TheV.IsNull())
+ {
Place.Perform(Precision::Confusion());
- else {
- Place.Perform(SearchParam(myLaw, Ind1, TheV),
- Precision::Confusion());
+ TheV = TopoDS::Vertex(Vertex);
+ }
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
I'm sorry, when I say is always null. I was meaning, if when it going to null in function, it never updated.
In most cases it is not null
In most cases it is not null
I reorganized the code.
Related records