View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030720 | Open CASCADE | OCCT:Coding | public | 2019-05-20 12:37 | 2019-10-23 12:04 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 7.4.0 | ||||
Target Version | 7.4.0 | Fixed in Version | 7.4.0 | ||
Summary | 0030720: Coding - fix HashCode() function problems that are not resolved with 30550 | ||||
Description | There are some problems that were not resolved with 0030550:
To solve the problem with other projects it may be useful to add asserts to methods of map classes that are dealing with hash codes to check their values to be strictly one-based (not zero-based). | ||||
Steps To Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR30720 has been created by tizmaylo. SHA-1: 58828d2acf8b61ec40f099a46b27b9a49b5a4f26 Detailed log of new commits: Author: tiv Date: Thu Sep 5 19:30:47 2019 +0300 0030720: Coding - fix HashCode() function problems that are not resolved with 30550 Undefined behavior caused by left shift operations in TopLoc_Location::HashCode() function is fixed. HashCode() function overload for Standard_Size type is made available only if Standard_Size and "unsigned int" are different types (it is usually true for 64-bit platforms). The overload for "unsigned int" is made simple non-templated function (so it behaves the same on 32-bit and 64-bit platforms). |
|
Patch is ready for review (at the time of writing, the tests have not passed yet, but I hope everything will be OK): http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30720-master-TIV/view/ALL/ OCCT branch: CR30720 Branch in OCCT Products: CR30720 |
|
Regressions on Products: http://jenkins-test-12.nnov.opencascade.com/view/CR30720-master-TIV/view/COMPARE/ |
|
Branch CR30720 has been updated forcibly by tizmaylo. SHA-1: 7d309b94bf82625152942c96202fd0ebe35cc17c |
|
Branch CR30720 has been updated by tizmaylo. SHA-1: 86eb424f30f5cffd39c6bdc16be633e8a8fbf2c6 Detailed log of new commits: Author: tiv Date: Tue Sep 24 16:39:56 2019 +0300 # HashCode() overload for Standard_Utf32Char type is fixed to be compilable with old version of compilers (e.g. MSVS 2010). |
|
Branch CR30720_1 has been created by tizmaylo. SHA-1: 238bfda1dcaf1d1dfde4d29a5960212ddea36352 Detailed log of new commits: Author: tiv Date: Tue Sep 24 16:42:21 2019 +0300 0030720: Coding - fix HashCode() function problems that are not resolved with 30550 Undefined behavior caused by left shift operations in TopLoc_Location::HashCode() function is fixed. HashCode() function overload for Standard_Size type is made available only if Standard_Size and "unsigned int" are different types (it is usually true for 64-bit platforms). The overload for "unsigned int" is made simple non-templated function (so it behaves the same on 32-bit and 64-bit platforms). HashCode() function overload for Standard_Utf32Char type is made available only if Standard_Utf32Char and "unsigned int" are different types (it is needed for some old compilers). |
|
Patch is ready for review: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30720-master-TIV/view/ALL/ OCCT branch: CR30720 OCCT branch with squashed commits: CR30720_1 OCCT Products branch: CR30720 OCCT Products branch with squashed commits: CR30720_1 |
|
Practically speaking, Font_BRepFont and OpenGl_Font are the only two places using Standard_Utf32Char as a key in map. Therefore, moving hasher to dedicated structure for Standard_Utf32Char type would fix global collision of Hash/IsEqual methods. > NCollection_DataMap<Standard_Utf32Char, Standard_Integer> myGlyphMap; > NCollection_DataMap<Standard_Utf32Char, TopoDS_Shape> myCache; |
|
Combination - OCCT branch : CR30720_1 master SHA - 238bfda1dcaf1d1dfde4d29a5960212ddea36352 5f5b1aed1c6e139bbd34314eca77ae7abcd8895c Products branch : CR30720_1 SHA - 83df4cb7aa05ca0b1f190a68462fc970ee162d17 was compiled on Linux, MacOS and Windows platforms and tested in optimize mode. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: Debian80-64: OCCT Total CPU difference: 16819.760000000093 / 16808.79000000008 [+0.07%] Products Total CPU difference: 10575.410000000034 / 10573.91000000004 [+0.01%] Windows-64-VC14: OCCT Total CPU difference: 18320.0625 / 18298.78125 [+0.12%] Products Total CPU difference: 12486.3125 / 12507.671875 [-0.17%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR30720 has been deleted by inv. SHA-1: 86eb424f30f5cffd39c6bdc16be633e8a8fbf2c6 |
|
Branch CR30720_1 has been deleted by inv. SHA-1: 238bfda1dcaf1d1dfde4d29a5960212ddea36352 |
occt: master 467e864a 2019-09-24 13:42:21 tiv Committer: bugmaster Details Diff |
0030720: Coding - fix HashCode() function problems that are not resolved with 30550 Undefined behavior caused by left shift operations in TopLoc_Location::HashCode() function is fixed. HashCode() function overload for Standard_Size type is made available only if Standard_Size and "unsigned int" are different types (it is usually true for 64-bit platforms). The overload for "unsigned int" is made simple non-templated function (so it behaves the same on 32-bit and 64-bit platforms). HashCode() function overload for Standard_Utf32Char type is made available only if Standard_Utf32Char and "unsigned int" are different types (it is needed for some old compilers). |
Affected Issues 0030720 |
|
mod - src/Standard/Standard_Integer.hxx | Diff File | ||
mod - src/Standard/Standard_Size.hxx | Diff File | ||
mod - src/TopLoc/TopLoc_Location.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-05-20 12:37 |
|
New Issue | |
2019-05-20 12:37 |
|
Assigned To | => kgv |
2019-05-20 12:42 | kgv | Relationship added | child of 0030550 |
2019-05-20 12:43 | kgv | Description Updated | |
2019-05-21 18:41 |
|
Description Updated | |
2019-09-04 17:11 | kgv | Product Version | => 7.4.0 |
2019-09-04 17:11 | kgv | Target Version | 7.4.0 => 7.5.0 |
2019-09-04 17:33 | kgv | Assigned To | kgv => tizmaylo |
2019-09-04 17:33 | kgv | Status | new => assigned |
2019-09-04 17:33 | kgv | Target Version | 7.5.0 => 7.4.0 |
2019-09-05 19:59 | git | Note Added: 0086817 | |
2019-09-05 20:16 |
|
Note Added: 0086819 | |
2019-09-05 20:18 |
|
Assigned To | tizmaylo => abv |
2019-09-05 20:18 |
|
Status | assigned => resolved |
2019-09-05 20:18 |
|
Steps to Reproduce Updated | |
2019-09-06 11:12 | kgv | Assigned To | abv => bugmaster |
2019-09-06 11:12 | kgv | Status | resolved => reviewed |
2019-09-06 22:09 | bugmaster | Note Added: 0086914 | |
2019-09-06 22:09 | bugmaster | Assigned To | bugmaster => tizmaylo |
2019-09-06 22:09 | bugmaster | Status | reviewed => assigned |
2019-09-17 06:50 |
|
Target Version | 7.4.0 => 7.5.0 |
2019-09-24 12:14 | git | Note Added: 0087466 | |
2019-09-24 16:48 | git | Note Added: 0087488 | |
2019-09-24 16:48 | git | Note Added: 0087489 | |
2019-09-24 18:53 |
|
Note Added: 0087494 | |
2019-09-24 18:54 |
|
Assigned To | tizmaylo => kgv |
2019-09-24 18:54 |
|
Status | assigned => resolved |
2019-09-24 20:34 | kgv | Note Added: 0087495 | |
2019-09-24 20:34 | kgv | Assigned To | kgv => bugmaster |
2019-09-24 20:34 | kgv | Status | resolved => reviewed |
2019-09-24 20:34 | kgv | Target Version | 7.5.0 => 7.4.0 |
2019-09-24 20:35 | kgv | Note Edited: 0087495 | |
2019-09-25 15:53 | bugmaster | Test case number | => Not required |
2019-09-25 15:56 | bugmaster | Note Added: 0087511 | |
2019-09-25 15:56 | bugmaster | Status | reviewed => tested |
2019-09-29 12:19 | bugmaster | Changeset attached | => occt master 467e864a |
2019-09-29 12:19 | bugmaster | Status | tested => verified |
2019-09-29 12:19 | bugmaster | Resolution | open => fixed |
2019-09-29 12:36 | git | Note Added: 0087615 | |
2019-09-29 12:36 | git | Note Added: 0087616 |