View Issue Details

IDProjectCategoryView StatusLast Update
0024534Open CASCADEOCCT:Visualizationpublic2014-11-11 12:51
ReporterabvAssigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformLinuxOSDebian 4.0 
Product Version6.7.0 
Target Version6.8.0Fixed in Version6.8.0 
Summary0024534: Improve design of Image_PixMap class
DescriptionThis issue is highlighed by GCC compiler warning on breakage of C strict aliasing rules in type conversion, see 0024252:

Image_PixMap.hxx:247: warning: dereferencing type-punned pointer will break strict-aliasing rules

The actual problem seems to be poor design of Image_PixMap class: it has a field of the type Image_PixMapData<Standard_Byte> but provides a means to address it as if it had different type (via its methods EditData(), ReadData(), Value()). This is obviously incorrect.

One possibility to fix it could be providing method to convert between Image_PixMapData<> classes with different template argument, and make correct instance when needed (possibly creating several instances sharing the same buffer).
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0024406 closedapn Visualization - crash on re-usage of the same primitive array 
related to 0024405 closedapn TKernel - add aligned allocator class NCollection_AlignedAllocator 
child of 0024252 closedbugmaster GCC warnings on breakage of strict-aliasing rules 

Activities

kgv

2014-04-03 12:27

developer   ~0028650

Patch for OCCT and Products is ready for review in branch CR24534_1 (based on CR24405).

san

2014-04-04 09:21

developer   ~0028670

Last edited: 2014-04-04 09:22

Branch CR24534_1 reviewed in occt and occt-products without remarks, ready for testing.

apn

2014-04-08 15:46

administrator   ~0028743

Dear BugMaster,

OCCT and Products branch CR24534_1 was compiled on Linux and Windows platforms and tested.
SHA-1: b97dd89f9e256987a5de3175b7aa04cda087ed16

Number of compiler warnings:

occt component :
Linux: 24 (27 on master) - 3 warnings in inc/Image_PixMap.hxx were removed
Windows: 0 (0 on master)

products component :
Linux: 12 (12 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 395027512 / 350990000
Total CPU difference: 58587.06999999985 / 50414.12000000013

Testing on Windows:
Total MEMORY difference: 437939848 / 380569632
Total CPU difference: 35148.125 / 36389.671875

There are no differences in images found by testdiff.

Related Changesets

occt: master ca0c0b11

2014-04-04 05:15:40

abv


Committer: abv Details Diff
0024534: Improve design of Image_PixMap class

Remove template methods Image_PixMap::EditData(), ::ReadData().
Add template method Image_PixMap::ChangeValue().
Remove redundant parameter for Image_PixMap::Clear() method.

Make Image_PixMapData non-template class. Introduce NCollection_Buffer.
Affected Issues
0024534
mod - src/Image/Image_AlienPixMap.cxx Diff File
mod - src/Image/Image_AlienPixMap.hxx Diff File
mod - src/Image/Image_Diff.cxx Diff File
mod - src/Image/Image_PixMap.cxx Diff File
mod - src/Image/Image_PixMap.hxx Diff File
mod - src/Image/Image_PixMapData.hxx Diff File
mod - src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx Diff File
mod - src/NCollection/FILES Diff File
add - src/NCollection/NCollection_Buffer.hxx Diff File
mod - src/OpenGl/OpenGl_AspectMarker.cxx Diff File
mod - src/OpenGl/OpenGl_View_2.cxx Diff File
mod - src/QABugs/QABugs_19.cxx Diff File

Issue History

Date Modified Username Field Change
2014-01-16 11:22 abv New Issue
2014-01-16 11:22 abv Assigned To => san
2014-01-16 11:25 abv Relationship added child of 0024252
2014-01-16 11:36 abv Product Version => 6.7.0
2014-01-16 11:36 abv Target Version => 6.7.1
2014-02-05 12:45 san Assigned To san => kgv
2014-02-05 12:45 san Status new => assigned
2014-03-29 18:52 kgv Relationship added related to 0024406
2014-03-29 18:53 kgv Relationship added related to 0024405
2014-04-03 12:27 kgv Note Added: 0028650
2014-04-03 12:27 kgv Assigned To kgv => san
2014-04-03 12:27 kgv Status assigned => resolved
2014-04-03 12:27 kgv Summary Poor design of Image_PixMap class => Improve design of Image_PixMap class
2014-04-04 09:21 san Note Added: 0028670
2014-04-04 09:21 san Assigned To san => bugmaster
2014-04-04 09:21 san Status resolved => reviewed
2014-04-04 09:22 san Note Edited: 0028670
2014-04-04 16:26 abv Target Version 6.7.1 => 6.8.0
2014-04-04 17:55 mkv Assigned To bugmaster => apn
2014-04-08 15:46 apn Note Added: 0028743
2014-04-08 15:48 apn Test case number => Not needed
2014-04-08 15:48 apn Assigned To apn => bugmaster
2014-04-08 15:48 apn Status reviewed => tested
2014-04-11 14:43 abv Changeset attached => occt master ca0c0b11
2014-04-11 14:43 abv Assigned To bugmaster => abv
2014-04-11 14:43 abv Status tested => verified
2014-04-11 14:43 abv Resolution open => fixed
2014-11-11 12:47 aiv Fixed in Version => 6.8.0
2014-11-11 12:51 aiv Status verified => closed