MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029979Community[OCCT] OCCT:Data Exchangepublic2018-07-23 18:112019-09-07 16:27
Reporterborm 
Assigned Tobugmaster 
PrioritynormalSeveritycrash 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2015OS Version10
Product Version[OCCT] 7.2.0 
Target Version[OCCT] 7.4.0Fixed in Version[OCCT] 7.4.0 
Summary0029979: Data Exchange - Crash by reading STEP file
DescriptionHi, the OCCT crashes by reading the STEP file:

The crash callstack is:
>	TKSTEPBase.dll!StepShape_EdgeCurve::EdgeGeometry() Line 47	C++
     TKSTEP.dll!StepToTopoDS_TranslateEdgeLoop::Init(const opencascade::handle<StepShape_FaceBound> 
& FaceBound, const TopoDS_Face & Face, const opencascade::handle<Geom_Surface> & GeomSurf, 
const opencascade::handle<StepGeom_Surface> & StepSurf, const bool sameSense, StepToTopoDS_Tool 
& aTool, StepToTopoDS_NMTool & NMTool) Line 296	C++
     TKSTEP.dll!StepToTopoDS_TranslateFace::Init(const opencascade::handle<StepShape_FaceSurface> 
& FS, StepToTopoDS_Tool & aTool, StepToTopoDS_NMTool & NMTool) Line 330	C++
     TKSTEP.dll!StepToTopoDS_TranslateShell::Init(const opencascade::handle<StepShape_ConnectedFaceSet> 
& CFS, StepToTopoDS_Tool & aTool, StepToTopoDS_NMTool & NMTool) Line 93	C++
     TKSTEP.dll!StepToTopoDS_Builder::Init(const opencascade::handle<StepShape_ManifoldSolidBrep> 
& aManifoldSolid, const opencascade::handle<Transfer_TransientProcess> & TP) Line 210	C++
     
TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepGeom_GeometricRepresentationItem> 
& start, const opencascade::handle<Transfer_TransientProcess> & TP, const bool isManifold) 
Line 1229	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferShape(const opencascade::handle<Standard_Transient> 
& start, const opencascade::handle<Transfer_TransientProcess> & TP, const bool isManifold) 
Line 1499	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepShape_ShapeRepresentation> 
& sr, const opencascade::handle<Transfer_TransientProcess> & TP, bool & isBound) Line 
817	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepRepr_ShapeRepresentationRelationship> 
& und, const opencascade::handle<Transfer_TransientProcess> & TP, const int nbrep) Line 
1020	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepBasic_ProductDefinition> 
& PD, const opencascade::handle<Transfer_TransientProcess> & TP) Line 628	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepRepr_NextAssemblyUsageOccurrence> 
& NAUO, const opencascade::handle<Transfer_TransientProcess> & TP) Line 717	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferEntity(const opencascade::handle<StepBasic_ProductDefinition> 
& PD, const opencascade::handle<Transfer_TransientProcess> & TP) Line 549	C++
     TKSTEP.dll!STEPControl_ActorRead::TransferShape(const opencascade::handle<Standard_Transient> 
& start, const opencascade::handle<Transfer_TransientProcess> & TP, const bool isManifold) 
Line 1460	C++
     TKSTEP.dll!STEPControl_ActorRead::Transfer(const opencascade::handle<Standard_Transient> & 
start, const opencascade::handle<Transfer_TransientProcess> & TP) Line 300	C++
     TKXSBase.dll!Transfer_ActorOfTransientProcess::Transferring(const opencascade::handle<Standard_Transient> 
& ent, const opencascade::handle<Transfer_ProcessForTransient> & TP) Line 40	C++
     TKXSBase.dll!Transfer_ProcessForTransient::TransferProduct(const opencascade::handle<Standard_Transient> 
& start) Line 1160	C++
     TKXSBase.dll!Transfer_ProcessForTransient::Transferring(const opencascade::handle<Standard_Transient> 
& start) Line 1067	C++
     TKXSBase.dll!Transfer_ProcessForTransient::Transfer(const opencascade::handle<Standard_Transient> 
& start) Line 1189	C++
     TKXSBase.dll!Transfer_TransferOutput::Transfer(const opencascade::handle<Standard_Transient> 
& obj) Line 79	C++
     TKXSBase.dll!XSControl_TransferReader::TransferOne(const opencascade::handle<Standard_Transient> 
& ent, const bool rec) Line 816	C++
     TKXSBase.dll!XSControl_Reader::TransferEntity(const opencascade::handle<Standard_Transient> 
& start) Line 242	C++
     TKXSBase.dll!XSControl_Reader::TransferOneRoot(const int num) Line 216	C++
     TKXDESTEP.dll!STEPCAFControl_Reader::Transfer(STEPControl_Reader & reader, const int nroot, 
opencascade::handle<TDocStd_Document> & doc, NCollection_Sequence<TDF_Label> & Lseq, 
const bool asOne) Line 522	C++
     TKXDESTEP.dll!STEPCAFControl_Reader::Transfer(opencascade::handle<TDocStd_Document> & 
doc) Line 404	C++
     TKXDESTEP.dll!STEPCAFControl_Reader::Perform(const char * const filename, opencascade::handle<TDocStd_Document> 
& doc) Line 418	C++
Steps To ReproduceThe following code produces a crash:

Handle(TDocStd_Document) pOcctDoc;
Handle(XCAFApp_Application) pOcctApp = XCAFApp_Application::GetApplication();
pOcctApp->NewDocument("MDTV-XCAF", pOcctDoc);

STEPCAFControl_Reader stepReader;
stepReader.SetColorMode(Standard_True);
stepReader.SetNameMode(Standard_True);
const auto result = stepReader.Perform(fileName, pOcctDoc);
TagsNo tags attached.
Test case numberbugs/step/bug29979
Attached Files7z file icon Firetherm_12.7z (9,659,229 bytes) 2019-03-06 11:55

- Relationships
related to 0030541closedkgv Open CASCADE Draw Harness - impossible disabling signals 

-  Notes
(0082542)
kgv (developer)
2019-03-03 00:04

Referred file is inaccessible.
(0082701)
borm (reporter)
2019-03-05 18:59

Hi, the link works again. Please download the file as the link expires on 31.3.2019 again. Thanks.
(0082706)
kgv (developer)
2019-03-05 23:05
edited on: 2019-03-05 23:06

I'm unable reproducing the crash with the following script:
pload ALL
ReadStep D "Firetherm 12.STEP"
XShow D
vfit



Are there any extra input requisites?
Or maybe wrong OCCT version is specified?

(0082723)
borm (reporter)
2019-03-06 11:36

I'm not aware of the script code so I can comment just on the C++ code. The STEPCAFControl_Reader has to be used and the color and name mode must be set to true to reproduce the crash. I can still reproduce it with the OCCT 7.2.0 and I get the same crash callstack.
(0082724)
kgv (developer)
2019-03-06 11:45

OK, your application doesn't setup signals.

void StepToTopoDS_TranslateEdgeLoop::Init(
...
  for (j=1; j<=NbEdge; j++ ) {
    OrEdge1  = EL->EdgeListValue(j);
    StepEdge = OrEdge1->EdgeElement();
//    if(j>1 && StepEdge == StepEdge1) theSame++; //gka 15.12.98
    StepEdge1 = StepEdge;                         //
    Handle(StepShape_EdgeCurve) EC = Handle(StepShape_EdgeCurve)::DownCast(StepEdge);
    Handle(StepGeom_Curve) C = EC->EdgeGeometry();

EC becomes NULL here, because second edge in the loop is of type StepShape_OrientedEdge, not StepShape_EdgeCurve.
(0082725)
borm (reporter)
2019-03-06 11:56

Can you please elaborate more on your comment? What does it mean that the application doesn't setup signal? What we need to do?

Still even if we don't setup the signals the code should not crash.
(0083122)
kgv (developer)
2019-03-20 08:31

Existing test case bugs/step/bug26451 can be used for reproducing the issue.
(0085507)
abv (manager)
2019-07-09 14:44
edited on: 2019-07-09 15:10

Attached STEP file has several problems:

1. List of faces in CLOSED_SHELL # 103322 include 8 entities which are not faces, for instance, # 487310 which is ORIENTED_EDGE. Wrong entities in the list are those with indices 116, 123, 192, 230, 243, 289, 345, 399.

2. 10 entities of type ORIENTED_EDGE (# 148, # 333389, ...) refer to another ORIENTED_EDGE instead of EDGE_CURVE, which violates requirement WR1 or ORIENTED_EDGE entity.

Problem 2 is the one that causes exception (current code assumes that ORIENTED_EDGE contains EDGE_CURVE). Work-around against this problem can be implemented.

(0085509)
git (administrator)
2019-07-09 14:54

Branch CR29979 has been created by abv.

SHA-1: 585970baa7a2647c63932b726bc3d1c7aa61201e


Detailed log of new commits:

Author: abv
Date: Tue Jul 9 14:47:21 2019 +0300

    0029979: Data Exchange - Crash by reading STEP file
    
    Added work-around against specific problem of ORIENTED_EDGE referring to another ORIENTED_EDGE instead of EDGE_CURVE.
    Added handling of edges with null EDGE_CURVE, to allow passing the translation further instead of exception.
    
    Off-topic: text of warning message is corrected in genproj
(0085518)
git (administrator)
2019-07-09 16:41

Branch CR29979 has been updated by abv.

SHA-1: ec318219d7b6b153e18e447154751ee89ddca914


Detailed log of new commits:

Author: abv
Date: Tue Jul 9 16:40:15 2019 +0300

    Added test bugs step bug29979

(0085519)
abv (manager)
2019-07-09 16:50

Fix is pushed to CR29979, please review. Tests passed with no differences, see Jenkins job CR29979-master-abv. Note that test bugs step bug26451 is not related to this problem (even if similar errors are reported).
(0086913)
gka (developer)
2019-09-06 18:51

Branch CR29979 was reviewed
(0086952)
git (administrator)
2019-09-07 16:27

Branch CR29979 has been deleted by inv.

SHA-1: ec318219d7b6b153e18e447154751ee89ddca914

- Related Changesets
occt: master fa68c1e1
Timestamp: 2019-07-09 11:47:21
Author: abv
Committer: bugmaster
Details ] Diff ]
0029979: Data Exchange - Crash by reading STEP file

Added work-around against specific problem of ORIENTED_EDGE referring to another ORIENTED_EDGE instead of EDGE_CURVE.
Added handling of edges with null EDGE_CURVE, to allow passing the translation further instead of exception.

Off-topic: text of warning message is corrected in genproj

Added test bugs step bug29979
mod - adm/genproj.tcl Diff ] File ]
mod - src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx Diff ] File ]
add - tests/bugs/step/bug29979 Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-07-23 18:11 borm New Issue
2018-07-23 18:11 borm Assigned To => gka
2019-03-03 00:04 kgv Note Added: 0082542
2019-03-03 00:04 kgv Assigned To gka => borm
2019-03-03 00:04 kgv Status new => feedback
2019-03-05 18:59 borm Note Added: 0082701
2019-03-05 23:05 kgv Note Added: 0082706
2019-03-05 23:06 kgv Note Edited: 0082706 View Revisions
2019-03-06 10:25 kgv Resolution open => unable to reproduce
2019-03-06 11:36 borm Note Added: 0082723
2019-03-06 11:45 kgv Note Added: 0082724
2019-03-06 11:45 kgv Assigned To borm => gka
2019-03-06 11:45 kgv Status feedback => assigned
2019-03-06 11:45 kgv Resolution unable to reproduce => open
2019-03-06 11:45 kgv Target Version => 7.5.0*
2019-03-06 11:52 kgv Relationship added related to 0030541
2019-03-06 11:53 kgv Summary Crash by reading STEP file => Data Exchange - Crash by reading STEP file
2019-03-06 11:55 kgv File Added: Firetherm_12.7z
2019-03-06 11:56 kgv Description Updated View Revisions
2019-03-06 11:56 kgv Steps to Reproduce Updated View Revisions
2019-03-06 11:56 borm Note Added: 0082725
2019-03-06 12:05 kgv Relationship added related to 0030533
2019-03-20 08:31 kgv Note Added: 0083122
2019-03-20 08:31 kgv Steps to Reproduce Updated View Revisions
2019-07-09 14:44 abv Note Added: 0085507
2019-07-09 14:44 abv Target Version 7.5.0* => 7.4.0
2019-07-09 14:54 git Note Added: 0085509
2019-07-09 15:10 abv Note Edited: 0085507 View Revisions
2019-07-09 16:41 git Note Added: 0085518
2019-07-09 16:50 abv Note Added: 0085519
2019-07-09 16:50 abv Status assigned => resolved
2019-07-09 16:50 abv Steps to Reproduce Updated View Revisions
2019-09-06 18:51 gka Note Added: 0086913
2019-09-06 18:51 gka Assigned To gka => bugmaster
2019-09-06 18:51 gka Status resolved => reviewed
2019-09-06 18:56 bugmaster Test case number => bugs/step/bug29979
2019-09-07 11:38 bugmaster Changeset attached => occt master fa68c1e1
2019-09-07 11:38 bugmaster Status reviewed => verified
2019-09-07 11:38 bugmaster Resolution open => fixed
2019-09-07 16:27 git Note Added: 0086952


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker