View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025699 | Community | OCCT:Data Exchange | public | 2015-01-13 13:40 | 2015-05-14 15:32 |
Reporter | ventu | Assigned To | bugmaster | ||
Priority | normal | Severity | crash | ||
Status | closed | Resolution | fixed | ||
Platform | Any | OS | Any | ||
Product Version | 6.8.0 | ||||
Target Version | 6.9.0 | Fixed in Version | 6.9.0 | ||
Summary | 0025699: Crash while importing STeP file | ||||
Description | Hello. 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 Reproduce | Not applicable | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
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. |
|
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? |
|
Yuo can see in class StepToTopoDS_TranslateCompositeCurve.cxx |
|
step.patch (3,775 bytes) |
|
Would the patch I attached be ok? Thanks. |
|
Attached patch is OK. Thanks. |
|
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. |
|
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 |
|
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). |
|
Branch CR25699 has been updated forcibly by akz. SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2 |
|
Branch CR25699 is ready to be reviewed. |
|
Besides it is desirable to add checks to avoid exception in the method StepToGeom_MakeCurve::Convert(). |
|
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. |
|
Branch CR25699 has been deleted by akz. SHA-1: a7e26f2586ba46eeac032bc742c596cc42a594b2 |
|
Branch CR25699_1 is ready to be reviewed. |
|
Branch CR25699_1 is ready to be tested |
|
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 |
|
Branch CR25699_1 has been updated forcibly by akz. SHA-1: 71871c5913f4c94e0fc968e6eac227f45c0d900f |
|
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 |
|
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 |
|
Branch CR25699_1 has been deleted by akz. SHA-1: fd2e5d4cf66f37468ccf0290da42414fb082d40e |
|
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. |
|
Branch CR25699 can be integrated |
|
Branch CR25699_2 has been updated forcibly by apn. SHA-1: c7f9d7025b5fddfb0ab8963717a88b0a5d1d4c12 |
|
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 |
|
Branch CR25699_2 has been updated forcibly by apn. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
|
Branch CR25699_3 has been created by apn. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 No new revisions were added by this update. |
|
Branch CR25699_4 has been created by apn. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 No new revisions were added by this update. |
|
Branch CR25699_5 has been created by apn. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 No new revisions were added by this update. |
|
Branch CR25699_6 has been created by apn. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 No new revisions were added by this update. |
|
Branch CR25699_2 has been deleted by inv. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
|
Branch CR25699_3 has been deleted by inv. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
|
Branch CR25699_4 has been deleted by inv. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
|
Branch CR25699_5 has been deleted by inv. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
|
Branch CR25699_6 has been deleted by inv. SHA-1: 8d1d3afb1c96327997d4d5790427fad4419afc39 |
occt: master d088c9c2 2015-02-13 13:34:08
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 |
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 |
|
Note Added: 0036068 | |
2015-01-16 10:22 |
|
Assigned To | gka => ventu |
2015-01-16 10:22 |
|
Status | new => feedback |
2015-01-16 13:23 | ventu | Note Added: 0036141 | |
2015-01-16 15:37 |
|
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 |
|
Assigned To | ventu => gka |
2015-01-27 11:11 |
|
Status | feedback => assigned |
2015-01-27 11:26 |
|
Note Added: 0036691 | |
2015-01-27 11:32 |
|
Assigned To | gka => akz |
2015-01-29 13:38 | git | Note Added: 0036812 | |
2015-01-29 14:02 |
|
Note Added: 0036816 | |
2015-01-29 14:02 |
|
Assigned To | akz => gka |
2015-01-29 14:02 |
|
Status | assigned => resolved |
2015-01-29 14:02 |
|
Steps to Reproduce Updated | |
2015-01-29 14:12 |
|
Note Added: 0036819 | |
2015-01-29 15:05 |
|
Assigned To | gka => akz |
2015-01-29 15:05 |
|
Status | resolved => assigned |
2015-01-29 15:53 | git | Note Added: 0036837 | |
2015-01-29 15:54 |
|
Assigned To | akz => gka |
2015-01-29 15:54 |
|
Status | assigned => resolved |
2015-01-29 15:55 |
|
Note Added: 0036838 | |
2015-01-30 10:27 |
|
Note Added: 0036874 | |
2015-02-03 16:38 |
|
Assigned To | gka => akz |
2015-02-03 16:38 |
|
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 |
|
Note Added: 0037259 | |
2015-02-09 19:17 |
|
Assigned To | akz => gka |
2015-02-09 19:17 |
|
Status | assigned => resolved |
2015-02-10 12:04 |
|
Note Added: 0037274 | |
2015-02-10 12:04 |
|
Assigned To | gka => bugmaster |
2015-02-10 12:04 |
|
Status | resolved => reviewed |
2015-02-10 13:01 |
|
Assigned To | bugmaster => apv |
2015-02-12 15:41 |
|
Note Added: 0037446 | |
2015-02-12 15:41 |
|
Assigned To | apv => akz |
2015-02-12 15:41 |
|
Status | reviewed => assigned |
2015-02-12 15:42 |
|
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 |
|
Note Added: 0037459 | |
2015-02-12 16:51 |
|
Assigned To | akz => gka |
2015-02-12 16:51 |
|
Status | assigned => resolved |
2015-02-12 16:51 |
|
Note Edited: 0037459 | |
2015-02-12 16:57 |
|
Note Added: 0037461 | |
2015-02-12 16:57 |
|
Assigned To | gka => bugmaster |
2015-02-12 16:57 |
|
Status | resolved => reviewed |
2015-02-12 16:59 |
|
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 |
|
Status | verified => closed |
2015-05-14 15:32 |
|
Fixed in Version | => 6.9.0 |