Bug Hunting Session
Bug 116767 - Java: Call URLClassLoader.close once our runtime baseline is Java 7
Summary: Java: Call URLClassLoader.close once our runtime baseline is Java 7
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:6.4.0
Keywords:
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2018-04-03 09:58 UTC by Stephan Bergmann
Modified: 2019-08-08 11:38 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2018-04-03 09:58:08 UTC
See coverity resource leak reports 1371366 (scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java), 1371372 (scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java), and 1371376 (scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java), which I closed for now: "java.net.URLClassLoader derives from Closeable only since Java 7 (and we still support older), so best ignore this for now."
Comment 1 Xisco Faulí 2018-07-02 23:05:51 UTC
Dear Stephan Bergmann,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 2 QA Administrators 2019-08-01 03:37:19 UTC Comment hidden (obsolete)
Comment 3 Stephan Bergmann 2019-08-01 06:41:29 UTC
On master towards LO 6.4, the Java baseline is >= 7 now since <https://gerrit.libreoffice.org/plugins/gitiles/core/+/aafc10c9edb61e13ac557c7e43c8d4a31dce4f37%5E!/> "Bump Java baseline to Java 8", so we can go ahead.
Comment 4 Commit Notification 2019-08-08 11:29:12 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/418533f0af7cd303d559c8fb136c49e7e9fb0d79%5E%21

Related tdf#116767: Call URLClassLoader.close

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Stephan Bergmann 2019-08-08 11:38:06 UTC
Unlike closing the URLClassLoader obtained via ClassLoaderFactory.getURLClassLoader in scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java in the commit of comment 4 (which was not listed among the three files reported by Coverity in comment 0), closing the URLClassLoader obtained via ClassLoaderFactory.getURLClassLoader in the three files reported by Coverity in comment 0 is not (easily) doable:  In each case, the URLClassLoader is passed on to other classes that hold references to it, so it must only be closed when those other class instances are finalized (and which happens automatically).  So resolving as WONTFIX.

(Details about the Coverity reports mentioned in comment 0 are lost to history, btw.)