View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022749 | Community | OCCT:Foundation Classes | public | 2011-10-04 17:45 | 2012-03-29 17:26 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | major | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.5.1 | ||||
Target Version | 6.5.3 | Fixed in Version | 6.5.3 | ||
Summary | 0022749: Segfault in HashCode() of Standard_Transient | ||||
Description | Post from the Forum - http://www.opencascade.org/org/forum/thread_21955/ " The code below segfaults on Linux when MMGT_OPT is set to 0 or 2: #include <Standard_Transient.hxx> #include <iostream> int main(int argc, char **argv) { Standard_Transient s; Standard_Integer i = s.HashCode(1000); std::cout << i << std::endl; return 0; } The current implementation calls HashCode(Handle_Standard_Transient,Standard_Integer) due to implicit conversion operator. But if object is allocated on the stack, a segmentation fault occurs when the Handle_Standard_Transient temporary object is deleted. This happens if MMGT_OPT is set and different from 1. Implicit conversions should really be forbidden in order to avoid those subtle bugs." Patch is attached (for information). | ||||
Steps To Reproduce | Draw Command: static int TestHash (Draw_Interpretor& di, Standard_Integer argc, const char** argv) { Standard_Transient s; Standard_Integer i = s.HashCode(1000); std::cout << i << std::endl; return 0; } theCommands.Add ("TestHash", "TestHash \n", __FILE__, TestHash, g); | ||||
Tags | No tags attached. | ||||
Test case number | test case is not required | ||||
2011-10-04 17:45 manager |
fix-hashcode.patch (1,535 bytes) |
|
Patch applied. Branch http://svn/svn/occt/branches/OCC22749 is ready to be reviewed. Dear Andrey, Please review. |
|
No remarks, please test |
|
Dear BugMaster, Workbench KAS:dev:aan-OCC22749-occt was created from SVN branch http://svn/svn/occt/branches/OCC22749 (and aan-OCC22749-products from trunk) and compiled on Linux platform. Test for this fix is chl 934 P3. It's OK. Workbench KAS:dev: aan-OCC22749-products was tested with MMGT_OPT=0 There are following regressions in aan-OCC22749-products regarding to KAS:dev:products-20120120-opt chl 928 R1 chl 936 G9 See results in /QADisk/occttests/results/KAS/dev/ aan-OCC22749-products_26012012/lin See reference results in /QADisk/occttests/results/KAS/dev/products-20120120-opt_20012012/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 |
|
Dear BugMaster, Workbench KAS:dev:aan-OCC22749-occt was created from SVN branch http://svn/svn/occt/branches/OCC22749 (and aan-OCC22749-products from trunk) and compiled on Linux platform. Test for this fix is chl 934 P3. It's OK. Workbench KAS:dev: aan-OCC22749-products was tested with MMGT_OPT=0 There are not regressions in aan-OCC22749-products regarding to KAS:dev:products-20120120-opt See results in /QADisk/occttests/results/KAS/dev/ aan-OCC22749-products_26012012/lin See reference results in /QADisk/occttests/results/KAS/dev/products-20120120-opt_20012012/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 |
|
Also added fix to the Standard_Persistent::HashCode function. Branch http://svn/svn/occt/branches/OCC22749 is ready to be reviewed. Dear Andrey, Please review. |
|
Sorry, after some thinking I got to different idea: we should not have HashCode for Standard_Transient and Standard_Persistent at all. By its nature, the hash code should be computed from content of the object. For Handle objects, it is thus correct to compute has code from the address of the referred object. However, for the object itself it is senseless to compute hash code from its address. Thus I suggest we remove these functions and check if they are needed at all anywhere. |
|
HashCode function has been removed from Standard_Transient and Standard_Persistent and all calls has been replaced with HashCode from Standard_HashCode. Branch http://svn/svn/occt/branches/OCC22749 is ready to be reviewed. Dear Andrey, Please review. |
|
No remarks, please test |
|
Info : -------> Xw_Driver.cxx Error : Errors occured in Shell /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx: In member function 'virtual Standard_Boolean Xw_Driver::IsKnownImage(const Handle_Standard_Transient&)': /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx:868: error: 'class Standard_Transient' has no member named 'HashCode' /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx: In member function 'virtual void Xw_Driver::ClearImage(const Handle_Standard_Transient&)': /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx:902: error: 'class Standard_Transient' has no member named 'HashCode' /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx: In member function 'virtual void Xw_Driver::DrawImage(const Handle_Standard_Transient&, Standard_ShortReal, Standard_ShortReal)': /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx:924: error: 'class Standard_Transient' has no member named 'HashCode' /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx: In member function 'virtual void Xw_Driver::FillAndDrawImage(const Handle_Standard_Transient&, Standard_ShortReal, Standard_ShortReal, Standard_Integer, Standard_Integer, void*)': /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx:976: error: 'class Standard_Transient' has no member named 'HashCode' /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx: In member function 'virtual void Xw_Driver::FillAndDrawImage(const Handle_Standard_Transient&, Standard_ShortReal, Standard_ShortReal, Standard_Integer, Standard_Integer, Standard_Integer, void*)': /dn47/KAS/dev/aan-OCC22749-occt/src/Xw/Xw_Driver.cxx:1095: error: 'class Standard_Transient' has no member named 'HashCode' Error : Failed : Xw_Driver.cxx Info : ----------------------- Compilation Report ----------------------- Info : Failed : :KAS:dev:aan-OCC22749-occt:Xw:source:Xw_Driver.cxx Info : ----------------------------------------------------------------- Error : Failed during execution Info : Step obj.comp Error : Step obj.comp failed Error : Step obj.idep not done : almost Xw:obj.comp failed Info : ------------------ Process report ------------------ Info : Failed Xw (obj.comp obj.idep ) Info : ---------------------------------------------------- Info : ----------------------- Compilation Report ----------------------- Info : Failed : :KAS:dev:aan-OCC22749-products:OMFAlgo:source:OMFAlgo_Intersect.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFAlgo:source:OMFAlgo_MeshIntersect.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFAlgo:source:OMFAlgo_IntersectOnTree.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFAlgo:source:OMFAlgo_LineIntersect.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFAlgo:source:OMFAlgo_PlaneIntersect.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFBool:source:OMFBool_BooleanOperation.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFBool:source:OMFBool_SplitElement.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFVS:source:OMFVS_VisibleFilter.cxx Info : Failed : :KAS:dev:aan-OCC22749-products:OMFTest:source:OMFTest_ModelCommands.cxx Info : ----------------------------------------------------------------- |
|
HasCode functions in src/Xw/Xw_Driver.cxx have been replaced Branch http://svn/svn/occt/branches/OCC22749 is ready to be reviewed. Dear Andrey, Please review. |
|
Products part has been updated Branches http://svn/svn/occt/branches/OCC22749 http://svn/svn/occt-products/branches/OCC22749 are ready for testing. Please test. |
|
Dear BugMaster, Workbench KAS:dev:aan-OCC22749-occt was created from SVN branch http://svn/svn/occt/branches/OCC22749 (and aan-OCC22749-products was created from http://svn/svn/occt-products/branches/OCC22749 ) and compiled on Linux platform. Workbench KAS:dev:aan-OCC22749-products was tested with MMGT_OPT=0 There are not regressions in aan-OCC22749-products regarding to KAS:dev:products-20120210-opt See results in /QADisk/occttests/results/KAS/dev/aan-OCC22749-products_13022012/lin See reference results in /QADisk/occttests/results/KAS/dev/products-20120210-opt_10022012/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 |
|
Integration into trunk of occt repository Date: 2012-02-17 15:40:25 +0400 (Fri, 17 Feb 2012) New Revision: 10506 Modified: trunk/src/Graphic2d/Graphic2d_Buffer.cxx trunk/src/Standard/Standard_Persistent.cxx trunk/src/Standard/Standard_Persistent_proto.hxx trunk/src/Standard/Standard_Transient.cxx trunk/src/Standard/Standard_Transient_proto.hxx trunk/src/TopLoc/TopLoc_Location.cxx trunk/src/WNT/WNT_WDriver.cxx trunk/src/Xw/Xw_Driver.cxx Integration into trunk of occt-products repository Date: 2012-02-17 15:53:07 +0400 (Fri, 17 Feb 2012) New Revision: 18551 Modified: trunk/src/OMFAlgo/OMFAlgo_Intersect.lxx |
occt: master ec6a1aa7 2012-02-17 11:40:25
Committer: bugmaster Details Diff |
0022749: Segfault in HashCode() of Standard_Transient |
Affected Issues 0022749 |
|
mod - src/Graphic2d/Graphic2d_Buffer.cxx | Diff File | ||
mod - src/Standard/Standard_Persistent.cxx | Diff File | ||
mod - src/Standard/Standard_Persistent_proto.hxx | Diff File | ||
mod - src/Standard/Standard_Transient.cxx | Diff File | ||
mod - src/Standard/Standard_Transient_proto.hxx | Diff File | ||
mod - src/TopLoc/TopLoc_Location.cxx | Diff File | ||
mod - src/WNT/WNT_WDriver.cxx | Diff File | ||
mod - src/Xw/Xw_Driver.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-10-04 17:45 |
|
New Issue | |
2011-10-04 17:45 |
|
Assigned To | => abv |
2011-10-04 17:45 |
|
File Added: fix-hashcode.patch | |
2011-12-01 10:04 |
|
Assigned To | abv => dbv |
2011-12-01 10:04 |
|
Status | new => assigned |
2012-01-20 15:00 |
|
Note Added: 0019202 | |
2012-01-20 15:00 |
|
Assigned To | dbv => abv |
2012-01-20 15:00 |
|
Status | assigned => resolved |
2012-01-23 09:33 |
|
Note Added: 0019221 | |
2012-01-23 09:33 |
|
Status | resolved => reviewed |
2012-01-27 11:22 |
|
Note Added: 0019277 | |
2012-01-27 11:23 |
|
Note Edited: 0019277 | |
2012-01-27 11:23 |
|
Assigned To | abv => dbv |
2012-01-27 11:23 |
|
Status | reviewed => assigned |
2012-01-27 16:01 |
|
Test case number | => chl 934 P3 |
2012-01-27 16:01 |
|
File Added: P3 | |
2012-01-27 16:03 |
|
File Deleted: P3 | |
2012-01-27 16:03 |
|
File Added: P3 | |
2012-01-27 16:15 |
|
File Deleted: P3 | |
2012-01-27 16:16 |
|
File Added: P3 | |
2012-02-02 12:52 |
|
Note Added: 0019349 | |
2012-02-02 12:53 |
|
Status | assigned => feedback |
2012-02-02 12:53 |
|
Status | feedback => reviewed |
2012-02-02 12:53 |
|
Status | reviewed => tested |
2012-02-02 12:54 |
|
Note Edited: 0019349 | |
2012-02-02 13:12 |
|
Note Edited: 0019349 | |
2012-02-02 13:16 |
|
Status | tested => assigned |
2012-02-02 13:27 |
|
Note Added: 0019351 | |
2012-02-02 13:27 |
|
Assigned To | dbv => abv |
2012-02-02 13:27 |
|
Status | assigned => resolved |
2012-02-02 13:39 |
|
Note Added: 0019355 | |
2012-02-02 13:39 |
|
Assigned To | abv => dbv |
2012-02-02 13:39 |
|
Status | resolved => assigned |
2012-02-06 12:18 |
|
Note Added: 0019402 | |
2012-02-06 12:18 |
|
Assigned To | dbv => abv |
2012-02-06 12:18 |
|
Status | assigned => resolved |
2012-02-06 12:34 |
|
Note Added: 0019405 | |
2012-02-06 12:34 |
|
Assigned To | abv => dbv |
2012-02-06 12:34 |
|
Status | resolved => reviewed |
2012-02-08 16:10 |
|
Note Added: 0019465 | |
2012-02-08 16:10 |
|
Status | reviewed => assigned |
2012-02-08 17:58 |
|
Note Edited: 0019465 | |
2012-02-09 09:02 |
|
Note Edited: 0019355 | |
2012-02-09 11:07 |
|
Note Added: 0019485 | |
2012-02-09 11:07 |
|
Assigned To | dbv => abv |
2012-02-09 11:07 |
|
Status | assigned => resolved |
2012-02-09 12:18 |
|
Assigned To | abv => dbv |
2012-02-09 12:18 |
|
Status | resolved => reviewed |
2012-02-09 12:35 |
|
Status | reviewed => assigned |
2012-02-10 17:33 |
|
Status | assigned => resolved |
2012-02-10 17:36 |
|
Note Added: 0019520 | |
2012-02-10 17:36 |
|
Status | resolved => reviewed |
2012-02-14 13:21 |
|
Assigned To | dbv => aan |
2012-02-14 14:16 |
|
File Deleted: P3 | |
2012-02-14 14:16 |
|
Test case number | chl 934 P3 => test case is not required |
2012-02-14 14:19 |
|
Note Added: 0019553 | |
2012-02-14 14:46 |
|
Status | reviewed => tested |
2012-02-17 15:57 | bugmaster | Note Added: 0019632 | |
2012-02-17 15:57 | bugmaster | Status | tested => verified |
2012-02-17 15:57 | bugmaster | Resolution | open => fixed |
2012-02-17 15:57 | bugmaster | Assigned To | aan => dbv |
2012-03-29 17:26 | bugmaster | Changeset attached | => occt master ec6a1aa7 |