MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025699Community[OCCT] OCCT:Data Exchangepublic2015-01-13 13:402015-05-14 15:32
Reporterventu 
Assigned Tobugmaster 
PrioritynormalSeveritycrash 
StatusclosedResolutionfixed 
PlatformAnyOSAnyOS VersionAny
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 6.9.0Fixed in Version[OCCT] 6.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 Filespatch file icon step.patch (3,775 bytes) 2015-01-17 19:40

- Relationships

-  Notes
(0036068)
gka (developer)
2015-01-14 18:31

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.
(0036141)
ventu (reporter)
2015-01-16 13:23

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?
(0036149)
gka (developer)
2015-01-16 15:37

Yuo can see in class StepToTopoDS_TranslateCompositeCurve.cxx
(0036178)
ventu (reporter)
2015-01-17 19:40

Would the patch I attached be ok?
Thanks.
(0036691)
gka (developer)
2015-01-27 11:26

Attached patch is OK.
Thanks.
(0036812)
git (administrator)
2015-01-29 13:38

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.
(0036816)
akz (developer)
2015-01-29 14:02

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
(0036819)
abv (manager)
2015-01-29 14:12

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).
(0036837)
git (administrator)
2015-01-29 15:53

Branch CR25699 has been updated forcibly by akz.

SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2
(0036838)
akz (developer)
2015-01-29 15:55

Branch CR25699 is ready to be reviewed.
(0036874)
gka (developer)
2015-01-30 10:27

Besides it is desirable to add checks to avoid exception in the method StepToGeom_MakeCurve::Convert().
(0037257)
git (administrator)
2015-02-09 19:16

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.
(0037258)
git (administrator)
2015-02-09 19:17

Branch CR25699 has been deleted by akz.

SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2
(0037259)
akz (developer)
2015-02-09 19:17

Branch CR25699_1 is ready to be reviewed.
(0037274)
gka (developer)
2015-02-10 12:04

Branch CR25699_1 is ready to be tested
(0037446)
apv (tester)
2015-02-12 15:41

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
(0037453)
git (administrator)
2015-02-12 16:36

Branch CR25699_1 has been updated forcibly by akz.

SHA-1: 71871c5913f4c94e0fc968e6eac227f45c0d900f
(0037454)
git (administrator)
2015-02-12 16:41

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

(0037457)
git (administrator)
2015-02-12 16:46

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
(0037458)
git (administrator)
2015-02-12 16:46

Branch CR25699_1 has been deleted by akz.

SHA-1: fd2e5d4cf66f37468ccf0290da42414fb082d40e
(0037459)
akz (developer)
2015-02-12 16:51
edited on: 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.

(0037461)
gka (developer)
2015-02-12 16:57

Branch CR25699 can be integrated
(0037503)
git (administrator)
2015-02-13 13:09

Branch CR25699_2 has been updated forcibly by apn.

SHA-1: c7f9d7025b5fddfb0ab8963717a88b0a5d1d4c12
(0037504)
git (administrator)
2015-02-13 13:11

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

(0037515)
git (administrator)
2015-02-13 15:55

Branch CR25699_2 has been updated forcibly by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39
(0037533)
git (administrator)
2015-02-13 18:25

Branch CR25699_3 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.
(0037534)
git (administrator)
2015-02-13 18:26

Branch CR25699_4 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.
(0037535)
git (administrator)
2015-02-13 18:27

Branch CR25699_5 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.
(0037536)
git (administrator)
2015-02-13 18:28

Branch CR25699_6 has been created by apn.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39


No new revisions were added by this update.
(0038543)
git (administrator)
2015-03-18 13:35

Branch CR25699_2 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39
(0038544)
git (administrator)
2015-03-18 13:35

Branch CR25699_3 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39
(0038545)
git (administrator)
2015-03-18 13:35

Branch CR25699_4 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39
(0038546)
git (administrator)
2015-03-18 13:35

Branch CR25699_5 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39
(0038547)
git (administrator)
2015-03-18 13:35

Branch CR25699_6 has been deleted by inv.

SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39

- Related Changesets
occt: master d088c9c2
Timestamp: 2015-02-13 13:34:08
Author: 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
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 View Revisions
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 View Revisions
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 user533 Status verified => closed
2015-05-14 15:32 user533 Fixed in Version => 6.9.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker