View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022554 | Open CASCADE | OCCT:Visualization | public | 2011-05-31 15:01 | 2012-03-29 17:26 |
Reporter | kgv | Assigned To | bugmaster | ||
Priority | normal | Severity | trivial | ||
Status | closed | Resolution | fixed | ||
OS | All | ||||
Product Version | 6.5.0 | ||||
Target Version | 6.5.3 | Fixed in Version | 6.5.3 | ||
Summary | 0022554: Application hangs on selection | ||||
Description | In method Standard_Real Select3D_SensitiveCurve::ComputeDepth(), (Select3D_Pnt*)mypolyg3d accessed without out-of-range check (mylastseg+1 can be equal to mynbpoints). If happens - this cause undefined behaviour or even application hang (if values interpreted as QNAN). In class Select3D_SensitivePoly fields mypolyg3d and mypolyg2d declared and managed in unsafe manner. This cause potential errors in other places where these arrays are used. | ||||
Additional information and documentation updates | Added entities: Select3D_PointData.hxx – implemented class Select3D_PointData for safe management of Select3D_SensitivePoly polygons of 3D and 2D points. Modified entities: Select3D_SensitivePoly.cdl : Added new member Select3D_PointData mypolyg instead of members mypolyg3d, mypolyg2d, mynbpoints. Removed method Destroy(). Modified all methods that used old members mypolyg3d, mypolyg2d, mynbpoints in the following files: Select3D_SensitiveCircle.cxx Select3D_SensitiveCurve.cxx Select3D_SensitiveFace.cxx Select3D_SensitivePoly.cxx Select3D_SensitivePoly.lxx Select3D_SensitiveTriangle.cxx ViewerTest_ObjectCommands.cxx: Added two new classes Triangle and SegmentObject based on AIS_InteractiveObject. Added two new DRAW commands vtriangle and vsegment. All of them – for test Select3D_SensitiveTriangle and Select3D_SensitiveCurve. thug.doc : Added description of new DRAW commands vtriangle and vsegment. | ||||
Tags | No tags attached. | ||||
Test case number | Test cases chl 934 T7 T8 T9 U1 | ||||
|
This issue was suspended till integration of the patch for 0012121. Now that the patch is in the trunk, this issue has been unblocked, so please proceed with its correction. |
|
SVN branch http://svn/svn/occt/branches/OCC22554 is ready for reviewing |
2012-02-03 11:56 developer |
vcircle.tcl (120 bytes) |
2012-02-03 11:57 developer |
vplane.tcl (118 bytes) |
2012-02-03 11:57 developer |
vsegment.tcl (95 bytes) |
2012-02-03 11:57 developer |
vtriangle.tcl (123 bytes) |
|
Files added : vcircle.tcl vplane.tcl vsegment.tcl vtriangle.tcl Test scripts display circle, plane, segment and triangle. Selection and highlighting for these objects should work as usual. |
|
> Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId, > const TColgp_Array1OfPnt& ThePoints) > : Select3D_SensitiveEntity(OwnerId), > mypolyg(ThePoints.Upper()-ThePoints.Lower()+1) > { > if (!mypolyg.IsValid()) > return; This validation is performed in all constructors and class methods! And looks like checking (this != NULL). There are 2 questions: - is this solution has benefits against behavior used in OCCT to throw exception in constructor when incorrect data is passed? - is it really happens (if not - then it is better to throw exception to indicate really invalid situation)? Comments in new header file 'Select3D_PointData.hxx' doesn't corresponds to OCCT coding rules. This is also bad practice to clarify class with constructor and destructor with 'struct' keyword. Select3D_SensitivePoly.lxx, 6 > inline void Select3D_SensitivePoly > ::Points3D( Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt ) > { > Standard_Integer aSize = mypolyg.Size(); > theHArrayOfPnt = new TColgp_HArray1OfPnt(1,aSize); > for(Standard_Integer i = 1; i <= aSize; i++) > { > gp_Pnt aPnt; >> if(mypolyg.Pnt(i-1, aPnt)) /// ???? > theHArrayOfPnt->SetValue(i, aPnt); > } > } how this condition may fail if cycle limited to mypolyg.Size()? |
|
SVN branch http://svn/svn/occt/branches/OCC22554 is ready for reviewing |
|
The branch reviewed with the following remarks: Select3D_SensitiveCircle class ==================================== Standard_Boolean Select3D_SensitiveCircle:: Matches(const Standard_Real X, const Standard_Real Y, const Standard_Real aTol, Standard_Real& DMin) The case when mypolyg.Size() == 1 (a circle degenerated down to a point) is not treated, though it is possible according to constructors. Corresponding code to be added similalry to Select3D_SensitivePoint::Matches(). In general, please check that Matches() methods do not return Standard_True when something wrong happens. Otherwise, myDetectedIndex might be invalid but ComputeDepth() will be called that uses it. ComputeDepth() should return Precision::Infinite() if something goes wrong - see Select3D_SensitiveCurve::ComputeDepth(). |
|
SVN branch http://svn/svn/occt/branches/OCC22554 is ready for reviewing |
|
The branch OCC22554 reviewed without remarks and is ready for testing. |
|
Dear BugMaster, Workbench KAS:dev:mkv-22554-occt was created from SVN branch http://svn/svn/occt/branches/OCC22554 (and mkv-22554-products from trunk) and compiled on Linux platform. There are not regressions in mkv-22554-products regarding to KAS:dev:products-20120217-opt See results in /QADisk/occttests/results/KAS/dev/mkv-22554-products_20022012/lin See reference results in /QADisk/occttests/results/KAS/dev/products-20120217-opt_17022012/lin See test cases in /QADisk/occttests/tests/ED N.B. In order to launch testing case you can make use the following instructions http://doc/doku.php?id=occt:certification |
|
Integrated into trunk of occt repository Date: 2012-02-22 17:01:33 +0400 (Wed, 22 Feb 2012) New Revision: 10603 Added: trunk/src/Select3D/Select3D_PointData.hxx Modified: trunk/src/Select3D/FILES trunk/src/Select3D/Select3D.cdl trunk/src/Select3D/Select3D_SensitiveCircle.cdl trunk/src/Select3D/Select3D_SensitiveCircle.cxx trunk/src/Select3D/Select3D_SensitiveCurve.cdl trunk/src/Select3D/Select3D_SensitiveCurve.cxx trunk/src/Select3D/Select3D_SensitiveFace.cdl trunk/src/Select3D/Select3D_SensitiveFace.cxx trunk/src/Select3D/Select3D_SensitivePoly.cdl trunk/src/Select3D/Select3D_SensitivePoly.cxx trunk/src/Select3D/Select3D_SensitivePoly.lxx trunk/src/Select3D/Select3D_SensitiveTriangle.cdl trunk/src/Select3D/Select3D_SensitiveTriangle.cxx trunk/src/ViewerTest/ViewerTest_ObjectCommands.cxx |
2012-02-22 17:16 tester |
chl_934_T7_T8_T9_U1.tar.gz (453 bytes) |
occt: master ceae62f0 2012-02-22 13:01:33
Committer: bugmaster Details Diff |
0022554: Application hangs on selection |
Affected Issues 0022554 |
|
mod - src/Select3D/FILES | Diff File | ||
mod - src/Select3D/Select3D.cdl | Diff File | ||
add - src/Select3D/Select3D_PointData.hxx | Diff File | ||
mod - src/Select3D/Select3D_SensitiveCircle.cdl | Diff File | ||
mod - src/Select3D/Select3D_SensitiveCircle.cxx | Diff File | ||
mod - src/Select3D/Select3D_SensitiveCurve.cdl | Diff File | ||
mod - src/Select3D/Select3D_SensitiveCurve.cxx | Diff File | ||
mod - src/Select3D/Select3D_SensitiveFace.cdl | Diff File | ||
mod - src/Select3D/Select3D_SensitiveFace.cxx | Diff File | ||
mod - src/Select3D/Select3D_SensitivePoly.cdl | Diff File | ||
mod - src/Select3D/Select3D_SensitivePoly.cxx | Diff File | ||
mod - src/Select3D/Select3D_SensitivePoly.lxx | Diff File | ||
mod - src/Select3D/Select3D_SensitiveTriangle.cdl | Diff File | ||
mod - src/Select3D/Select3D_SensitiveTriangle.cxx | Diff File | ||
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-08-02 11:24 | bugmaster | Category | OCCT:VIZ => OCCT:Visualization |
2011-10-07 17:28 |
|
Assigned To | bugmaster => aaa |
2011-10-07 17:28 |
|
Status | new => assigned |
2012-02-01 16:40 |
|
Relationship added | related to 0012121 |
2012-02-01 16:42 |
|
Note Added: 0019333 | |
2012-02-01 16:42 |
|
Note Edited: 0019333 | |
2012-02-03 11:31 |
|
Fixed in Version | EMPTY => |
2012-02-03 11:31 |
|
Description Updated | |
2012-02-03 11:31 |
|
Additional Information Updated | |
2012-02-03 11:32 |
|
Assigned To | aaa => san |
2012-02-03 11:33 |
|
Status | assigned => feedback |
2012-02-03 11:33 |
|
Assigned To | san => aaa |
2012-02-03 11:34 |
|
Note Added: 0019372 | |
2012-02-03 11:34 |
|
Assigned To | aaa => san |
2012-02-03 11:34 |
|
Status | feedback => resolved |
2012-02-03 11:56 |
|
File Added: vcircle.tcl | |
2012-02-03 11:57 |
|
File Added: vplane.tcl | |
2012-02-03 11:57 |
|
File Added: vsegment.tcl | |
2012-02-03 11:57 |
|
File Added: vtriangle.tcl | |
2012-02-03 12:00 |
|
Note Added: 0019373 | |
2012-02-03 16:35 |
|
Relationship added | related to 0022819 |
2012-02-03 17:46 | kgv | Note Added: 0019392 | |
2012-02-03 18:02 | kgv | Note Edited: 0019392 | |
2012-02-03 18:03 | kgv | Note Edited: 0019392 | |
2012-02-06 17:57 |
|
Assigned To | san => aaa |
2012-02-07 11:44 |
|
Additional Information Updated | |
2012-02-07 11:44 |
|
Additional Information Updated | |
2012-02-07 11:45 |
|
Note Added: 0019424 | |
2012-02-07 11:45 |
|
Assigned To | aaa => san |
2012-02-07 11:45 |
|
Status | resolved => assigned |
2012-02-07 11:56 |
|
Status | assigned => resolved |
2012-02-07 12:08 |
|
Product Version | => 6.5.0 |
2012-02-07 12:08 |
|
Target Version | => 6.5.3 |
2012-02-08 14:47 |
|
Note Added: 0019460 | |
2012-02-08 14:47 |
|
Assigned To | san => aaa |
2012-02-08 14:47 |
|
Status | resolved => assigned |
2012-02-10 11:32 |
|
Relationship deleted | related to 0022819 |
2012-02-10 14:49 |
|
Note Added: 0019508 | |
2012-02-10 14:49 |
|
Assigned To | aaa => san |
2012-02-10 14:49 |
|
Status | assigned => resolved |
2012-02-20 13:16 |
|
Note Added: 0019664 | |
2012-02-20 13:16 |
|
Assigned To | san => bugmaster |
2012-02-20 13:16 |
|
Status | resolved => reviewed |
2012-02-20 14:25 |
|
Assigned To | bugmaster => mkv |
2012-02-21 19:52 |
|
Note Added: 0019708 | |
2012-02-22 15:02 |
|
Status | reviewed => tested |
2012-02-22 17:06 | bugmaster | Note Added: 0019745 | |
2012-02-22 17:06 | bugmaster | Status | tested => verified |
2012-02-22 17:06 | bugmaster | Resolution | open => fixed |
2012-02-22 17:16 |
|
File Added: chl_934_T7_T8_T9_U1.tar.gz | |
2012-02-22 17:17 |
|
Test case number | => Test cases chl 934 T7 T8 T9 U1 |
2012-03-29 17:26 | bugmaster | Changeset attached | => occt master ceae62f0 |