MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026381Open CASCADE[OCCT] OCCT:Foundation Classespublic2015-06-29 20:222016-04-20 15:48
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.9.0 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.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
Attached Files

- Relationships

-  Notes
(0046128)
git (administrator)
2015-09-25 13:47

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.
(0046129)
akz (developer)
2015-09-25 13:52

Branch CR26381 is ready for review
(0046130)
kgv (developer)
2015-09-25 13:56

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.
(0046131)
akz (developer)
2015-09-25 14:26
edited on: 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?

(0046132)
abv (manager)
2015-09-25 14:35

I believe raising exception there is senseless and should be removed
(0046136)
git (administrator)
2015-09-25 15:36

Branch CR26381 has been updated forcibly by akz.

SHA-1: 595f3c875ea6b8445c2e0feb6787cecefc9e2dce
(0046137)
akz (developer)
2015-09-25 15:38
edited on: 2015-09-25 15:41

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

(0046164)
git (administrator)
2015-09-25 19:27

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

(0046165)
abv (manager)
2015-09-25 19:27

Reviewed and corrected; please test
(0046175)
git (administrator)
2015-09-25 20:46

Branch CR26381 has been updated forcibly by mkv.

SHA-1: 3b4c5369a49e7adbef0ca5514fe78b10287ec3d9
(0046207)
git (administrator)
2015-09-28 14:15

Branch CR26381 has been updated forcibly by apv.

SHA-1: b95d72ac467e640b00a21ce542e7f08754903962
(0046208)
apv (tester)
2015-09-28 14:16

Branch CR26381 has been rebased on the current master
(0046246)
apv (tester)
2015-09-29 11:50

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%]
(0046881)
git (administrator)
2015-10-16 16:14

Branch CR26381 has been deleted by kgv.

SHA-1: b95d72ac467e640b00a21ce542e7f08754903962

- Related Changesets
occt: master 4485f3d0
Timestamp: 2015-10-01 10:28:12
Author: 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
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 View Revisions
2015-09-25 13:52 akz Steps to Reproduce Updated View Revisions
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 View Revisions
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 View Revisions
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


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker