View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027357 | Community | OCCT:Modeling Algorithms | public | 2016-04-05 20:42 | 2016-12-09 16:38 |
Reporter | sraymond | Assigned To | bugmaster | ||
Priority | low | Severity | crash | ||
Status | closed | Resolution | reopened | ||
Platform | Windows | OS | VC++ 2015 | ||
Product Version | 7.0.0 | ||||
Target Version | 7.1.0 | Fixed in Version | 7.1.0 | ||
Summary | 0027357: Geom2dGcc_Circ2d2TanOn: check status of sub-algorithms to avoid exceptions | ||||
Description | When Geom2dGcc_Circ2d2TanOn is used in a loop it crash after a while when it's destroyed. This bug was reported here too. I don't get it with my mac version, the phenomena can't be reproduced with OC compiled with debug options. http://www.opencascade.com/content/bug-geom2dgcccirc2d2tanradgeo-geom2dgcccirc2d2tanrad | ||||
Steps To Reproduce | Here is an example showing how it crashes : TColgp_Array1OfPnt2d poles(1,3); poles.SetValue(1,gp_Pnt2d(0.,0.)); poles.SetValue(2,gp_Pnt2d(0.,1.)); poles.SetValue(3,gp_Pnt2d(6.,0.)); Handle(Geom2d_BezierCurve) curve1 = new Geom2d_BezierCurve(poles); poles.SetValue(2,gp_Pnt2d(0.,1.5)); Handle(Geom2d_BezierCurve) curve2 = new Geom2d_BezierCurve(poles); int nP = 100; int nFailed=0; for(int i = 0 ; i < nP ; i++){ double u = i / (nP-1.); gp_Pnt2d p1; gp_Vec2d tangent; curve1->D1(u,p1,tangent); gp_Vec2d normal(-tangent.Y(),tangent.X()); Handle(Geom2d_Line) normalLine=new Geom2d_Line(p1,gp_Dir2d(normal)); Geom2dGcc_QualifiedCurve qualifiedC1(Geom2dAdaptor_Curve(curve1),GccEnt_unqualified); Geom2dGcc_QualifiedCurve qualifiedC2(Geom2dAdaptor_Curve(curve2),GccEnt_unqualified); try{ Geom2dAPI_ProjectPointOnCurve projPc1(p1, curve1); double guess1 = projPc1.LowerDistanceParameter(); Geom2dAPI_ProjectPointOnCurve projPc3(p1, normalLine); double guess3 = projPc3.LowerDistanceParameter(); Geom2dGcc_Circ2d2TanOn circleBuilder(qualifiedC1,qualifiedC2,Geom2dAdaptor_Curve(normalLine),1e-9,guess1,guess1,guess3); int nSol = circleBuilder.NbSolutions(); if (nSol > 0){ gp_Circ2d circle = circleBuilder.ThisSolution(1); gp_Pnt2d center=circle.Location(); } } catch(Standard_Failure){ nFailed++; } } | ||||
Tags | No tags attached. | ||||
Test case number | bugs modalg_6 bug27357 | ||||
|
The class Geom2dGcc_Circ2d2TanOn can throw a C++ exception of type StdFail_NotDone. This is a bug caused by the fact that the algorithm does not check the status of under-called algorithms before getting a result from them. However, it does not crash when it is destroyed in normal situation like in the given sample. If it crashes in destructor it means there is mismatched allocation/deallocation of some memory. It can occur when you link your sample program against C run-time Multithreaded Debug DLL, but use the OCCT binary files linked against C run-time Multithreaded DLL, or vice versa. This concerns the MSVC environment on Windows. |
|
Thanks, the example compiled in release mode doesn’t crash anymore. |
|
It is needed to fix the following problem. The class Geom2dGcc_Circ2d2TanOn throws an unexpected C++ exception of type StdFail_NotDone. In fact it is raised by other algorithms called from the discussed one. It is needed to check the status of all called sub-algorithms and not to try getting result from them if their IsDone() method returns false. |
|
Branch CR27357 has been created by isn. SHA-1: 0725f8081dfeaad421ee65ea8a7c6f7a16fc7091 Detailed log of new commits: Author: isn Date: Fri Jun 17 14:50:50 2016 +0300 0027357: Geom2dGcc_Circ2d2TanOn: check status of sub-algorithms to avoid exceptions Additional checks for underlying algorithms have been added |
|
this issue seems to be resolved, but without corrections of indentations in the Geom2dGcc_Circ2d2TanOn.cxx file. |
|
Branch CR27357 has been updated forcibly by isn. SHA-1: 7f718aa8619de8d7e275c83c8e7721c14dd60395 |
|
Code correction is OK. Please create a test case that checks there is no exception. This test must fail on master. |
|
Branch CR27357 has been updated by isn. SHA-1: 89d7acb8680fa1eaa54fdfe6ded6eadad977f5ed Detailed log of new commits: Author: isn Date: Mon Jun 20 17:00:06 2016 +0300 test case |
|
Reviewed. |
|
Branch CR27357 has been updated forcibly by apv. SHA-1: af8f8a9f57684289107ad699ceed651a952876cc |
|
Branch CR27357 has been rebased on the current master |
|
Dear BugMaster, Branch CR27357 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested. SHA-1: af8f8a9f57684289107ad699ceed651a952876cc Number of compiler warnings: occt component: Linux: 1 (0 on master) Windows: 0 (0 on master) MacOS: 1 (0 on master) products component: Linux: 68 Windows: 0 MacOS: 1127 New warning has been detected on Linux: QABugs_20.cxx:2020, GNU C Compiler 4 (gcc), Priority: Normal variable 'aCenter' set but not used [-Wunused-but-set-variable] on MacOS: QABugs_20.cxx:2020, Clang (LLVM based), Priority: Normal unused variable 'aCenter' Regressions/Differences: Not detected Testing cases: bugs modalg_6 bug27357 - OK http://occt-tests/CR27357-master-OCCT/Debian70-64/bugs/modalg_6/bug27357.html http://occt-tests/CR27357-master-OCCT/Windows-64-VC10/bugs/modalg_6/bug27357.html Testing on Linux: Total MEMORY difference: 89269260 / 89170862 [+0.11%] Total CPU difference: 19445.259999999897 / 19458.16999999997 [-0.07%] Testing on Windows: Total MEMORY difference: 55890332 / 55902024 [-0.02%] Total CPU difference: 18078.44108669884 / 18535.508416598954 [-2.47%] |
|
Dear Ilya, Branch CR27357 has been rejected due to: - additional warnings |
|
Branch CR27357 has been updated by isn. SHA-1: 6c09b373b89105154f9b714c54f24d23c2302099 Detailed log of new commits: Author: isn Date: Wed Jun 22 18:40:21 2016 +0300 get rid of the warning |
|
Why did you used std::list instead of NCollection_List. I consider that in OCCT code we should use OCCT collections where it is possible. Also, please use Standard_Integer instead of int. |
|
Branch CR27357 has been updated forcibly by isn. SHA-1: 7e54f27d2f8fa9a820ab0a5f4a460db5429e2271 |
|
ok, done |
|
Reviewed. Please re-test only "bugs modalg_6 bug27357". Nothing else was changed. |
|
Branch CR27357 has been updated forcibly by mkv. SHA-1: 5de21abca67c9dc0502c212d3cea81748370e55a |
|
Dear BugMaster, Branch CR27357 from occt git-repository (and IR-2016-06-23 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested. SHA-1: 5de21abca67c9dc0502c212d3cea81748370e55a Number of compiler warnings: occt component: Linux: 0 (0 on master) Windows: 0 (0 on master) MacOS: 0 (0 on master) products component: Linux: 64 Windows: 1 MacOS: 1158 Regressions/Differences: Not detected Testing cases: bugs modalg_6 bug27357 - OK http://occt-tests/CR27357-master-OCCT/Debian70-64/bugs/modalg_6/bug27357.html http://occt-tests/CR27357-master-OCCT/Windows-64-VC10/bugs/modalg_6/bug27357.html Testing on Linux: Total MEMORY difference: 88788517 / 88710130 [+0.09%] Total CPU difference: 19512.540000000132 / 19559.77999999992 [-0.24%] Testing on Windows: Total MEMORY difference: 55888001 / 55896954 [-0.02%] Total CPU difference: 18108.09687679883 / 17842.286772898675 [+1.49%] |
|
Branch CR27357 has been deleted by inv. SHA-1: 5de21abca67c9dc0502c212d3cea81748370e55a |
occt: master 8009d070 2016-06-17 11:50:50
Committer: bugmaster Details Diff |
0027357: Geom2dGcc_Circ2d2TanOn: check status of sub-algorithms to avoid exceptions Additional checks for underlying algorithms have been added test case get rid of the warning |
Affected Issues 0027357 |
|
mod - src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx | Diff File | ||
mod - src/QABugs/QABugs_20.cxx | Diff File | ||
add - tests/bugs/modalg_6/bug27357 | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-05 20:42 | sraymond | New Issue | |
2016-04-05 20:42 | sraymond | Assigned To | => msv |
2016-04-07 11:07 |
|
Note Added: 0052459 | |
2016-04-07 14:46 | sraymond | Note Added: 0052470 | |
2016-04-07 15:33 |
|
Status | new => closed |
2016-04-07 15:33 |
|
Resolution | open => no change required |
2016-04-07 15:33 |
|
Target Version | 7.1.0 => |
2016-04-07 18:59 |
|
Note Added: 0052486 | |
2016-04-07 18:59 |
|
Status | closed => feedback |
2016-04-07 18:59 |
|
Resolution | no change required => reopened |
2016-05-19 10:09 |
|
Priority | normal => low |
2016-05-19 10:09 |
|
Status | feedback => assigned |
2016-05-19 10:09 |
|
Summary | Geom2dGcc_Circ2d2TanOn crash in a loop => Geom2dGcc_Circ2d2TanOn: check status of sub-algorithms to avoid exceptions |
2016-06-09 18:09 |
|
Assigned To | msv => isn |
2016-06-17 14:51 | git | Note Added: 0055176 | |
2016-06-17 14:55 |
|
Note Added: 0055178 | |
2016-06-17 14:55 |
|
Assigned To | isn => msv |
2016-06-17 14:55 |
|
Status | assigned => feedback |
2016-06-20 11:16 | git | Note Added: 0055205 | |
2016-06-20 11:51 |
|
Note Added: 0055213 | |
2016-06-20 11:51 |
|
Assigned To | msv => isn |
2016-06-20 11:51 |
|
Status | feedback => assigned |
2016-06-20 17:14 | git | Note Added: 0055247 | |
2016-06-20 17:15 |
|
Assigned To | isn => msv |
2016-06-20 17:15 |
|
Status | assigned => resolved |
2016-06-21 10:02 |
|
Note Edited: 0055213 | |
2016-06-21 10:08 |
|
Note Added: 0055279 | |
2016-06-21 10:08 |
|
Assigned To | msv => bugmaster |
2016-06-21 10:08 |
|
Status | resolved => reviewed |
2016-06-21 10:09 |
|
Target Version | => 7.1.0 |
2016-06-21 11:44 |
|
Assigned To | bugmaster => apv |
2016-06-21 18:11 | git | Note Added: 0055317 | |
2016-06-21 18:12 |
|
Note Added: 0055318 | |
2016-06-22 13:14 |
|
Test case number | => bugs modalg_6 bug27357 |
2016-06-22 13:18 |
|
Note Added: 0055338 | |
2016-06-22 13:18 |
|
Assigned To | apv => isn |
2016-06-22 13:18 |
|
Status | reviewed => assigned |
2016-06-22 13:19 |
|
Note Added: 0055339 | |
2016-06-22 18:58 | git | Note Added: 0055354 | |
2016-06-22 18:59 |
|
Assigned To | isn => msv |
2016-06-22 18:59 |
|
Status | assigned => resolved |
2016-06-23 09:59 |
|
Note Added: 0055360 | |
2016-06-23 09:59 |
|
Assigned To | msv => isn |
2016-06-23 09:59 |
|
Status | resolved => assigned |
2016-06-23 12:32 | git | Note Added: 0055367 | |
2016-06-23 12:32 |
|
Note Added: 0055368 | |
2016-06-23 12:32 |
|
Assigned To | isn => msv |
2016-06-23 12:32 |
|
Status | assigned => resolved |
2016-06-23 12:55 |
|
Note Added: 0055370 | |
2016-06-23 12:55 |
|
Assigned To | msv => bugmaster |
2016-06-23 12:55 |
|
Status | resolved => reviewed |
2016-06-23 14:16 |
|
Assigned To | bugmaster => apv |
2016-06-23 17:51 | git | Note Added: 0055390 | |
2016-06-24 13:54 |
|
Note Added: 0055442 | |
2016-06-24 13:54 |
|
Assigned To | apv => bugmaster |
2016-06-24 13:54 |
|
Status | reviewed => tested |
2016-07-01 17:19 | bugmaster | Changeset attached | => occt master 8009d070 |
2016-07-01 17:19 | bugmaster | Status | tested => verified |
2016-07-22 10:45 | git | Note Added: 0056132 | |
2016-12-09 16:31 |
|
Status | verified => closed |
2016-12-09 16:38 |
|
Fixed in Version | => 7.1.0 |