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

-Xcheck:jni fails in chroot environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.2
    • hotspot
    • x86
    • linux

      Name: jl125535 Date: 03/23/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)


      FULL OS VERSION :
      Linux mash.office.altlinux.ru 2.4.22-std-smp-alt16 #1 SMP Wed Jan 28 16:23:07 MSK 2004 i686 unknown unknown GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      2 Intel Xeon CPUs
      glibc version 2.2.6

      A DESCRIPTION OF THE PROBLEM :
      I experience problems trying to run JRE in a chrooted jail environment on Linux. We use this technique to build RPM packages in a locked-down setup. Such package builds that involve ant + J2SE 1.4.2 always cause a warning from HotSpot and result in hangups very often. When java is run in the chrooted environment with -Xcheck:jni option, it fails inevitably.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Set up a chroot jail environment that has the JRE, glibc, core Linux utilities and system files installed into it (we use RPM packages to achieve this).

      Create a helper executable that chroot's into the jail and runs Java with -Xcheck:jni option on the test class provided below.

      For a harder stress on the VM, try building Xerces-J 2.6.2 from source archive and tool jars, available at http://xml.apache.org/xerces2-j/ -- it never completes successfully for us.


      EXPECTED VERSUS ACTUAL BEHAVIOR :cc
      EXPECTED -
      Java should terminate without runtime errors.

      ACTUAL -
      The JVM produces an error and aborts execution.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
      FATAL ERROR in native method: Bad global or local ref passed to JNI
      at java.lang.Class.getPrimitiveClass(Native Method)
      at java.lang.Float.<clinit>(Float.java:70)
      at java.util.Hashtable.<init>(Hashtable.java:156)
      at java.util.Hashtable.<init>(Hashtable.java:183)
      at java.util.Properties.<init>(Properties.java:84)
      at java.util.Properties.<init>(Properties.java:76)
      at java.lang.System.initializeSystemClass(System.java:871)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class SmokeTest {
          public static void main(String[] args) {
              Float f = new Float(1.0);
              System.out.println(f);
          }
      }

      ---------- END SOURCE ----------
      (Incident Review ID: 244564)
      ======================================================================

            ksrini Kumar Srinivasan
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: