Name: js151677 Date: 08/13/2004
JDK 1.5's temporary native libraries may not be deleted on VM exit
In JDK 1.5 the concept of a temporary native library is implemented in
javax/management/loading/Mlet.java.
It used java.io.File.deleteOnExit() on the temporary native library to
indicate the file should be deleted when Java VM exits.
Unfortunately there is a prohibition against deleting an open shared
library on HPUX. The unlink() system call will fail with errno==ETXTBSY
on HPUX. As a result, on HPUX and possibly other operating systems
the temporary native library files used by Mlet often are not deleted.
(Solaris operating system does not appear to be impacted by this issue.)
The JDK 1.5's VM shutdown sequence does not unload any remaining shared
libraries. Also the deleteOnExit() hook is run too early, when the Java
daemon threads are still running and may be registering additional
deleteOnExit entries. A race condition is possible.
To implement this feature properly the VM should unload any remaining
open shared libraries in its shutdown process. Only after the shared
libraries are closed should the deleteOnExit() hook be run.
(Incident Review ID: 296806)
======================================================================
JDK 1.5's temporary native libraries may not be deleted on VM exit
In JDK 1.5 the concept of a temporary native library is implemented in
javax/management/loading/Mlet.java.
It used java.io.File.deleteOnExit() on the temporary native library to
indicate the file should be deleted when Java VM exits.
Unfortunately there is a prohibition against deleting an open shared
library on HPUX. The unlink() system call will fail with errno==ETXTBSY
on HPUX. As a result, on HPUX and possibly other operating systems
the temporary native library files used by Mlet often are not deleted.
(Solaris operating system does not appear to be impacted by this issue.)
The JDK 1.5's VM shutdown sequence does not unload any remaining shared
libraries. Also the deleteOnExit() hook is run too early, when the Java
daemon threads are still running and may be registering additional
deleteOnExit entries. A race condition is possible.
To implement this feature properly the VM should unload any remaining
open shared libraries in its shutdown process. Only after the shared
libraries are closed should the deleteOnExit() hook be run.
(Incident Review ID: 296806)
======================================================================
- relates to
-
JDK-4240589 (ref) runFinalizersOnExit(true) causes VM crash for user native libraries
-
- Closed
-
-
JDK-4171239 File.deleteOnExit() does not work on open files (win32)
-
- Closed
-
-
JDK-8164512 Replace ClassLoader use of finalizer with phantom reference to unload native library
-
- Resolved
-