MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031024Community[OCCT] OCCT:Codingpublic2019-10-03 05:422019-10-04 16:16
Reportergalbramc 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusreviewedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.1.0 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0031024: Coding - invalid left shift in BVH_RadixSorter::Perform() using -fsanitize=undefined
DescriptionRunning a large of test cases with -fsanitize=undefined I see this error:

opencascade-7.4/src/BVH/BVH_RadixSorter.hxx:209:34: runtime error: left shift of 16777301 by 8 places cannot be represented in type 'Standard_Integer' (aka 'int')
opencascade-7.4/src/BVH/BVH_RadixSorter.hxx:209:34: runtime error: left shift of 33554432 by 8 places cannot be represented in type 'Standard_Integer' (aka 'int')

One solution is to change:

Standard_Interger aVoxel

to

Standard_Size aVoxel
Steps To ReproduceCompile OCCT with -fsanitize=undefined and run the test suite.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0030557newkgv Open CASCADE Coding - eliminate errors reported by -fsanitize 

-  Notes
(0087728)
git (administrator)
2019-10-03 06:50

Branch CR31024 has been created by kgv.

SHA-1: fa24e30851c81b9ace06f4f359e5300ad78e6ad9


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 06:49:59 2019 +0300

    0031024: Coding - invalid left shift in BVH_RadixSorter::Perform() using -fsanitize=undefined
    
    Standard_Integer has been replaced by unsigned int for bit operations.
(0087790)
kgv (developer)
2019-10-03 19:31

Patch is ready for review.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31024-master-KGV [^]
(0087802)
git (administrator)
2019-10-04 10:08

Branch CR31024_1 has been created by abv.

SHA-1: 603b5cf0930f6a0e216b388bcea446d71330f8ca


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 06:49:59 2019 +0300

    0031024: Coding - invalid left shift in BVH_RadixSorter::Perform() using -fsanitize=undefined
    
    Standard_Integer has been replaced by unsigned int for bit operations.
(0087803)
abv (manager)
2019-10-04 10:09

I have updated the patch to use unsigned not only in calculation of a bit mask, but also in places where it is further stored and checked.

Eugene, can you please have a look at the patch in branch CR31024_1?
(0087823)
emv (developer)
2019-10-04 16:16

Reviewed, although tests have not been restarted after update. I have restarted the job CR31024-master-KGV with new branch.

- Issue History
Date Modified Username Field Change
2019-10-03 05:42 galbramc New Issue
2019-10-03 05:42 galbramc Assigned To => kgv
2019-10-03 06:25 kgv Relationship added child of 0030557
2019-10-03 06:29 kgv Relationship added child of 0027368
2019-10-03 06:31 kgv Product Version => 7.1.0
2019-10-03 06:31 kgv Target Version => 7.5.0*
2019-10-03 06:31 kgv Summary invalid left shift in BVH_RadixSorter.hxx using -fsanitize=undefined (OCCT 7.4) => Coding - invalid left shift in BVH_RadixSorter::Perform() using -fsanitize=undefined
2019-10-03 06:50 git Note Added: 0087728
2019-10-03 19:31 kgv Note Added: 0087790
2019-10-03 19:31 kgv Assigned To kgv => abv
2019-10-03 19:31 kgv Status new => resolved
2019-10-04 09:44 abv Assigned To abv => emv
2019-10-04 10:08 git Note Added: 0087802
2019-10-04 10:09 abv Note Added: 0087803
2019-10-04 16:16 emv Note Added: 0087823
2019-10-04 16:16 emv Assigned To emv => bugmaster
2019-10-04 16:16 emv Status resolved => reviewed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker