MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024534Open CASCADE[OCCT] OCCT:Visualizationpublic2014-01-16 11:222014-11-11 12:51
Reporterabv 
Assigned Toabv 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformLinuxOSDebian 4.0OS Version64 bit
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 6.8.0Fixed in Version[OCCT] 6.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
Attached Files

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

-  Notes
(0028650)
kgv (developer)
2014-04-03 12:27

Patch for OCCT and Products is ready for review in branch CR24534_1 (based on CR24405).
(0028670)
san (developer)
2014-04-04 09:21
edited on: 2014-04-04 09:22

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

(0028743)
apn (administrator)
2014-04-08 15:46

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
Timestamp: 2014-04-04 05:15:40
Author: 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.
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 View Revisions
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


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker