Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 190154 - A few potential possibilities of resource leaks have been found on BIRT code base.
Summary: A few potential possibilities of resource leaks have been found on BIRT code ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.2.0 RC3   Edit
Assignee: Wei Wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 04:26 EDT by Roman Arkhangelskiy CLA
Modified: 2008-06-18 15:13 EDT (History)
1 user (show)

See Also:
bjorn.freeman-benson: iplog+


Attachments
Leak1 (77.04 KB, image/jpeg)
2007-05-31 04:26 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak2 (79.79 KB, image/jpeg)
2007-05-31 04:27 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak3 (114.48 KB, image/jpeg)
2007-05-31 04:27 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak4 (126.24 KB, image/jpeg)
2007-05-31 04:28 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak5 (113.08 KB, image/jpeg)
2007-05-31 04:28 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak6 (102.90 KB, image/jpeg)
2007-05-31 04:29 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak7 (107.59 KB, image/jpeg)
2007-05-31 04:29 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak8 (141.09 KB, image/jpeg)
2007-05-31 04:30 EDT, Roman Arkhangelskiy CLA
no flags Details
Leak9 (142.83 KB, image/jpeg)
2007-05-31 04:30 EDT, Roman Arkhangelskiy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Arkhangelskiy CLA 2007-05-31 04:26:08 EDT
Build ID: 2.1.2

Steps To Reproduce:
I have been running Jtest's BugDetective feature on BIRT source code and it reported a few possible resource leaks.

The attached screenshots from BugDetective will help to understand the exact flow which may lead to the exception.

org.eclipse.birt.chart.internal.prefs.DefaultsManager.java:

File streams leaks at lines 225 and 239. See screenshots 'Leak1' and 'Leak2' respectively.


org.eclipse.birt.chart.model.impl.SerializerImpl:

FileInputStream allocated at line 332 gets never freed afterwards (Screenshot Leak3).


org.eclipse.birt.core.archive.ArchiveUtil:

FileInputStream allocated at line 247 may leak if the exception from line 252 is thrown (Screenshot Leak4);

FileInputStream allocated at line 304 may leak if the exception from line 308 is thrown (Screenshot Leak5);

FileInputStream allocated at line 487 may leak if the exception from line 491 is thrown (Screenshot Leak6);


org.eclipse.birt.core.config.FileConfigVarManager:

FileInputStream allocated at line 83 gets never freed afterwards (Screenshot Leak7).


org.eclipse.birt.core.framework.PlatformServletContext:

OutputStream allocated at line 122 may leak if the exception from line 124 is thrown (Screenshot Leak8);


org.eclipse.birt.core.archive.FolderArchiveWriter:

if a call to the constructor of RAFolderOutputStream made at line 60 rpoduces an exception then the RAF represented by the field RAFolderOutputStream.randomFile will never be closed (see Leak9).

Please let me know if this is a real problem or BugDetective is mistaken.

Thank you!

More information:
Comment 1 Roman Arkhangelskiy CLA 2007-05-31 04:26:43 EDT
Created attachment 69473 [details]
Leak1
Comment 2 Roman Arkhangelskiy CLA 2007-05-31 04:27:04 EDT
Created attachment 69474 [details]
Leak2
Comment 3 Roman Arkhangelskiy CLA 2007-05-31 04:27:41 EDT
Created attachment 69475 [details]
Leak3
Comment 4 Roman Arkhangelskiy CLA 2007-05-31 04:28:09 EDT
Created attachment 69476 [details]
Leak4
Comment 5 Roman Arkhangelskiy CLA 2007-05-31 04:28:34 EDT
Created attachment 69477 [details]
Leak5
Comment 6 Roman Arkhangelskiy CLA 2007-05-31 04:29:06 EDT
Created attachment 69478 [details]
Leak6
Comment 7 Roman Arkhangelskiy CLA 2007-05-31 04:29:33 EDT
Created attachment 69479 [details]
Leak7
Comment 8 Roman Arkhangelskiy CLA 2007-05-31 04:30:03 EDT
Created attachment 69480 [details]
Leak8
Comment 9 Roman Arkhangelskiy CLA 2007-05-31 04:30:32 EDT
Created attachment 69481 [details]
Leak9
Comment 10 Yulin Wang CLA 2007-06-06 06:10:42 EDT
Fixed in chart plug-ins.
Reassign to report engine team for birt.core issues.
Comment 11 Wei Wang CLA 2007-06-07 05:29:02 EDT
engine should checkin these modification in head and v2.1.3

for Leak1, Leak2, Leak3: Chart Engine has fixed them.

for Leak4, Leak5, Leak6:
in class ArchiveUtil.java, add try..catch..finally to ensure the resource has been closed correctly.

for Leak7:
in class FileConfigVarManager.java, close FileInputStream in try..finally.. and ensure the resource has been closed correctly.

for Leak8:
in class PlatformServletContext.java, close the input stream and output stream in try..finally..

for Leak9:
we add try..catch.. to ensure the randomFile has been closed correctly when we get an excepiton after calling the constructor of FolderArchiveWriter.

set FIXED.

Comment 12 Bjorn Freeman-Benson CLA 2008-06-18 15:13:39 EDT
adding iplog+ per Ganymede IP log