Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4883187

HotSpot debug build dumps core if current directory not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • None
    • generic
    • solaris_7

      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.

            bchristi Brent Christian
            pbk Peter Kessler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: