JDK-5085781 : JNI_CreateJavaVM() should never call vm_exit_during_initialization()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-08-11
  • Updated: 2017-02-06
  • Resolved: 2017-02-06
Related Reports
Relates :  
Relates :  
Description
Name: rmT116609			Date: 08/11/2004


A DESCRIPTION OF THE REQUEST :
Currently there are certain conditions under which a call to JNI_CreateJavaVM() will result in exit() being called internally. This poses a serious problem when running in headless mode because there underlying application is given no chance to redirect stdout/stderr to a remote console before the process shuts down. In  certain cases, the JVM does not actually own the process which it is terminating.

In my particular case, I am running a JVM in explorer.exe's process-space. If JVM initialization fails due to missing DLLs at runtime (I pass "-Xruntdi:port=8888,startAudit=t") JNI_CreateJavaVM() terminates the process. This is a big no-no for me because I can not see the stdout/stderr output (the application needs to explicitly redirect it) as well explorer.exe gets terminated and as an application, I have no right to do this.

The error message being sent to stdout/stderr is:

Error occurred during initialization of VM
Could not find agent library on the library path or in the local directory: tdi

If I deploy the system on a customer's machine and for whatever reason he misplaces some files we will spend *days* trying to debug what is going wrong!

JUSTIFICATION :
- The JVM does not own the process it runs inside of
- There is no way to redirect stdout/stderr if the process terminates before returning control to the application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JNI_CreateJavaVM() should output to stdout/stderr and return from the function with an error code, passing control back to the application.
ACTUAL -
Process is terminated prematurely.
(Incident Review ID: 296668) 
======================================================================
###@###.### 10/19/04 16:14 GMT

Comments
EVALUATION Will investigate post tiger.
08-09-2004