MantisBT - Open CASCADE
View Issue Details
0028257Open CASCADE[OCCT] OCCT:Data Exchangepublic2016-12-21 17:292017-09-29 16:25
kgv 
apn 
normalminor 
closedfixed 
[OCCT] 7.1.0 
[OCCT] 7.2.0[OCCT] 7.2.0 
Not needed
0028257: XCAFPrs_Style - uninitialized memory usage within ::HashCode()
Method 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.
N/A
No tags attached.
related to 0027772closed abv Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int" 
Issue History
2016-12-21 17:29kgvNew Issue
2016-12-21 17:29kgvAssigned To => gka
2016-12-21 17:30kgvAssigned Togka => kgv
2016-12-21 17:30kgvStatusnew => assigned
2016-12-21 17:31kgvProduct Version7.1.0 => 6.3.1
2017-01-25 19:45kgvSummaryXCAFPrs_Style - method ::SetVisibility() should not modify color information => XCAFPrs_Style - uninitialized memory usage within ::HashCode()
2017-01-25 19:45kgvDescription Updatedbug_revision_view_page.php?rev_id=15924#r15924
2017-01-25 19:45kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15926#r15926
2017-01-25 20:26gitNote Added: 0063055
2017-01-25 20:27kgvNote Added: 0063056
2017-01-25 20:27kgvAssigned Tokgv => san
2017-01-25 20:27kgvStatusassigned => resolved
2017-01-27 17:54sanNote Added: 0063142
2017-01-27 17:54sanAssigned Tosan => bugmaster
2017-01-27 17:54sanStatusresolved => reviewed
2017-01-27 17:57kgvRelationship addedrelated to 0027772
2017-01-27 17:59kgvProduct Version6.3.1 => 7.1.0
2017-01-27 18:03apvAssigned Tobugmaster => apv
2017-01-27 18:11gitNote Added: 0063143
2017-01-27 18:11apvNote Added: 0063144
2017-01-27 18:11apvTest case number => Not needed
2017-01-30 12:16apvNote Added: 0063185
2017-01-30 12:16apvAssigned Toapv => bugmaster
2017-01-30 12:16apvStatusreviewed => tested
2017-01-30 12:19kgvTarget Version7.2.0 => 7.3.0
2017-02-03 16:52apnChangeset attached => occt master 650efe05
2017-02-03 16:52apnAssigned Tobugmaster => apn
2017-02-03 16:52apnStatustested => verified
2017-02-03 16:52apnResolutionopen => fixed
2017-02-08 11:36gitNote Added: 0063599
2017-03-03 17:41bugmasterTarget Version7.3.0 => 7.2.0
2017-03-06 11:53bugmasterTarget Version7.2.0 => 7.3.0
2017-05-19 15:36abvTarget Version7.3.0 => 7.2.0
2017-09-29 16:18aivFixed in Version => 7.2.0
2017-09-29 16:25aivStatusverified => closed

Notes
(0063055)
git   
2017-01-25 20:26   
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.
(0063056)
kgv   
2017-01-25 20:27   
Patch is ready for review.
(0063142)
san   
2017-01-27 17:54   
Branch CR28257 reviewed without remarks, ready for testing.
(0063143)
git   
2017-01-27 18:11   
Branch CR28257 has been updated forcibly by apv.

SHA-1: 341d72cd38a65d5aa6f6cb90bb9d4152e9a64c44
(0063144)
apv   
2017-01-27 18:11   
Branch CR28257 has been rebased on the current master
(0063185)
apv   
2017-01-30 12:16   
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%]
(0063599)
git   
2017-02-08 11:36   
Branch CR28257 has been deleted by kgv.

SHA-1: 341d72cd38a65d5aa6f6cb90bb9d4152e9a64c44