View Issue Details

IDProjectCategoryView StatusLast Update
0031024CommunityOCCT:Codingpublic2020-12-02 17:12
Reportergalbramc Assigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.1.0 
Target Version7.5.0Fixed in Version7.5.0 
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 numberNot needed

Relationships

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

Activities

git

2019-10-03 06:50

administrator   ~0087728

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.

kgv

2019-10-03 19:31

developer   ~0087790

Patch is ready for review.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31024-master-KGV

git

2019-10-04 10:08

administrator   ~0087802

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.

abv

2019-10-04 10:09

manager   ~0087803

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?

emv

2019-10-04 16:16

developer   ~0087823

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

git

2019-10-23 11:51

administrator   ~0088475

Branch CR31024 has been deleted by kgv.

SHA-1: fa24e30851c81b9ace06f4f359e5300ad78e6ad9

git

2019-10-23 11:51

administrator   ~0088476

Branch CR31024_1 has been deleted by kgv.

SHA-1: 603b5cf0930f6a0e216b388bcea446d71330f8ca

Related Changesets

occt: master c2bcd983

2019-10-03 03:49:59

abv


Committer: abv Details Diff
0031024: Coding - invalid left shift in BVH_RadixSorter::Perform() using -fsanitize=undefined

Standard_Integer has been replaced by unsigned int for bit operations.
Affected Issues
0031024
mod - src/BVH/BVH_LinearBuilder.hxx Diff File
mod - src/BVH/BVH_RadixSorter.hxx Diff File

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: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
2019-10-23 01:07 abv Changeset attached => occt master c2bcd983
2019-10-23 01:07 abv Assigned To bugmaster => abv
2019-10-23 01:07 abv Status reviewed => verified
2019-10-23 01:07 abv Resolution open => fixed
2019-10-23 01:18 apn Test case number => Not needed
2019-10-23 11:51 git Note Added: 0088475
2019-10-23 11:51 git Note Added: 0088476
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed