View Issue Details

IDProjectCategoryView StatusLast Update
0026348CommunityOCCT:Visualizationpublic2016-04-20 15:50
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.0.0 
Summary0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
DescriptionThe issue has been reported in OCE mailing list: in three places in OpenGl_View_Raytrace.cxx, array is compared against NULL, which should be always false:

OpenGl_View_Raytrace.cxx: if (theStructure->Transformation()->mat != NULL)
OpenGl_View_Raytrace.cxx: theStructure->Transformation()->mat ? aStructTransform : NULL, theGlContext);
OpenGl_View_Raytrace.cxx: theStructure->Transformation()->mat ? aStructTransform : NULL, theGlContext);

Here mat is a field (array) of the class OpenGl_Matrix, hence compiler (CLang) can assume it is always non-null.

It is likely that result of Transformation() should be compared against NULL instead (i.e. just remove "->mat"), to be checked.
Steps To ReproduceCompile with CLang (?)
TagsNo tags attached.
Test case numberNot needed

Activities

git

2015-11-23 12:35

administrator   ~0048466

Branch CR26348 has been created by kgv.

SHA-1: 8b6da609f6c03747af0ac90d5296cbf5d6b866c6


Detailed log of new commits:

Author: osa
Date: Mon Nov 23 12:34:50 2015 +0300

    0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
    
    Graphic3d_CStructure::Transformation - use Graphic3d_Mat4 instead of plain arrays.
    Drop duplicating field OpenGl_Structure::myTransformation (copy of Graphic3d_CStructure::Transformation).
    Drop unused property Graphic3d_CStructure::Composition and Graphic3d_Structure::Composition().

kgv

2015-11-23 12:35

developer   ~0048467

Please test the patch.

apv

2015-11-24 15:14

tester   ~0048518

Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 1 (0 on master)
   Windows: 0 (0 on master)
   MacOS: 128 (127 on master)
products component:
   Linux: 39 (39 on master)
   Windows: 0 (0 on master)
There is new additional warnings on Linux and MacOS:
Graphic3d_Structure.cxx:1561, GNU C Compiler 4 (gcc), Priority: Normal
suggest parentheses around '&&' within '||' [-Wparentheses]

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 92891480 / 93581960 [-0.74%]
Total CPU difference: 19956.579999999853 / 19980.499999999956 [-0.12%]

Testing on Windows:
Total MEMORY difference: 58363630 / 58376964 [-0.02%]
Total CPU difference: 18159.655207298943 / 18194.31862949887 [-0.19%]

apv

2015-11-24 15:15

tester   ~0048519

Dear kgv,

Branch CR26348 has been rejected due to:
- additional warnings

git

2015-11-24 15:24

administrator   ~0048521

Branch CR26348 has been updated by kgv.

SHA-1: 77812acade38cb382815035eb2a99e5df033e824


Detailed log of new commits:

Author: kgv
Date: Tue Nov 24 15:24:34 2015 +0300

    eliminate new compiler warning

git

2015-11-24 15:27

administrator   ~0048523

Branch CR26348_1 has been created by kgv.

SHA-1: ee4b1cbdbf62ef98eb12b74a10b9c320ab585d71


Detailed log of new commits:

Author: osa
Date: Tue Nov 24 15:26:34 2015 +0300

    0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
    
    Graphic3d_CStructure::Transformation - use Graphic3d_Mat4 instead of plain arrays.
    Drop duplicating field OpenGl_Structure::myTransformation (copy of Graphic3d_CStructure::Transformation).
    Drop unused property Graphic3d_CStructure::Composition and Graphic3d_Structure::Composition().

kgv

2015-11-24 15:28

developer   ~0048524

Please check compilation of updated patch in branch CR26348_1, regression testing is not needed.

git

2015-11-24 17:11

administrator   ~0048534

Branch CR26348_1 has been updated forcibly by apv.

SHA-1: 67ac1edd913e5fa29fa9c5c898243ff99a96cbaa

apv

2015-11-24 17:12

tester   ~0048535

Branch CR26348_1 has been rebased on the current master

apv

2015-11-25 14:25

tester   ~0048564

Dear BugMaster,

Branch CR26348_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms.
SHA-1: 67ac1edd913e5fa29fa9c5c898243ff99a96cbaa

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MacOS: 134 (134 on master)
products component:
   Linux: 39 (39 on master)
   Windows: 0 (0 on master)

git

2016-04-17 14:07

administrator   ~0053048

Branch CR26348 has been deleted by kgv.

SHA-1: 77812acade38cb382815035eb2a99e5df033e824

git

2016-04-17 14:07

administrator   ~0053049

Branch CR26348_1 has been deleted by kgv.

SHA-1: 67ac1edd913e5fa29fa9c5c898243ff99a96cbaa

Related Changesets

occt: master 6bd94e0d

2015-11-24 12:26:34

osa


Committer: bugmaster Details Diff
0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix

Graphic3d_CStructure::Transformation - use Graphic3d_Mat4 instead of plain arrays.
Drop duplicating field OpenGl_Structure::myTransformation (copy of Graphic3d_CStructure::Transformation).
Drop unused property Graphic3d_CStructure::Composition and Graphic3d_Structure::Composition().
Affected Issues
0026348
mod - src/Graphic3d/Graphic3d_CStructure.cxx Diff File
mod - src/Graphic3d/Graphic3d_CStructure.hxx Diff File
mod - src/Graphic3d/Graphic3d_Structure.cxx Diff File
mod - src/Graphic3d/Graphic3d_Structure.hxx Diff File
mod - src/OpenGl/FILES Diff File
rm - src/OpenGl/OpenGl_Matrix.cxx Diff File
mod - src/OpenGl/OpenGl_Matrix.hxx Diff File
mod - src/OpenGl/OpenGl_Structure.cxx Diff File
mod - src/OpenGl/OpenGl_Structure.hxx Diff File
mod - src/OpenGl/OpenGl_StructureShadow.cxx Diff File
mod - src/OpenGl/OpenGl_View.hxx Diff File
mod - src/OpenGl/OpenGl_View_Raytrace.cxx Diff File

Issue History

Date Modified Username Field Change
2015-06-17 12:46 abv New Issue
2015-06-17 12:46 abv Assigned To => kgv
2015-11-17 16:08 kgv Target Version 7.0.0 => 7.1.0
2015-11-23 10:05 kgv Status new => assigned
2015-11-23 10:05 kgv Target Version 7.1.0 => 7.0.0
2015-11-23 10:05 kgv Summary Incorrect comparisons in OpenGl_View_Raytrace.cxx => Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
2015-11-23 12:35 git Note Added: 0048466
2015-11-23 12:35 kgv Note Added: 0048467
2015-11-23 12:35 kgv Assigned To kgv => bugmaster
2015-11-23 12:35 kgv Status assigned => resolved
2015-11-23 12:35 kgv Status resolved => reviewed
2015-11-23 15:58 apv Assigned To bugmaster => apv
2015-11-24 15:11 apv Test case number => Not needed
2015-11-24 15:14 apv Note Added: 0048518
2015-11-24 15:14 apv Assigned To apv => kgv
2015-11-24 15:14 apv Status reviewed => assigned
2015-11-24 15:15 apv Note Added: 0048519
2015-11-24 15:24 git Note Added: 0048521
2015-11-24 15:27 git Note Added: 0048523
2015-11-24 15:28 kgv Note Added: 0048524
2015-11-24 15:28 kgv Assigned To kgv => bugmaster
2015-11-24 15:28 kgv Status assigned => resolved
2015-11-24 15:28 kgv Status resolved => reviewed
2015-11-24 16:59 apv Assigned To bugmaster => apv
2015-11-24 17:11 git Note Added: 0048534
2015-11-24 17:12 apv Note Added: 0048535
2015-11-25 14:25 apv Note Added: 0048564
2015-11-25 14:25 apv Assigned To apv => bugmaster
2015-11-25 14:25 apv Status reviewed => tested
2015-11-27 12:21 bugmaster Changeset attached => occt master 6bd94e0d
2015-11-27 12:21 bugmaster Status tested => verified
2015-11-27 12:21 bugmaster Resolution open => fixed
2016-04-17 14:07 git Note Added: 0053048
2016-04-17 14:07 git Note Added: 0053049
2016-04-20 15:42 aiv Fixed in Version => 7.0.0
2016-04-20 15:50 aiv Status verified => closed