View Issue Details

IDProjectCategoryView StatusLast Update
0026381Open CASCADEOCCT:Foundation Classespublic2016-04-20 15:48
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.9.0 
Target Version7.0.0Fixed in Version7.0.0 
Summary0026381: OSD_File - close file on destruction
DescriptionCurrent implementation of OSD_File keeps file opened on destruction which might lead to memory leaks or file locks.

Since this behavior is unusual (e.g. std::ofstream closes file on destruction) it would be better to fix this to avoid possible errors.
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot needed

Activities

git

2015-09-25 13:47

administrator   ~0046128

Branch CR26381 has been created by akz.

SHA-1: 4faf706ee4a38ed5fcc6c8c254458cf3174f5de8


Detailed log of new commits:

Author: akz
Date: Fri Sep 25 13:44:41 2015 +0300

    0026381: OSD_File - close file on destruction
    
    Add destructor for OSD_File, that unlocks and close file.

akz

2015-09-25 13:52

developer   ~0046129

Branch CR26381 is ready for review

kgv

2015-09-25 13:56

developer   ~0046130

I suppose that the following check:
764 Standard_Boolean OSD_File::IsOpen()const{
765
766  if (myPath.Name().Length()==0)
767    Standard_ProgramError::Raise("OSD_File::IsOpen : empty file name");

might lead to exception during destruction of empty OSD_File.

akz

2015-09-25 14:26

developer   ~0046131

Last edited: 2015-09-25 14:27

Is this check kind of linux specific? Cause code for windows does not contain such check in the same functions.
IsOpen() anyway returns False, if file path is empty. Do we really need to throw exception here?

abv

2015-09-25 14:35

manager   ~0046132

I believe raising exception there is senseless and should be removed

git

2015-09-25 15:36

administrator   ~0046136

Branch CR26381 has been updated forcibly by akz.

SHA-1: 595f3c875ea6b8445c2e0feb6787cecefc9e2dce

akz

2015-09-25 15:38

developer   ~0046137

Last edited: 2015-09-25 15:41

Senseless checks were removed from IsOpen(), IsLocked() and GetLock().
Branch CR26381 was updated.

git

2015-09-25 19:27

administrator   ~0046164

Branch CR26381 has been updated by abv.

SHA-1: 813f90935bd3c963b73a8c803de5ee6e6c7d6855


Detailed log of new commits:

Author: abv
Date: Fri Sep 25 19:27:25 2015 +0300

    Destructor of OSD_FileNode is made protected to avoid possibility of deleting descendants by pointer to base class

abv

2015-09-25 19:27

manager   ~0046165

Reviewed and corrected; please test

git

2015-09-25 20:46

administrator   ~0046175

Branch CR26381 has been updated forcibly by mkv.

SHA-1: 3b4c5369a49e7adbef0ca5514fe78b10287ec3d9

git

2015-09-28 14:15

administrator   ~0046207

Branch CR26381 has been updated forcibly by apv.

SHA-1: b95d72ac467e640b00a21ce542e7f08754903962

apv

2015-09-28 14:16

tester   ~0046208

Branch CR26381 has been rebased on the current master

apv

2015-09-29 11:50

tester   ~0046246

Dear BugMaster,

Branch CR26381 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
SHA-1: b95d72ac467e640b00a21ce542e7f08754903962

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

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 93373001 / 93274110 [+0.11%]
Total CPU difference: 19437.86999999933 / 19594.749999999236 [-0.80%]

Testing on Windows:
Total MEMORY difference: 57926411 / 57934407 [-0.01%]
Total CPU difference: 17980.987261999133 / 17727.251635499077 [+1.43%]

git

2015-10-16 16:14

administrator   ~0046881

Branch CR26381 has been deleted by kgv.

SHA-1: b95d72ac467e640b00a21ce542e7f08754903962

Related Changesets

occt: master 4485f3d0

2015-10-01 10:28:12

akz


Committer: bugmaster Details Diff
0026381: OSD_File - close file on destruction

Add destructor for OSD_File, that unlocks and close file.

Remove senseless checks from status functions in code for Linux.

Destructor of OSD_FileNode is made protected to avoid possibility of deleting descendants by pointer to base class
Affected Issues
0026381
mod - src/OSD/OSD_File.cxx Diff File
mod - src/OSD/OSD_File.hxx Diff File
mod - src/OSD/OSD_FileNode.hxx Diff File

Issue History

Date Modified Username Field Change
2015-06-29 20:22 kgv New Issue
2015-06-29 20:22 kgv Assigned To => abv
2015-09-25 00:51 abv Assigned To abv => akz
2015-09-25 00:51 abv Status new => assigned
2015-09-25 08:26 kgv Summary OSD_File - close file on desctruction => OSD_File - close file on destruction
2015-09-25 13:47 git Note Added: 0046128
2015-09-25 13:51 akz Assigned To akz => abv
2015-09-25 13:51 akz Status assigned => resolved
2015-09-25 13:51 akz Steps to Reproduce Updated
2015-09-25 13:52 akz Steps to Reproduce Updated
2015-09-25 13:52 akz Note Added: 0046129
2015-09-25 13:56 kgv Note Added: 0046130
2015-09-25 14:26 akz Note Added: 0046131
2015-09-25 14:26 akz Status resolved => feedback
2015-09-25 14:27 akz Note Edited: 0046131
2015-09-25 14:35 abv Note Added: 0046132
2015-09-25 14:35 abv Status feedback => assigned
2015-09-25 15:36 git Note Added: 0046136
2015-09-25 15:38 akz Note Added: 0046137
2015-09-25 15:38 akz Status assigned => resolved
2015-09-25 15:41 akz Note Edited: 0046137
2015-09-25 19:27 git Note Added: 0046164
2015-09-25 19:27 abv Note Added: 0046165
2015-09-25 19:27 abv Assigned To abv => bugmaster
2015-09-25 19:27 abv Status resolved => reviewed
2015-09-25 20:46 git Note Added: 0046175
2015-09-25 20:49 mkv Assigned To bugmaster => mkv
2015-09-25 20:58 mkv Assigned To mkv => apv
2015-09-28 14:15 git Note Added: 0046207
2015-09-28 14:16 apv Note Added: 0046208
2015-09-29 11:43 apv Test case number => Not needed
2015-09-29 11:50 apv Note Added: 0046246
2015-09-29 11:50 apv Assigned To apv => bugmaster
2015-09-29 11:50 apv Status reviewed => tested
2015-10-02 14:56 bugmaster Changeset attached => occt master 4485f3d0
2015-10-02 14:56 bugmaster Status tested => verified
2015-10-02 14:56 bugmaster Resolution open => fixed
2015-10-16 16:14 git Note Added: 0046881
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:48 aiv Status verified => closed