MantisBT - Community
View Issue Details
0027330Community[OCCT] OCCT:Data Exchangepublic2016-03-31 20:132019-08-15 17:50
[OCCT] 6.8.0 
[OCCT] 7.4.0 
Not required
0027330: StepToTopoDS_TranslateEdgeLoop::Init() may crash with certain STEP files
Quoted 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;
Please find attached a simple STEP file that demonstrates the crash.
No tags attached.
zip (14,696) 2016-03-31 20:13
Issue History
2016-03-31 20:13EpyNew Issue
2016-03-31 20:13EpyAssigned To => gka
2016-03-31 20:13EpyFile Added:
2016-06-15 15:48abvAssigned Togka => ika
2016-06-15 15:48abvStatusnew => assigned
2016-10-26 18:23gkaTarget Version7.1.0 => 7.2.0
2017-01-10 18:20broesdecatFMNote Added: 0062466
2017-01-10 18:21broesdecatFMAssigned Toika => broesdecatFM
2017-01-10 18:21broesdecatFMAssigned TobroesdecatFM => ika
2017-07-27 10:38abvTarget Version7.2.0 => 7.4.0
2019-07-11 16:10ikaNote Added: 0085603
2019-07-11 16:10ikaAssigned Toika => bugmaster
2019-07-11 16:10ikaStatusassigned => feedback
2019-07-11 16:10ikaNote Edited: 0085603bug_revision_view_page.php?bugnote_id=85603#r21503
2019-07-17 14:31bugmasterStatusfeedback => verified
2019-07-17 14:31bugmasterResolutionopen => fixed
2019-07-17 14:31bugmasterTarget Version7.4.0 => 7.5.0*
2019-07-17 15:42bugmasterTarget Version7.5.0* => 7.4.0
2019-08-15 17:50bugmasterTest case number => Not required

2017-01-10 18:20   
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.
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.