JDK-5018791 : -Xcheck:jni fails in chroot environment
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2004-03-23
  • Updated: 2005-11-04
  • Resolved: 2005-11-04
Related Reports
Duplicate :  
Description
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) 
======================================================================

Comments
EVALUATION This bug is a duplicate and has been fixed in 1.5.X and 1.6.X, if a backport to 1.4.2 is required it needs to be escalated.
04-11-2005

EVALUATION I've checked latest jdk1.4.2, jdk1.5.0_04, 1.6 under chroot linux. 1.4.2 always fails at startup without /proc mounted, 1.5.0_04 and 1.6 issues the warning 'Can't detect initial thread stack location - find_vma failed', but works for the procedure specified (building xerces). So, it looks like this bug has already been fixed in 1.5-1.6. The question is whether the fix should be performed for 1.4.2.
19-08-2005

EVALUATION Need to look into this maybe after tiger. I don't think this is a P3 bug. ###@###.### 2004-03-23
23-03-2004