View Issue Details

IDProjectCategoryView StatusLast Update
0028257Open CASCADEOCCT:Data Exchangepublic2017-09-29 16:25
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.1.0 
Target Version7.2.0Fixed in Version7.2.0 
Summary0028257: XCAFPrs_Style - uninitialized memory usage within ::HashCode()
DescriptionMethod XCAFPrs_Style::HashCode() aggressively casts structure address to array of integers, which then used for computing hash code. This produces undefined results since the payload of the structure is not multiple of integer and there is a gap between fields.

Also, current implementation of XCAFPrs_Style::SetVisibility() in addition to changing the visibility flag also resets color attributes with the strange comment "for hash codes":
void XCAFPrs_Style::SetVisibility (const Standard_Boolean visibility)
{
  myVisibility = visibility;
  if ( ! visibility ) { UnSetColorSurf(); UnSetColorCurv(); } // for hash codes
}


This behavior is unexpected to user who is certainly not expecting hidden style loosing all other important attributes.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0027772 closedabv Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int" 

Activities

git

2017-01-25 20:26

administrator   ~0063055

Branch CR28257 has been created by kgv.

SHA-1: e16d5e1650bf11386125a42c05ccead2f1ac9fc7


Detailed log of new commits:

Author: kgv
Date: Wed Jan 25 20:26:27 2017 +0300

    0028257: XCAFPrs_Style - uninitialized memory usage within ::HashCode()
    
    XCAFPrs_Style::HashCode() function has been corrected.
    XCAFPrs_Style::SetVisibility() does not reset assigned colors anymore.

kgv

2017-01-25 20:27

developer   ~0063056

Patch is ready for review.

san

2017-01-27 17:54

developer   ~0063142

Branch CR28257 reviewed without remarks, ready for testing.

git

2017-01-27 18:11

administrator   ~0063143

Branch CR28257 has been updated forcibly by apv.

SHA-1: 341d72cd38a65d5aa6f6cb90bb9d4152e9a64c44

apv

2017-01-27 18:11

tester   ~0063144

Branch CR28257 has been rebased on the current master

apv

2017-01-30 12:16

tester   ~0063185

Dear BugMaster,

Branch CR28257 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 341d72cd38a65d5aa6f6cb90bb9d4152e9a64c44

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1150

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 91861354 / 92310271 [-0.49%]
Total CPU difference: 20325.42000000019 / 19914.260000000217 [+2.06%]

Testing on Windows:
Total MEMORY difference: 57614536 / 57618048 [-0.01%]
Total CPU difference: 18543.168065698468 / 18683.178963198647 [-0.75%]

git

2017-02-08 11:36

administrator   ~0063599

Branch CR28257 has been deleted by kgv.

SHA-1: 341d72cd38a65d5aa6f6cb90bb9d4152e9a64c44

Related Changesets

occt: master 650efe05

2017-01-25 17:26:27

kgv


Committer: apn Details Diff
0028257: XCAFPrs_Style - uninitialized memory usage within ::HashCode()

XCAFPrs_Style::HashCode() function has been corrected.
XCAFPrs_Style::SetVisibility() does not reset assigned colors anymore.
Affected Issues
0028257
mod - src/XCAFPrs/XCAFPrs_Style.cxx Diff File
mod - src/XCAFPrs/XCAFPrs_Style.hxx Diff File

Issue History

Date Modified Username Field Change
2016-12-21 17:29 kgv New Issue
2016-12-21 17:29 kgv Assigned To => gka
2016-12-21 17:30 kgv Assigned To gka => kgv
2016-12-21 17:30 kgv Status new => assigned
2016-12-21 17:31 kgv Product Version 7.1.0 => 6.3.1
2017-01-25 19:45 kgv Summary XCAFPrs_Style - method ::SetVisibility() should not modify color information => XCAFPrs_Style - uninitialized memory usage within ::HashCode()
2017-01-25 19:45 kgv Description Updated
2017-01-25 19:45 kgv Steps to Reproduce Updated
2017-01-25 20:26 git Note Added: 0063055
2017-01-25 20:27 kgv Note Added: 0063056
2017-01-25 20:27 kgv Assigned To kgv => san
2017-01-25 20:27 kgv Status assigned => resolved
2017-01-27 17:54 san Note Added: 0063142
2017-01-27 17:54 san Assigned To san => bugmaster
2017-01-27 17:54 san Status resolved => reviewed
2017-01-27 17:57 kgv Relationship added related to 0027772
2017-01-27 17:59 kgv Product Version 6.3.1 => 7.1.0
2017-01-27 18:03 apv Assigned To bugmaster => apv
2017-01-27 18:11 git Note Added: 0063143
2017-01-27 18:11 apv Note Added: 0063144
2017-01-27 18:11 apv Test case number => Not needed
2017-01-30 12:16 apv Note Added: 0063185
2017-01-30 12:16 apv Assigned To apv => bugmaster
2017-01-30 12:16 apv Status reviewed => tested
2017-01-30 12:19 kgv Target Version 7.2.0 => 7.3.0
2017-02-03 16:52 apn Changeset attached => occt master 650efe05
2017-02-03 16:52 apn Assigned To bugmaster => apn
2017-02-03 16:52 apn Status tested => verified
2017-02-03 16:52 apn Resolution open => fixed
2017-02-08 11:36 git Note Added: 0063599
2017-03-03 17:41 bugmaster Target Version 7.3.0 => 7.2.0
2017-03-06 11:53 bugmaster Target Version 7.2.0 => 7.3.0
2017-05-19 15:36 abv Target Version 7.3.0 => 7.2.0
2017-09-29 16:18 aiv Fixed in Version => 7.2.0
2017-09-29 16:25 aiv Status verified => closed