#480 RVM crash when given non-existing classpath

unreproduced
closed
Dave Grove
runtime (64)
5
2012-09-21
2005-04-30
Rubidium
No

The JikesRVM crashes when you supply a non-existing
jarfile via the "-cp"/"-classpath" parameter on
(Vanilla) Linux 2.6.9-rc1-bk1 and later x86 kernels. It
does not appear to happen on x86_64 kernels (see
http://jsb.st.informatik.tu-darmstadt.de:8080/pipermail/steamloom/2005-April/000016.html)
It due to the following patch: "[PATCH] i386 virtual
memory layout rework". (see
http://kernel.org/pub/linux/kernel/v2.6/snapshots/old/patch-2.6.9-rc1-bk1.log
just after line number 2800).
It can be prevented by setting the program (or
everything) in a 'legacy' mode, but I think that is not
the recommend way to solve this problem..

Versions of used programs:
Kernel Vanilla 2.6.11.4
Jikes Compiler - Version 1.18 - 21 November 2002
production Jikes RVM 2.3.5 using GNU Classpath 0.14
gcc version 3.3.5 (Debian 1:3.3.5-12)
Java(TM) 2 Runtime (and compiler) Environment, Standard
Edition (build Blackdown-1.4.1-beta)

I have set RVM_FOR_SINGLE_VIRTUAL_PROCESSOR to '1' in
rvm/config/i686-pc-linux-gnu, because I had some
trouble compiling an earlier version with that set to
'0' and compiling takes ages on my computer.

The following is generated with a Vanilla 2.6.11.7
kernel, HelloWorld is a 'classical' Hello World
'application':
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
uname -r
2.6.11.7
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
cat /proc/sys/vm/legacy_va_layout
0
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
./rvm HelloWorld
Hello, world!
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
./rvm -cp nonexistingjar.jar:. HelloWorld
JikesRVM.no-pthreads: internal error: recursive use of
hardware exception registers (exiting)
-- Stack --
Lcom/ibm/JikesRVM/VM_StackTrace; <init>(I)V at line 74
Ljava/lang/Throwable;
fillInStackTrace()Ljava/lang/Throwable; at line 109
Ljava/lang/Throwable; <init>()V at line 53
Ljava/lang/Throwable; <init>(Ljava/lang/String;)V at
line 58
Ljava/lang/Exception; <init>(Ljava/lang/String;)V at
line 78
Ljava/lang/RuntimeException;
<init>(Ljava/lang/String;)V at line 76
Ljava/lang/IndexOutOfBoundsException;
<init>(Ljava/lang/String;)V at line 73
Ljava/lang/ArrayIndexOutOfBoundsException;
<init>(I)V at line 85
Lcom/ibm/JikesRVM/VM_Runtime;
deliverHardwareException(II)V at line 634
<hardware trap="">
Lcom/ibm/JikesRVM/VM_CompiledMethods;
getCompiledMethod(I)Lcom/ibm/JikesRVM/VM_CompiledMethod;
at line 83
Lcom/ibm/JikesRVM/VM_StackBrowser;
upOneFrameInternal(Z)Z at line 64
Lcom/ibm/JikesRVM/VM_StackBrowser; upOneFrame()V at
line 74
Lcom/ibm/JikesRVM/VM_StackBrowser; up()V at line 84
Lcom/ibm/JikesRVM/classloader/VM_Class;
getClassLoaderFromStackFrame(I)Ljava/lang/ClassLoader;
at line 648
Lcom/ibm/JikesRVM/jni/VM_JNIFunctions;
FindClass(Lcom/ibm/JikesRVM/jni/VM_JNIEnvironment;Lorg/vmmagic/unboxed/Address;)I
at line 157
<invisible method="">
JikesRVM.no-pthreads: internal error: recursive use of
hardware exception registers (exiting)
JikesRVM.no-pthreads: exit 128
Segmentation fault
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
ls nonexistingjar.jar
ls: nonexistingjar.jar: No such file or directory
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
touch nonexistingjar.jar
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
./rvm -cp nonexistingjar.jar:. HelloWorld
Hello, world!
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$ su
Password:
acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin# echo '1' >
/proc/sys/vm/legacy_va_layout
acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin# exit
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
rm nonexistingjar.jar
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$
./rvm -cp nonexistingjar.jar:. HelloWorld
Hello, world!
rubidium@acer-vmware:/usr/src/jikesrvm-2.3.5/rvm/bin$

Discussion

  • Dave Grove
    Dave Grove
    2005-05-16

    Logged In: YES
    user_id=1215435

    I just checked in a fix to what might be a related defect
    (1189786). If you get a chance, maybe try again with cvs
    head and see if it still fails? I wasn't able to reproduce
    the crash you reported, but I'm running on a 2.4 kernel.

     
  • Rubidium
    Rubidium
    2005-05-17

    Logged In: YES
    user_id=1269875

    The current CVS HEAD gives exactly the same exception, i.e.
    even the linenumbers did not change.
    Furthermore it is a fact that it occurs on x86 machines (not
    x86-64) for the 2.6.9 and newer kernel, due to an update to
    the memory subsystem, so the 2.4 kernel will never show the bug.

     
  • Dave Grove
    Dave Grove
    2005-06-20

    Logged In: YES
    user_id=1215435

    Might be specific to RVM_FOR_SINGLE_VIRTUAL_PROCESSOR=1.

    I just ran on a RHEL4 machine (details below) and didn't
    observe the crash.

    [dgrove@angmar cp]$ uname -a
    Linux angmar.watson.ibm.com 2.6.9-5.0.5.ELsmp #1 SMP Fri Apr
    8 14:29:47 EDT 2005 i686 i686 i386 GNU/Linux

     
  • Michael Haupt
    Michael Haupt
    2005-06-24

    Logged In: YES
    user_id=1302296

    I've done some investigation on this. My machine is an
    Athlon64 running Debian Linux (Sid) with a 2.6.8-11 kernel.
    The Jikes RVM version I use is 2.3.1.

    The problem occurs when a JAR or ZIP file listed in the
    classpath does not exist. The cause seems to be as follows:
    when a file is to be opened for read access that does not
    exist, the native method java.io.FileDescriptor.nativeOpen()
    throws a FileNotFoundException. There seems to be some
    problem with building the stack trace for this exception
    (the trace output by the crash suggests this).

    I wonder how this relates to the changed memory management
    routines in the 2.6 kernels.

    What could be done about this? My next step would be to look
    at how exceptions are thrown from native code, but I think I
    need some advice.

     
  • Dave Grove
    Dave Grove
    2005-06-25

    Logged In: YES
    user_id=1215435

    I tried again with a prototype build,
    RVM_FOR_SINGLE_VIRTUAL_PROCESSOR=1, cvs head of jikes rvm on
    a 2.6.11 kernel on a x86 box. Details below. I was unable
    to get the VM to crash.

    [dgrove@angmar myTests]$ ls
    A.class C.class hanoi.class LoopTest.class Makefile
    Silly101.class
    B.class CVS/ hanoi.java LoopTest.java README
    Silly101.java
    [dgrove@angmar myTests]$ uname -a
    Linux angmar.watson.ibm.com 2.6.9-11.ELsmp #1 SMP Fri May 20
    18:26:27 EDT 2005 i686 i686 i386 GNU/Linux
    [dgrove@angmar myTests]$ rvm -fullversion
    prototype Jikes RVM 2.3.6+CVS using GNU Classpath 0.15
    cvs timestamp: 2005/06/24 13:21:46 UTC
    host config:
    /homes/meriadoc/jalapeno/config/i686-pc-linux.watson
    target config:
    /homes/meriadoc/jalapeno/config/i686-pc-linux.watson
    heap default initial size: 20 MiBytes
    heap default maximum size: 100 MiBytes
    [dgrove@angmar myTests]$ rvm -X:processors=2
    vm: I can not support multiple processors; check the
    -X:singleVirtualProcessor flag
    JikesRVM.no-pthreads: exit 100
    [dgrove@angmar myTests]$ rvm -cp blat.jar hanoi
    java.lang.NoClassDefFoundError: Could not find the class hanoi:
    hanoi not found in SystemAppCL
    JikesRVM.no-pthreads: exit 123
    [dgrove@angmar myTests]$ rvm -cp .:blat.jar hanoi
    For 3 disks, 7 moves
    [dgrove@angmar myTests]$ rvm -cp blat.jar:. hanoi
    For 3 disks, 7 moves

    I am on RHEL 4, not Debian. So perhaps that is the difference?

    I'm not sure if this is worth pursuing if you can't
    reproduce in cvs head (or at least 2.3.6 with classpath
    0.15). Been lots of changes in classpath since Jikes RVM 2.31.

     
  • Dave Grove
    Dave Grove
    2005-07-19

    Logged In: YES
    user_id=1215435

    Is this a symptom of 1224191 (some part of the RVM address
    space conflicting with shared libraries)? If you get a
    chance, maybe try picking up the changes to
    BOOTIMAGE_ADDRESS and MAXIMUM_MAPPABLE from that bug report
    and see if that handles this case as well?

     
  • Michael Haupt
    Michael Haupt
    2005-07-22

    Logged In: YES
    user_id=1302296

    Unfortunately, the settings from 1224191 don't help. The VM
    still crashes when a non-existent file is in the classpath.

    I've tested this with Jikes RVM 2.3.1, compiled and run in a
    32bit chroot on an AMD64 Debian Linux with kernel 2.6.8.

     
  • Dave Grove
    Dave Grove
    2005-12-21

    Logged In: YES
    user_id=1215435

    I'm going to close this as unreproducible. If it's still an
    issue in current versions of Jikes RVM on your platform,
    then we'll have to try to dig deeper, but since we've never
    been able to reproduce it on any of our machines I'm not
    sure what else to do with it.