MantisBT - Community
View Issue Details
0026348Community[OCCT] OCCT:Visualizationpublic2015-06-17 12:462016-04-20 15:50
abv 
bugmaster 
normalminor 
closedfixed 
 
[OCCT] 7.0.0[OCCT] 7.0.0 
Not needed
0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
The 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.
Compile with CLang (?)
No tags attached.
Issue History
2015-06-17 12:46abvNew Issue
2015-06-17 12:46abvAssigned To => kgv
2015-06-17 13:29kgvRelationship addedrelated to 0024393
2015-11-17 16:08kgvTarget Version7.0.0 => 7.1.0
2015-11-23 10:05kgvStatusnew => assigned
2015-11-23 10:05kgvTarget Version7.1.0 => 7.0.0
2015-11-23 10:05kgvSummaryIncorrect comparisons in OpenGl_View_Raytrace.cxx => Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
2015-11-23 12:35gitNote Added: 0048466
2015-11-23 12:35kgvNote Added: 0048467
2015-11-23 12:35kgvAssigned Tokgv => bugmaster
2015-11-23 12:35kgvStatusassigned => resolved
2015-11-23 12:35kgvStatusresolved => reviewed
2015-11-23 15:58apvAssigned Tobugmaster => apv
2015-11-24 15:11apvTest case number => Not needed
2015-11-24 15:14apvNote Added: 0048518
2015-11-24 15:14apvAssigned Toapv => kgv
2015-11-24 15:14apvStatusreviewed => assigned
2015-11-24 15:15apvNote Added: 0048519
2015-11-24 15:24gitNote Added: 0048521
2015-11-24 15:27gitNote Added: 0048523
2015-11-24 15:28kgvNote Added: 0048524
2015-11-24 15:28kgvAssigned Tokgv => bugmaster
2015-11-24 15:28kgvStatusassigned => resolved
2015-11-24 15:28kgvStatusresolved => reviewed
2015-11-24 16:59apvAssigned Tobugmaster => apv
2015-11-24 17:11gitNote Added: 0048534
2015-11-24 17:12apvNote Added: 0048535
2015-11-25 14:25apvNote Added: 0048564
2015-11-25 14:25apvAssigned Toapv => bugmaster
2015-11-25 14:25apvStatusreviewed => tested
2015-11-27 12:21bugmasterChangeset attached => occt master 6bd94e0d
2015-11-27 12:21bugmasterStatustested => verified
2015-11-27 12:21bugmasterResolutionopen => fixed
2016-04-17 14:07gitNote Added: 0053048
2016-04-17 14:07gitNote Added: 0053049
2016-04-20 15:42aivFixed in Version => 7.0.0
2016-04-20 15:50aivStatusverified => closed

Notes
(0048466)
git   
2015-11-23 12:35   
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().
(0048467)
kgv   
2015-11-23 12:35   
Please test the patch.
(0048518)
apv   
2015-11-24 15:14   
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%]
(0048519)
apv   
2015-11-24 15:15   
Dear kgv,

Branch CR26348 has been rejected due to:
- additional warnings
(0048521)
git   
2015-11-24 15:24   
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

(0048523)
git   
2015-11-24 15:27   
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().
(0048524)
kgv   
2015-11-24 15:28   
Please check compilation of updated patch in branch CR26348_1, regression testing is not needed.
(0048534)
git   
2015-11-24 17:11   
Branch CR26348_1 has been updated forcibly by apv.

SHA-1: 67ac1edd913e5fa29fa9c5c898243ff99a96cbaa
(0048535)
apv   
2015-11-24 17:12   
Branch CR26348_1 has been rebased on the current master
(0048564)
apv   
2015-11-25 14:25   
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)
(0053048)
git   
2016-04-17 14:07   
Branch CR26348 has been deleted by kgv.

SHA-1: 77812acade38cb382815035eb2a99e5df033e824
(0053049)
git   
2016-04-17 14:07   
Branch CR26348_1 has been deleted by kgv.

SHA-1: 67ac1edd913e5fa29fa9c5c898243ff99a96cbaa