View Issue Details

IDProjectCategoryView StatusLast Update
0025314Open CASCADEOCCT:Codingpublic2014-11-11 13:01
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version6.8.0Fixed in Version6.8.0 
Summary0025314: Usage of smart pointers for dynamically allocated memory in BVH
DescriptionAlgorithms implemented in BVH package use simple C pointers allocated with operator new and released with explicit delete. This practice is unsafe and can lead to memory leaks if delete is forgotten (see example of this problem fixed in BVH_SweepPlaneBuilder::BuildNode() in branch CR25159_1, commit 76037d9).

Instead, classes providing automatic memory release (smart pointers, e.g. std::auto_ptr<>, or arrays, e.g. NCollection_Array1<>) should be used.
TagsNo tags attached.
Test case number

Relationships

related to 0025159 closedbugmaster Collections and common types in BVH package are named in non-conformant manner 

Activities

abv

2014-10-01 20:08

manager   ~0032541

Last edited: 2014-10-01 20:10

The same problem (memory leak) seems to be present in BVH_LinearBuilder.lxx, see aLinkMap. Tricks with *new() in the code using TBB in the same file also look suspicious, please check and add appropriate explanatory comment in the code if this is specific to TBB way of life.

Note that work with TBB will need to be revised in context of 0024826.

git

2014-10-09 17:18

administrator   ~0032918

Branch CR25314 has been created by dbp.

SHA-1: 30fd13756b18f00bc1c855ce936f04450e101328


Detailed log of new commits:

Author: dbp
Date: Thu Oct 9 17:17:57 2014 +0400

    0025314: Usage of smart pointers for dynamically allocated memory in BVH

git

2014-10-09 17:59

administrator   ~0032923

Branch CR25314_1 has been created by dbp.

SHA-1: af320d54a90314734f96e9a9b7f2e387cb23131c


Detailed log of new commits:

Author: dbp
Date: Thu Oct 9 17:59:01 2014 +0400

    0025314: Usage of smart pointers for dynamically allocated memory in BVH

dbp

2014-10-09 18:00

developer   ~0032924

Dear abv,

please review the patch in branch CR25314_1.

git

2014-10-09 18:40

administrator   ~0032942

Branch CR25314_1 has been deleted by dbp.

SHA-1: af320d54a90314734f96e9a9b7f2e387cb23131c

git

2014-10-09 18:40

administrator   ~0032944

Branch CR25314_1 has been created by dbp.

SHA-1: 420091f4b0d4959033bfd9aa754e5992927f7abb


Detailed log of new commits:

Author: dbp
Date: Thu Oct 9 18:40:20 2014 +0400

    025314: Usage of smart pointers for dynamically allocated memory in BVH

abv

2014-10-10 05:58

manager   ~0032950

No remarks, please check compilation and integrate. Note that testing is not required since changes are in classes not yet used in other parts of OCCT.

git

2014-10-21 16:40

administrator   ~0033410

Branch CR25314_1 has been deleted by inv.

SHA-1: 420091f4b0d4959033bfd9aa754e5992927f7abb

git

2014-10-21 16:40

administrator   ~0033412

Branch CR25314 has been deleted by inv.

SHA-1: 30fd13756b18f00bc1c855ce936f04450e101328

Related Changesets

occt: master e3709f1d

2014-10-10 12:14:53

dbp


Committer: bugmaster Details Diff
025314: Usage of smart pointers for dynamically allocated memory in BVH Affected Issues
0025314
mod - src/BVH/BVH_LinearBuilder.lxx Diff File
mod - src/BVH/BVH_SweepPlaneBuilder.lxx Diff File

Issue History

Date Modified Username Field Change
2014-10-01 19:46 abv New Issue
2014-10-01 19:46 abv Assigned To => kgv
2014-10-01 19:47 abv Relationship added related to 0025159
2014-10-01 20:08 abv Note Added: 0032541
2014-10-01 20:10 abv Note Edited: 0032541
2014-10-06 13:12 kgv Assigned To kgv => dbp
2014-10-06 13:12 kgv Status new => assigned
2014-10-09 17:18 git Note Added: 0032918
2014-10-09 17:59 git Note Added: 0032923
2014-10-09 18:00 dbp Note Added: 0032924
2014-10-09 18:00 dbp Assigned To dbp => abv
2014-10-09 18:00 dbp Status assigned => resolved
2014-10-09 18:40 git Note Added: 0032942
2014-10-09 18:40 git Note Added: 0032944
2014-10-10 05:58 abv Note Added: 0032950
2014-10-10 05:58 abv Assigned To abv => bugmaster
2014-10-10 05:58 abv Status resolved => reviewed
2014-10-13 17:52 bugmaster Changeset attached => occt master e3709f1d
2014-10-13 17:52 bugmaster Status reviewed => verified
2014-10-13 17:52 bugmaster Resolution open => fixed
2014-10-21 16:40 git Note Added: 0033410
2014-10-21 16:40 git Note Added: 0033412
2014-11-11 12:43 aiv Fixed in Version => 6.8.0
2014-11-11 13:01 aiv Status verified => closed