View Issue Details

IDProjectCategoryView StatusLast Update
0027330CommunityOCCT:Data Exchangepublic2019-08-15 17:50
ReporterEpy Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0027330: StepToTopoDS_TranslateEdgeLoop::Init() may crash with certain STEP files
DescriptionQuoted from OCE bugtracker:

I experienced a crash in StepToTopoDS_TranslateEdgeLoop::Init() with certain STEP files containing unusual geometry (mine was created using a CAD model containing a cosmetic feature). The crash occurred at line 330:

StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);

It occurred because Vstart was undefined, and this was because curve C was null. To fix this, I added a else case to the existing test for a null curve and returned an error, instead of continuing. My new code looks like this (with commented-out code removed):

if (!C.IsNull()){
  if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve))) {
    Handle(StepGeom_SurfaceCurve) Sc = Handle(StepGeom_SurfaceCurve)::DownCast(C);
    C = Sc->Curve3d();
  }
}
else {
    TP->AddWarning(EL,"Null Curve.");
    done = Standard_False;
    return;
}
Please find attached a simple STEP file that demonstrates the crash.
TagsNo tags attached.
Test case numberNot required

Attached Files

  • crash.zip (14,696 bytes)

Activities

Epy

2016-03-31 20:13

developer  

crash.zip (14,696 bytes)

broesdecatFM

2017-01-10 18:20

reporter   ~0062466

I had a similar issue with a .step file on occt 7.1.0.
In some cases, either EC->EdgeStart or EC->EdgeEnd or both can apparently be NULL.
The above workaround did not solve all crashes following from it.
I now added the above escape, and additional escape if EdgeStart or EdgeEnd is null and apparently also the downcast to an EC edgeCurve fails in some cases...

Unfortunately, also my step file is proprietary. It is also quite large and not made by me. However, if there is some way to find out which part of the step file is causing the crashes, i could probably send it in its isolation.

ika

2019-07-11 16:10

developer   ~0085603

Last edited: 2019-07-11 16:10

Dear bugmaster,

The same case with invalid null vertices in STEP entity (example from file: 1747=EDGE_CURVE('',#0,#0,#0,.T.);) was solved in 0028445 and not reproduced now.

Issue History

Date Modified Username Field Change
2016-03-31 20:13 Epy New Issue
2016-03-31 20:13 Epy Assigned To => gka
2016-03-31 20:13 Epy File Added: crash.zip
2016-06-15 15:48 abv Assigned To gka => ika
2016-06-15 15:48 abv Status new => assigned
2016-10-26 18:23 gka Target Version 7.1.0 => 7.2.0
2017-01-10 18:20 broesdecatFM Note Added: 0062466
2017-01-10 18:21 broesdecatFM Assigned To ika => broesdecatFM
2017-01-10 18:21 broesdecatFM Assigned To broesdecatFM => ika
2017-07-27 10:38 abv Target Version 7.2.0 => 7.4.0
2019-07-11 16:10 ika Note Added: 0085603
2019-07-11 16:10 ika Assigned To ika => bugmaster
2019-07-11 16:10 ika Status assigned => feedback
2019-07-11 16:10 ika Note Edited: 0085603
2019-07-17 14:31 bugmaster Status feedback => verified
2019-07-17 14:31 bugmaster Resolution open => fixed
2019-07-17 14:31 bugmaster Target Version 7.4.0 => 7.5.0
2019-07-17 15:42 bugmaster Target Version 7.5.0 => 7.4.0
2019-08-15 17:50 bugmaster Test case number => Not required