MantisBT - Community
View Issue Details
0030551Community[OCCT] OCCT:Foundation Classespublic2019-03-09 17:582019-08-15 17:51
galbramc 
bugmaster 
normalmajor 
closedfixed 
[OCCT] 7.3.0 
[OCCT] 7.4.0[OCCT] 7.4.0 
Not required
0030551: Foundation Classes - Integer overflow in NCollection_CellFilter HashCode
I compiled OCCT with the -fsanitize=undefined flag and got the following errors:

src/NCollection/NCollection_CellFilter.hxx:328:25: runtime error: left shift of 79114230870873 by 21 places cannot be represented in type 'long int'
src/NCollection/NCollection_CellFilter.hxx:328:25: runtime error: left shift of 79088553295872 by 21 places cannot be represented in type 'long int'

I can provide a specific example string that reproduces this if needed.

A simple fix is to change 'long aCode' to 'Standard_Size aCode', as well as the return value of the HashCode function.
Compile OCCT with a g++ newer than 4.9 with the -fsanitize=undefined compiler flag and run the test suite.
No tags attached.
related to 0030550closed bugmaster Community Coding - Integer overflow in Standard_CString HashCodes 
child of 0030557new kgv Open CASCADE Coding - eliminate errors reported by -fsanitize 
Issue History
2019-03-09 17:58galbramcNew Issue
2019-03-09 17:58galbramcAssigned To => abv
2019-03-12 04:39galbramcAssigned Toabv => kgv
2019-03-12 14:04kgvAssigned Tokgv => abv
2019-03-12 14:04kgvSummaryInteger overflow in NCollection_CellFilter HashCode => Foundation Classes - Integer overflow in NCollection_CellFilter HashCode
2019-03-12 14:05kgvRelationship addedchild of 0030557
2019-03-20 08:37kgvAssigned Toabv => tizmaylo
2019-03-20 08:37kgvStatusnew => assigned
2019-04-22 11:33tizmayloTarget Version => 7.4.0
2019-04-22 11:36tizmayloNote Added: 0083920
2019-04-22 11:37tizmayloAssigned Totizmaylo => bugmaster
2019-04-22 11:37tizmayloStatusassigned => feedback
2019-04-22 11:37tizmayloNote Edited: 0083920bug_revision_view_page.php?bugnote_id=83920#r21075
2019-04-30 14:50kgvRelationship addedrelated to 0030550
2019-05-06 15:43bugmasterNote Added: 0084196
2019-05-06 15:43bugmasterStatusfeedback => verified
2019-05-06 15:43bugmasterResolutionopen => fixed
2019-08-15 17:51bugmasterTest case number => Not required

Notes
(0083920)
tizmaylo   
2019-04-22 11:36   
(edited on: 2019-04-22 11:37)
This issue was fixed as a part of changes made within 0030550: Coding - Integer overflow in Standard_CString HashCodes.

(0084196)
bugmaster   
2019-05-06 15:43   
Fixed in framework of 30550