MantisBT - Open CASCADE
View Issue Details
0025164Open CASCADE[OCCT] OCCT:Visualizationpublic2014-08-19 10:152014-11-11 12:58
kgv 
bugmaster 
normalminor 
closedfixed 
 
[OCCT] 6.8.0[OCCT] 6.8.0 
Not needed
0025164: BVH_Box::Area() might be called on uninitialized data
template<class T, int N>
T BVH_Box<T, N>::Area() const
{
  return BVHTools::SurfaceCalculator<T, N>::Area (myMaxPoint - myMinPoint);
}


within
template<class T, int N, int Bins>
void BVH_BinnedBuilder<T, N, Bins>::BuildNode (BVH_Set<T, N>*         theSet,
                                               BVH_Tree<T, N>*        theBVH,
                                               const Standard_Integer theNode)
...
      // Simple SAH evaluation
      Standard_Real aCost = (static_cast<Standard_Real> (aLftAABB.Area()) /* / aNodeArea */) * 
aLftCount
                          + (static_cast<Standard_Real> (aRghAABB.Area()) /* / aNodeArea */) * 
aRghCount;

aLftAABB or aRghAABB might be uninitialized boxes.
The total expression will be negotiated by multiplication with 0, but computation of area might generate FPE.
No tags attached.
related to 0024866new kgv Single definition of axis-aligned bounding box should be used across OCCT 
Issue History
2014-08-19 10:15kgvNew Issue
2014-08-19 10:15kgvAssigned To => kgv
2014-08-19 10:15kgvAssigned Tokgv => dbp
2014-08-19 10:15kgvStatusnew => assigned
2014-08-25 11:54kgvRelationship addedrelated to 0024866
2014-09-15 18:08gitNote Added: 0031726
2014-09-15 18:09dbpNote Added: 0031727
2014-09-15 18:09dbpAssigned Todbp => abv
2014-09-15 18:09dbpStatusassigned => resolved
2014-09-17 18:58abvNote Added: 0031834
2014-09-17 18:58abvAssigned Toabv => bugmaster
2014-09-17 18:58abvStatusresolved => reviewed
2014-09-18 16:19bugmasterAssigned Tobugmaster => mkv
2014-09-19 15:50gitNote Added: 0031907
2014-09-22 10:13mkvNote Added: 0031931
2014-09-22 10:14mkvTest case number => Not needed
2014-09-22 10:14mkvAssigned Tomkv => bugmaster
2014-09-22 10:14mkvStatusreviewed => tested
2014-09-26 14:49bugmasterChangeset attached => occt master 418864ae
2014-09-26 14:49bugmasterStatustested => verified
2014-09-26 14:49bugmasterResolutionopen => fixed
2014-09-29 23:14gitNote Added: 0032346
2014-11-11 12:45aivFixed in Version => 6.8.0
2014-11-11 12:58aivStatusverified => closed

Notes
(0031726)
git   
2014-09-15 18:08   
Branch CR25164 has been created by dbp.

SHA-1: 39e5d2c9d2de1c7443104842fd0505ba5827112b


Detailed log of new commits:

Author: dbp
Date: Mon Sep 15 18:08:03 2014 +0400

    0025164: BVH_Box::Area() might be called on uninitialized data
(0031727)
dbp   
2014-09-15 18:09   
Dear abv,

please review the patch in branch CR25164.
(0031834)
abv   
2014-09-17 18:58   
No remarks, please integrate (no testing is needed, I suppose)
(0031907)
git   
2014-09-19 15:50   
Branch CR25164 has been updated forcibly by mkv.

SHA-1: 764b86abf0ab1bacf1df98ff3904c4fe42e387b2
(0031931)
mkv   
2014-09-22 10:13   
Dear BugMaster,
Branch CR25164 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 764b86abf0ab1bacf1df98ff3904c4fe42e387b2

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
MacOS: 193 (193 on master)

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 355701816 / 355491316
Total CPU difference: 47616.280000000086 / 44818.970000000096
products component :
Total MEMORY difference: 110267712 / 110250572
Total CPU difference: 19064.299999999992 / 18358.06999999999

Testing on Windows:
occt component :
Total MEMORY difference: 243012508 / 242267280
Total CPU difference: 39189.4375 / 34303.3125
products component :
Total MEMORY difference: 66635428 / 66591984
Total CPU difference: 13574.671875 / 11913.0625

There are no differences in images found by testdiff.
(0032346)
git   
2014-09-29 23:14   
Branch CR25164 has been deleted by kgv.

SHA-1: 764b86abf0ab1bacf1df98ff3904c4fe42e387b2