MantisBT - Community
View Issue Details
0032314Community[OCCT] OCCT:Data Exchangepublic2021-04-21 16:402021-05-01 13:32
Tilo Pfliegner 
bugmaster 
normalcrash 
verifiedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.3.0 
[OCCT] 7.6.0* 
Not required
0032314: Data Exchange - Reading corrupted STEP files crashes
When importing a (deliberately) corrupted STEP file (see attached file), STEPControl_Reader crashes in TransferRoots().
pload XDE OCAF
dsetsignal unset
testreadstep corrupted.stp s
ReadStep D corrupted.stp


The following lines of code produce this error:
    STEPControl_Reader reader;
    IFSelect_ReturnStatus result =  reader.ReadFile("corrupted.stp"); // returns "Done" 
with a few errors
    reader.TransferRoots(); // crashes


The root cause seems to be dereferencing a nullptr (directionRatios) in this method:
Standard_Integer StepGeom_Direction::NbDirectionRatios () const
{
    return directionRatios->Length();
}


However, I am not sure, what the correct solution would look like. Probably it would be best to return IFSelect_RetError from ReadFile(...) in these cases.
No tags attached.
? corrupted.stp (241,634) 2021-04-21 16:40
https://tracker.dev.opencascade.org/
Issue History
2021-04-21 16:40Tilo PfliegnerNew Issue
2021-04-21 16:40Tilo PfliegnerAssigned To => gka
2021-04-21 16:40Tilo PfliegnerFile Added: corrupted.stp
2021-04-22 11:31kgvTarget Version => 7.6.0*
2021-04-22 11:31kgvSummaryReading corrupted STEP files crashes OpenCascade => Data Exchange - Reading corrupted STEP files crashes
2021-04-22 11:31kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25080#r25080
2021-04-22 11:35kgvAssigned Togka => dpasukhi
2021-04-22 11:35kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25081#r25081
2021-04-28 11:57gitNote Added: 0100635
2021-04-28 14:31gitNote Added: 0100639
2021-04-28 14:31dpasukhiStatusnew => assigned
2021-04-28 14:36dpasukhiNote Added: 0100640
2021-04-28 14:36dpasukhiAssigned Todpasukhi => ika
2021-04-28 14:36dpasukhiStatusassigned => resolved
2021-04-28 14:46ikaNote Added: 0100641
2021-04-28 14:46ikaAssigned Toika => bugmaster
2021-04-28 14:46ikaStatusresolved => reviewed
2021-05-01 12:27bugmasterNote Added: 0100719
2021-05-01 12:27bugmasterStatusreviewed => tested
2021-05-01 12:38bugmasterTest case number => Not required
2021-05-01 12:44bugmasterChangeset attached => occt master 36fbf05b
2021-05-01 12:44bugmasterStatustested => verified
2021-05-01 12:44bugmasterResolutionopen => fixed
2021-05-01 13:32gitNote Added: 0100738

Notes
(0100635)
git   
2021-04-28 11:57   
Branch CR32314 has been created by dpasukhi.

SHA-1: 1fb9c4a00fb1655a4dba6fe2ce2464bacd504a66


Detailed log of new commits:

Author: dpasukhi
Date: Wed Apr 28 11:53:40 2021 +0300

    0032314: Data Exchange - Reading corrupted STEP files crashes
    
    RWAxis2Placement3d:
     fixed problem with reading parameters ( if sub-entity invalid, set has-parameter to false )
(0100639)
git   
2021-04-28 14:31   
Branch CR32314 has been updated forcibly by dpasukhi.

SHA-1: c5339c7f033d2283dfa39f7e741e26313944a53f
(0100640)
dpasukhi   
2021-04-28 14:36   
Deak ika,
please review CR32314

All test are ok, see
http://jenkins-test-08.nnov.opencascade.com/view/CR32314-master-dpasukhi/view/COMPARE/ [^]
(0100641)
ika   
2021-04-28 14:46   
No remarks.

Dear bugmaster,
please integrate
OCCT - CR32314
Products - NOT
(0100719)
bugmaster   
2021-05-01 12:27   
Combination -
OCCT branch : master
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17839.600000000362 / 17844.450000000477 [-0.03%]
Products
Total CPU difference: 11562.480000000109 / 11558.800000000136 [+0.03%]
Windows-64-VC14:
OCCT
Total CPU difference: 19303.28125 / 19431.828125 [-0.66%]
Products
Total CPU difference: 12894.515625 / 12871.203125 [+0.18%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0100738)
git   
2021-05-01 13:32   
Branch CR32314 has been deleted by inv.

SHA-1: c5339c7f033d2283dfa39f7e741e26313944a53f