View Issue Details

IDProjectCategoryView StatusLast Update
0025699CommunityOCCT:Data Exchangepublic2015-05-14 15:32
Reporterventu Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformAnyOSAny 
Product Version6.8.0 
Target Version6.9.0Fixed in Version6.9.0 
Summary0025699: Crash while importing STeP file
DescriptionHello.

I've got a file which crashes OpenCASCADE.
While the file is probably broken, I think a crash is not the best result in any case.

We are now running with the following patch, which avoids the crash.

--- StepToGeom_MakeBoundedCurve.cxx.bak 2014-11-07 16:16:46.000000000 +0100
+++ StepToGeom_MakeBoundedCurve.cxx 2015-01-13 11:33:03.000000000 +0100
@@ -148,6 +148,7 @@
     const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL =
       new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
     // Compute Knots and KnotsMultiplicity
+ if (RQUC->Degree()==0) return Standard_False;
     const Standard_Integer nbK = RQUC->NbControlPointsList() - RQUC->Degree() + 1;
     const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
     const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);



Of course this won't fix the original model.


Any opinion on this?
Steps To ReproduceNot applicable
TagsNo tags attached.
Test case numberNot needed

Attached Files

  • step.patch (3,775 bytes)

Activities

gka

2015-01-14 18:31

developer   ~0036068

In this case reason of exception is invalid curve written in file and your fix allows to avoid exception only for one particular case.

In all places except for StepToTopoDS_TranslateEdgeLoop where method StepToGeom_MakeCurve::Convert is called OCC_CATCH_SIGNALS to catch of exception is used. Seems that it will be better to add catching of exceptions in the StepToTopoDS_TranslateEdgeLoop method.

ventu

2015-01-16 13:23

reporter   ~0036141

Hello.
Thanks for your answer.
Forgive me, but I'm not so proficient about OpenCASCADE internals and I don't quite understand your answer.

I know my solution is but a dirty hack and I'm willing to help to find a better alternative, but I'm not able to code it, at least not without a suggestion.

Could you show me where to look for an example of a proper use of StepToGeom_MakeCurve::Convert?

gka

2015-01-16 15:37

developer   ~0036149

Yuo can see in class StepToTopoDS_TranslateCompositeCurve.cxx

ventu

2015-01-17 19:40

reporter  

step.patch (3,775 bytes)

ventu

2015-01-17 19:40

reporter   ~0036178

Would the patch I attached be ok?
Thanks.

gka

2015-01-27 11:26

developer   ~0036691

Attached patch is OK.
Thanks.

git

2015-01-29 13:38

administrator   ~0036812

Branch CR25699 has been created by akz.

SHA-1: 56aa434f7eb40e460f4d3a4ee2558184377da2ef


Detailed log of new commits:

Author: akz
Date: Thu Jan 29 13:25:51 2015 +0300

    0025699: Crash while importing STeP file
    
    Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to
    catch Standard_ConstructionError during the Curve conversion.

akz

2015-01-29 14:02

developer   ~0036816

I've add the try-catch block on a StepToGeom_MakeCurve::Convert function, but STEPControl_ActorRead::TransferEntity already has a try-catch block which cover this exception too. So i can't find a way to read Step file bypassing a STEPControl_ActorRead to reproduce crash

abv

2015-01-29 14:12

manager   ~0036819

The point is that access violation (access null pointer) will raise exception only if you have OCCT signal handler armed (by call to OSD_SetSignal()). It is not always done in actual applications, and sometimes it is just impossible (e.g. in .Net environment).

git

2015-01-29 15:53

administrator   ~0036837

Branch CR25699 has been updated forcibly by akz.

SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2

akz

2015-01-29 15:55

developer   ~0036838

Branch CR25699 is ready to be reviewed.

gka

2015-01-30 10:27

developer   ~0036874

Besides it is desirable to add checks to avoid exception in the method StepToGeom_MakeCurve::Convert().

git

2015-02-09 19:16

administrator   ~0037257

Branch CR25699_1 has been created by akz.

SHA-1: e1605d176063f564dd8be7bd30eed55457050d3d


Detailed log of new commits:

Author: akz
Date: Thu Jan 29 13:25:51 2015 +0300

    0025699: Crash while importing STeP file
    
    1) Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to
    catch Standard_ConstructionError during the Curve conversion.
    
    2) Checks of BSpline curve degree added to prevent construction error when converting edges to BSpline_Curve.
    3) Warning message was added in case of incorrect curve definition.

git

2015-02-09 19:17

administrator   ~0037258

Branch CR25699 has been deleted by akz.

SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2

akz

2015-02-09 19:17

developer   ~0037259

Branch CR25699_1 is ready to be reviewed.

gka

2015-02-10 12:04

developer   ~0037274

Branch CR25699_1 is ready to be tested

apv

2015-02-12 15:41

tester   ~0037446

Dear BugMaster,

Branch CR25699_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 11 (11 on master)
   Windows: 0 (1 on master)

Regressions/Differences:
http://occt-tests/CR25699-1-master-occt/Debian60-64/summary.html
http://occt-tests/CR25699-1-master-occt/Windows-32-VC10/summary.html
de step_1(004) R9
de step_2(005) G5

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 85960213 / 86213434
Total CPU difference: 49363.479999999865 / 47866.67999999985

Testing on Windows:
Total MEMORY difference: 40639696 / 40648590
Total CPU difference: 36894.0625 / 32747.6875

git

2015-02-12 16:36

administrator   ~0037453

Branch CR25699_1 has been updated forcibly by akz.

SHA-1: 71871c5913f4c94e0fc968e6eac227f45c0d900f

git

2015-02-12 16:41

administrator   ~0037454

Branch CR25699_1 has been updated by akz.

SHA-1: fd2e5d4cf66f37468ccf0290da42414fb082d40e


Detailed log of new commits:

Author: akz
Date: Thu Feb 12 16:41:20 2015 +0300

    Correct of the test cases according to the new error message added with fix

git

2015-02-12 16:46

administrator   ~0037457

Branch CR25699_2 has been created by akz.

SHA-1: 98f36045a3087dbef255a2b3bfd461b31076152f


Detailed log of new commits:

Author: akz
Date: Thu Feb 12 16:41:20 2015 +0300

    Correct of the test cases according to the new error message added with fix

git

2015-02-12 16:46

administrator   ~0037458

Branch CR25699_1 has been deleted by akz.

SHA-1: fd2e5d4cf66f37468ccf0290da42414fb082d40e

akz

2015-02-12 16:51

developer   ~0037459

Last edited: 2015-02-12 16:51

Branch CR25699_2 is ready to review

Dear BugMaster, the new error message was added with this fix. The tests with differences contain STEP files which produce new error in TPSTAT.
Last commit contains the changes with number of errors including the new error.

gka

2015-02-12 16:57

developer   ~0037461

Branch CR25699 can be integrated

git

2015-02-13 13:09

administrator   ~0037503

Branch CR25699_2 has been updated forcibly by apn.

SHA-1: c7f9d7025b5fddfb0ab8963717a88b0a5d1d4c12

git

2015-02-13 13:11

administrator   ~0037504

Branch CR25699_2 has been updated by apn.

SHA-1: e3c43ca7b137f320785663e8ca7a93ffb8ef1617


Detailed log of new commits:

Author: apn
Date: Fri Feb 13 13:11:11 2015 +0300

    Modified test cases according to new reference data

git

2015-02-13 15:55

administrator   ~0037515

Branch CR25699_2 has been updated forcibly by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

git

2015-02-13 18:25

administrator   ~0037533

Branch CR25699_3 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.

git

2015-02-13 18:26

administrator   ~0037534

Branch CR25699_4 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.

git

2015-02-13 18:27

administrator   ~0037535

Branch CR25699_5 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.

git

2015-02-13 18:28

administrator   ~0037536

Branch CR25699_6 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.

git

2015-03-18 13:35

administrator   ~0038543

Branch CR25699_2 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

git

2015-03-18 13:35

administrator   ~0038544

Branch CR25699_3 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

git

2015-03-18 13:35

administrator   ~0038545

Branch CR25699_4 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

git

2015-03-18 13:35

administrator   ~0038546

Branch CR25699_5 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

git

2015-03-18 13:35

administrator   ~0038547

Branch CR25699_6 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

Related Changesets

occt: master d088c9c2

2015-02-13 13:34:08

akz


Committer: bugmaster Details Diff
0025699: Crash while importing STeP file

1) Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to
catch Standard_ConstructionError during the Curve conversion.

2) Checks of BSpline curve degree added to prevent construction error when converting edges to BSpline_Curve.
3) Warning message was added in case of incorrect curve definition.

Correct of the test cases according to the new error message added with fix

Conflicts:
tests/de/step_1/R9

Modified test cases according to new reference data
Affected Issues
0025699
mod - src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx Diff File
mod - src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx Diff File
mod - tests/de/iges_3/A4 Diff File
mod - tests/de/step_1/R7 Diff File
mod - tests/de/step_2/G5 Diff File
mod - tests/de/step_2/H1 Diff File

Issue History

Date Modified Username Field Change
2015-01-13 13:40 ventu New Issue
2015-01-13 13:40 ventu Assigned To => gka
2015-01-14 18:31 gka Note Added: 0036068
2015-01-16 10:22 gka Assigned To gka => ventu
2015-01-16 10:22 gka Status new => feedback
2015-01-16 13:23 ventu Note Added: 0036141
2015-01-16 15:37 gka Note Added: 0036149
2015-01-17 19:40 ventu File Added: step.patch
2015-01-17 19:40 ventu Note Added: 0036178
2015-01-27 11:11 gka Assigned To ventu => gka
2015-01-27 11:11 gka Status feedback => assigned
2015-01-27 11:26 gka Note Added: 0036691
2015-01-27 11:32 gka Assigned To gka => akz
2015-01-29 13:38 git Note Added: 0036812
2015-01-29 14:02 akz Note Added: 0036816
2015-01-29 14:02 akz Assigned To akz => gka
2015-01-29 14:02 akz Status assigned => resolved
2015-01-29 14:02 akz Steps to Reproduce Updated
2015-01-29 14:12 abv Note Added: 0036819
2015-01-29 15:05 akz Assigned To gka => akz
2015-01-29 15:05 akz Status resolved => assigned
2015-01-29 15:53 git Note Added: 0036837
2015-01-29 15:54 akz Assigned To akz => gka
2015-01-29 15:54 akz Status assigned => resolved
2015-01-29 15:55 akz Note Added: 0036838
2015-01-30 10:27 gka Note Added: 0036874
2015-02-03 16:38 gka Assigned To gka => akz
2015-02-03 16:38 gka Status resolved => assigned
2015-02-09 19:16 git Note Added: 0037257
2015-02-09 19:17 git Note Added: 0037258
2015-02-09 19:17 akz Note Added: 0037259
2015-02-09 19:17 akz Assigned To akz => gka
2015-02-09 19:17 akz Status assigned => resolved
2015-02-10 12:04 gka Note Added: 0037274
2015-02-10 12:04 gka Assigned To gka => bugmaster
2015-02-10 12:04 gka Status resolved => reviewed
2015-02-10 13:01 mkv Assigned To bugmaster => apv
2015-02-12 15:41 apv Note Added: 0037446
2015-02-12 15:41 apv Assigned To apv => akz
2015-02-12 15:41 apv Status reviewed => assigned
2015-02-12 15:42 apv Test case number => Not needed
2015-02-12 16:36 git Note Added: 0037453
2015-02-12 16:41 git Note Added: 0037454
2015-02-12 16:46 git Note Added: 0037457
2015-02-12 16:46 git Note Added: 0037458
2015-02-12 16:51 akz Note Added: 0037459
2015-02-12 16:51 akz Assigned To akz => gka
2015-02-12 16:51 akz Status assigned => resolved
2015-02-12 16:51 akz Note Edited: 0037459
2015-02-12 16:57 gka Note Added: 0037461
2015-02-12 16:57 gka Assigned To gka => bugmaster
2015-02-12 16:57 gka Status resolved => reviewed
2015-02-12 16:59 mkv Assigned To bugmaster => apv
2015-02-13 13:09 git Note Added: 0037503
2015-02-13 13:11 git Note Added: 0037504
2015-02-13 15:55 git Note Added: 0037515
2015-02-13 17:55 bugmaster Changeset attached => occt master d088c9c2
2015-02-13 17:55 bugmaster Assigned To apv => bugmaster
2015-02-13 17:55 bugmaster Status reviewed => verified
2015-02-13 17:55 bugmaster Resolution open => fixed
2015-02-13 18:25 git Note Added: 0037533
2015-02-13 18:26 git Note Added: 0037534
2015-02-13 18:27 git Note Added: 0037535
2015-02-13 18:28 git Note Added: 0037536
2015-03-10 13:00 bugmaster Target Version => 6.9.0
2015-03-18 13:35 git Note Added: 0038543
2015-03-18 13:35 git Note Added: 0038544
2015-03-18 13:35 git Note Added: 0038545
2015-03-18 13:35 git Note Added: 0038546
2015-03-18 13:35 git Note Added: 0038547
2015-05-14 15:29 aiv Status verified => closed
2015-05-14 15:32 aiv Fixed in Version => 6.9.0