MantisBT - Community
View Issue Details
0023938Community[OCCT] OCCT:Data Exchangepublic2013-04-26 17:242014-01-22 11:05
gdumonteil 
ika 
highcrash 
closedfixed 
x64Windows7
[OCCT] 6.6.0 
[OCCT] 6.7.0[OCCT] 6.7.0 
Not needed
0023938: Crash at StepToTopoDS_TranslateEdgeLoop::Init() &StepToTopoDS_TranslateEdge::Init()
When loading a STEP file from our client, we've got a crash at "StepToTopoDS_TranslateEdgeLoop::Init()".

First, we're reading a STEP file with STEPCAFControl_Reader::ReadFile() method.
Then, we're transfer it with the "Transfer" method.

The crash happen during the transfer procedure, at StepToTopoDS_TranslateEdgeLoop::Init(), especialy at the IsKind test: "if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve)))", line 294.
In our case, C seems to be NULL.

Just after at line 311, there is a nullity check of C: "if (!C.IsNull())".

To correct the crash, we add a nullity check before the call of the IsKind method:

if (!C.IsNull()) {
  if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve))) {

With this correction, we got another crash at "StepToTopoDS_TranslateEdge::Init()", here at line 311, when testing the kind of C: "if ( C->IsKind(STANDARD_TYPE(StepGeom_Pcurve)))"

We correct here also by cheking the nullity of C before calling the IsKind function:

if (!C.IsNull()) {
  if ( C->IsKind(STANDARD_TYPE(StepGeom_Pcurve))) {

With this, we're finally able to fully transfer the STEP file.


We didn't go inside OCCT to find why the EdgeGeometry of a specific StepShape_EdgeCurve is NULL. Maybe, somebody of the OCCT dev team can find a better way to correct this.
We can't share the STEP file from our client. The STEP file was exported from SolidWorks 2011.
No tags attached.
parent of 0024517closed bugmaster Crash at StepToTopoDS_TranslateEdge::Init() 
Issue History
2013-04-26 17:24gdumonteilNew Issue
2013-04-26 17:24gdumonteilAssigned To => gka
2013-05-08 15:28gkaAssigned Togka => ika
2013-05-08 15:28gkaStatusnew => assigned
2013-05-14 14:31ikaNote Added: 0024377
2013-05-14 14:31ikaAssigned Toika => gka
2013-05-14 14:31ikaStatusassigned => resolved
2013-05-14 14:56gkaNote Added: 0024378
2013-05-14 14:56gkaStatusresolved => reviewed
2013-05-15 16:25mkvNote Added: 0024402
2013-05-15 16:25mkvTest case number => Not needed
2013-05-15 16:25mkvAssigned Togka => bugmaster
2013-05-15 16:25mkvStatusreviewed => tested
2013-05-20 10:56ikaChangeset attached => occt master 2a141d40
2013-05-20 10:56ikaAssigned Tobugmaster => ika
2013-05-20 10:56ikaStatustested => verified
2013-05-20 10:56ikaResolutionopen => fixed
2013-05-20 16:55bugmasterTarget Version => 6.7.0
2013-12-19 13:53bugmasterStatusverified => closed
2013-12-19 13:55bugmasterFixed in Version => 6.7.0
2014-01-22 11:05mkvRelationship addedparent of 0024517

Notes
(0024377)
ika   
2013-05-14 14:31   
Necessary checks were added.

Branch CR23938 is ready to be reviewed.

Dear GKA,
Please review.
(0024378)
gka   
2013-05-14 14:56   
Branch CR23938 is ready to be tested.
(0024402)
mkv   
2013-05-15 16:25   
Dear BugMaster,

Branch CR23938 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 8c5342fb07ed2dacbc0da71ae4ac7f5e17905c54

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 365994864 / 366044616
Total CPU difference: 44238.650000001195 / 43849.82000000105

Testing on Windows:
Total MEMORY difference: 419426308 / 421413388
Total CPU difference: 38636.328125 / 32294.609375

There are not serious differences in images found by testdiff.