If you try to run HotSpot debug build when the current working directory
can't be determined (e.g., it's been removed), the JVM crashes.
Steps to reproduce the problem:
In shell 1:
$ mkdir Foo
$ cd Foo
In shell 2:
$ rmdir Foo
Back in shell 1:
$ $Deployed/JDK-1.5.0/bin/java_g -version
Warning: Cannot open log file: hotspot.log
Warning: Forcing option -XX:LogFile=/tmp//hs_pid3449.log
Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
Dumping core....
Abort
Of course, dbx is no help in this situation:
$ dbx $Deployed/JDK-1.5.0/bin/java_g core
fatal error: Cannot find run directory for dbx -- Error 0
and anyway, since there's no current directory, there's no core file to debug:
$ ls -l core
core not found
The java.lang.Error comes from
/java/re/jdk/1.5.0/latest/ws/j2se/src/solaris/native/java/lang/java_props_md.c
and the stack trace looks like it would be:
getcwd(buf, sizeof(buf)) in java_props_md.c
java_props_t *sprops = GetJavaProperties(env); in System.c
initProperties(props); in System.java
JavaCalls::call_static(.... initializeSystemClass_name(), ....) in thread.cpp
call_initializeSystemClass(CHECK_0); in thread.cpp
jint result = Threads::create_vm((JavaVMInitArgs*) args); in jni.cpp
r = ifn->CreateJavaVM(pvm, (void **)penv, &args); in java.c
I'm not sure who is being surprised by the exception and dumping
core. The product build puts out the error message and then seems
to exit cleanly, so I'm lowering the priority.