MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030720Open CASCADE[OCCT] OCCT:Codingpublic2019-05-20 12:372019-09-17 06:50
Reportertizmaylo 
Assigned Totizmaylo 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.4.0 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030720: Coding - fix HashCode() function problems that are not resolved with 30550
DescriptionThere are some problems that were not resolved with 0030550:

  • undefined behavior caused by left shift operations in TopLoc_Location::HashCode() function is not fixed (look at the places where the local variable depth is used);

  • HashCode() functions are not fixed in OCC Products;

  • HashCode() function overload for unsigned int behaves differently on 32-bit and 64-bit platforms (on 32-bit platform it is disabled via SFINAE and HashCode() function overload for std::size_t type is used because std::size_t == unsigned int).


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 ReproduceNot required
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0030550verifiedbugmaster Community Coding - Integer overflow in Standard_CString HashCodes 

-  Notes
(0086817)
git (administrator)
2019-09-05 19:59

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).
(0086819)
tizmaylo (developer)
2019-09-05 20:16

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
(0086914)
bugmaster (administrator)
2019-09-06 22:09

Regressions on Products:

http://jenkins-test-12.nnov.opencascade.com/view/CR30720-master-TIV/view/COMPARE/ [^]

- Issue History
Date Modified Username Field Change
2019-05-20 12:37 tizmaylo New Issue
2019-05-20 12:37 tizmaylo Assigned To => kgv
2019-05-20 12:42 kgv Relationship added child of 0030550
2019-05-20 12:43 kgv Description Updated View Revisions
2019-05-21 18:41 tizmaylo Description Updated View Revisions
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 tizmaylo Note Added: 0086819
2019-09-05 20:18 tizmaylo Assigned To tizmaylo => abv
2019-09-05 20:18 tizmaylo Status assigned => resolved
2019-09-05 20:18 tizmaylo Steps to Reproduce Updated View Revisions
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 abv Target Version 7.4.0 => 7.5.0*


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker