Community
Participate
Working Groups
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:
Created attachment 69473 [details] Leak1
Created attachment 69474 [details] Leak2
Created attachment 69475 [details] Leak3
Created attachment 69476 [details] Leak4
Created attachment 69477 [details] Leak5
Created attachment 69478 [details] Leak6
Created attachment 69479 [details] Leak7
Created attachment 69480 [details] Leak8
Created attachment 69481 [details] Leak9
Fixed in chart plug-ins. Reassign to report engine team for birt.core issues.
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.
adding iplog+ per Ganymede IP log