View Issue Details

IDProjectCategoryView StatusLast Update
0031041CommunityOCCT:Modeling Algorithmspublic2024-07-08 14:52
Reporterdenix56 Assigned Todpasukhi  
PrioritynormalSeveritycrash 
Status resolvedResolutionopen 
PlatformMSVC 2017 x64OSWindows 
Product Version7.4.0 
Summary0031041: Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
DescriptionThe 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.
Steps To Reproducerestore location.brep loc
restore profile.brep pr
restore profile.brep sp
mksweep sp
addsweep pr loc
buildsweep r -C
TagsNo tags attached.
Test case number

Attached Files

  • profile.brep (1,069 bytes)
  • location.brep (228 bytes)
  • spine.brep (796 bytes)

Relationships

related to 0032444 closedsmoskvin BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 

Activities

denix56

2019-10-07 11:45

reporter  

profile.brep (1,069 bytes)

denix56

2019-10-07 11:45

reporter  

location.brep (228 bytes)

msv

2019-10-14 14:46

developer   ~0088105

Last edited: 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.

denix56

2019-10-15 15:06

reporter  

spine.brep (796 bytes)

denix56

2019-10-15 15:10

reporter   ~0088137

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

denix56

2019-10-16 16:45

reporter   ~0088185

Reminder sent to: msv

msv

2019-10-16 18:54

developer   ~0088194

I'll look at it soon. Just too much urgent work currently.

msv

2019-10-17 17:21

developer   ~0088264

I have added in steps to reproduce the draw script corresponding to the code snippet.

msv

2019-10-17 17:22

developer   ~0088265

Now it gives access violation exception.

denix56

2019-10-17 19:37

reporter   ~0088282

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

git

2024-06-19 19:22

administrator   ~0116054

Branch CR31041 has been created by astromko.

SHA-1: 9c76f846abd57668c598166f88c75c3d901cd946


Detailed log of new commits:

Author: astromko
Date: Wed Jun 19 17:21:41 2024 +0100

    0031041: Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
    
    Removed unnecessary vertex initialization that caused the problem,

dpasukhi

2024-06-19 21:41

administrator   ~0116055

Looks like it is not unnecessary. It can be used below.

git

2024-06-20 13:01

administrator   ~0116057

Branch CR31041 has been updated forcibly by astromko.

SHA-1: 0f67a805014ea5c9aa370108887686e720130ce3

git

2024-06-20 13:04

administrator   ~0116058

Branch CR31041 has been updated forcibly by astromko.

SHA-1: 2092990f291c29cbb39360a9405ff5ef03af3738

astromko

2024-06-20 13:06

developer   ~0116059

Fixed. The initialization moved to another place.

dpasukhi

2024-07-08 12:38

administrator   ~0116134

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.
   if(TheV.IsNull())
+  {
     Place.Perform(Precision::Confusion());
-  else {
-    Place.Perform(SearchParam(myLaw, Ind1, TheV), 
-                 Precision::Confusion());    
+    TheV = TopoDS::Vertex(Vertex);
+  }

git

2024-07-08 14:45

administrator   ~0116135

Branch CR31041 has been updated forcibly by astromko.

SHA-1: e5f2b4bd62693e209cd03ed10c75f7cc3b90e54b

dpasukhi

2024-07-08 14:49

administrator   ~0116136

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

astromko

2024-07-08 14:52

developer   ~0116137

I reorganized the code.

Issue History

Date Modified Username Field Change
2019-10-07 11:45 denix56 New Issue
2019-10-07 11:45 denix56 Assigned To => msv
2019-10-07 11:45 denix56 File Added: profile.brep
2019-10-07 11:45 denix56 File Added: location.brep
2019-10-14 14:46 msv Note Added: 0088105
2019-10-14 14:46 msv Assigned To msv => denix56
2019-10-14 14:46 msv Status new => feedback
2019-10-14 14:47 msv Note Edited: 0088105
2019-10-15 15:06 denix56 File Added: spine.brep
2019-10-15 15:10 denix56 Note Added: 0088137
2019-10-16 16:45 denix56 Note Added: 0088185
2019-10-16 18:54 msv Note Added: 0088194
2019-10-17 17:20 msv Steps to Reproduce Updated
2019-10-17 17:21 msv Note Added: 0088264
2019-10-17 17:22 msv Note Added: 0088265
2019-10-17 17:22 msv Assigned To denix56 => jgv
2019-10-17 17:22 msv Status feedback => assigned
2019-10-17 19:37 denix56 Note Added: 0088282
2019-12-17 13:48 kgv Summary Crash in BRepOffsetAPI_MakePipeShell => Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell
2019-12-17 13:48 kgv Product Version => 7.4.0
2021-09-14 16:51 msv Relationship added related to 0032444
2024-01-30 12:32 dpasukhi Assigned To jgv => astromko
2024-06-19 19:22 git Note Added: 0116054
2024-06-19 21:41 dpasukhi Note Added: 0116055
2024-06-20 13:01 git Note Added: 0116057
2024-06-20 13:04 git Note Added: 0116058
2024-06-20 13:06 astromko Assigned To astromko => dpasukhi
2024-06-20 13:06 astromko Status assigned => resolved
2024-06-20 13:06 astromko Note Added: 0116059
2024-07-07 22:04 dpasukhi Assigned To dpasukhi => astromko
2024-07-07 22:04 dpasukhi Status resolved => assigned
2024-07-08 12:38 dpasukhi Note Added: 0116134
2024-07-08 14:45 git Note Added: 0116135
2024-07-08 14:49 dpasukhi Note Added: 0116136
2024-07-08 14:52 astromko Assigned To astromko => dpasukhi
2024-07-08 14:52 astromko Status assigned => resolved
2024-07-08 14:52 astromko Note Added: 0116137