VirtualBox

Ticket #11232 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

Java XPCOM Bridge crash Oracle Java JVM => Fixed in SVN

Reported by: noteirak Owned by:
Component: other Version: VirtualBox 4.2.4
Keywords: xpcom java api sdk Cc:
Guest type: all Host type: Linux

Description

While using the Java XPCOM bridge API, I've encountered a reproducible JVM crash that totally prevent the use of the Java-XPCOM bridge, also known as vboxjxpcom.jar, this under Debian Wheezy.

You will find 3 files attached to this ticket :

  1. The java code to reproduce the bug, being simply the sample code provided into the SDK PDF file, without the line starting the VM.
  2. The crash log file from the JVM
  3. A putty session log with the list of all the commands ran since the install of the systems with the list of installed packages at some key moments.

How to reproduce :

  1. Using Virtualbox, create a Linux Debian 64 bits VM
  2. Boot from Debian image called debian-wheezy-DI-b3-amd64-netinst.iso
  3. Install with only SSH server & basic system tools
  4. Add Virtualbox repos for wheezy to apt & install 4.2.4, accepting all required packages.
  5. Install the following JRE : jre-7u9-linux-x64.tar.gz
  6. Compile the java class into sample.jar and copy to current dir
  7. Copy vboxjxpcom.jar to the current dir
  8. java -Dvbox.home=/usr/lib/virtualbox -cp ./vboxjxpcom.jar:sample.jar rrr
  9. See crash

Attachments

hs_err_pid9622.log Download (41.1 KB) - added by noteirak 10 years ago.
JVM crash log
putty-vboxtest.zip Download (44.8 KB) - added by noteirak 10 years ago.
Putty session log file
rrr.java Download (498 bytes) - added by noteirak 10 years ago.
Java code to reproduce
hs_err_pid26682.log Download (70.0 KB) - added by drewr 10 years ago.
Oracle JDK 6 on Linux 3.5 crash report
hs_err_pid10420.log Download (85.1 KB) - added by sx270169 10 years ago.

Change History

Changed 10 years ago by noteirak

JVM crash log

Changed 10 years ago by noteirak

Putty session log file

Changed 10 years ago by noteirak

Java code to reproduce

comment:1 Changed 10 years ago by noteirak

This crash also happen under Ubuntu server 12.10, following the same steps.

comment:2 Changed 10 years ago by noteirak

I can also reproduce this in the SVN r43953 using Oracle Java 1.6.0_37 - see forum post  https://forums.virtualbox.org/viewtopic.php?f=10&t=52805

comment:3 Changed 10 years ago by noteirak

Using SVN r43953 and openJDK 1.6.0_24, the JVM does not crash anymore, but the following error occur :

noteirak@debian:~$ java -Dvbox.home=/usr/lib/virtualbox -cp vboxjxpcom.jar:sample.jar Sample
VirtualBox version: 4.2.51_OSE

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Native Method)
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaProxy.java:143)
        at $Proxy1.getMachines(Unknown Source)
        at org.virtualbox_4_3.IVirtualBox.getMachines(IVirtualBox.java:110)
        at Sample.main(Sample.java:9)
noteirak@debian:~$

Slightly changed java code to produce this :

import org.virtualbox_4_3.IVirtualBox;
import org.virtualbox_4_3.VirtualBoxManager;

public class Sample {
	public static void main(String[] args) {
		VirtualBoxManager mgr = VirtualBoxManager.createInstance(null);
		IVirtualBox vbox = mgr.getVBox();
		System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
		System.out.println("There are " + vbox.getMachines().size() + " VMs on this host.");
		mgr.cleanup();
	}
}

Changed 10 years ago by drewr

Oracle JDK 6 on Linux 3.5 crash report

comment:4 Changed 10 years ago by drewr

I'm experiencing a very similar issue. Attached my crash report above.

Changed 10 years ago by sx270169

comment:5 Changed 10 years ago by sx270169

The crash also happens with Virtualbox 4.2.6!

Virtualbox Version: 4.2.6r82870
java version "1.7.0_09"
OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

See crash report: hs_err_pid10420.log

comment:6 Changed 10 years ago by noteirak

noteirak@vbox-svn:~$ java -Dvbox.home=/opt/VirtualBox -cp vboxjxpcom.jar:xpcom.jar Sample
VirtualBox version: 4.2.51_OSE

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f9187bc3c87, pid=4482, tid=140263046547200
#
# JRE version: 7.0_03-b21
# Java VM: OpenJDK 64-Bit Server VM (22.0-b10 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea7 2.1.7
# Distribution: Debian GNU/Linux 7.0 (wheezy), package 7u3-2.1.7-1
# Problematic frame:
# V  [libjvm.so+0x50fc87]  jni_SetLongArrayRegion+0x107
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/noteirak/hs_err_pid4482.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#

Still present at r45730 using the sample code at comment #3

comment:7 Changed 10 years ago by noteirak

noteirak@VBTest:~$ java -Dvbox.home=/usr/lib/virtualbox -cp ./vboxjxpcom.jar:./sample.jar Sample
VirtualBox version: 4.2.16

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f70c82ddfb7, pid=12411, tid=140122394121984
#
# JRE version: 7.0_21-b02
# Java VM: OpenJDK 64-Bit Server VM (23.7-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x53efb7]  jni_SetLongArrayRegion+0x107
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/noteirak/hs_err_pid12411.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#
Aborted
noteirak@VBTest:~$

Still an issue at 4.2.16

comment:8 Changed 10 years ago by klaus

Just one additional, very isolated data point: tried your code with my local build (latest trunk, no related fixes to avoid creating hope), and it doesn't crash, it behaves exactly as expected. Quite old java here, official Oracle/Sun JRE 1.6.0_26, 64 bit (Linux host). However this data point means that I can't immediately reproduce the problem.

comment:9 Changed 10 years ago by noteirak

noteirak@VBTest:~$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
noteirak@VBTest:~$ java -Dvbox.home=/usr/lib/virtualbox -cp ./vboxjxpcom.jar:./sample.jar Sample
VirtualBox version: 4.2.16

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Native Method)
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaProxy.java:143)
        at $Proxy1.getMachines(Unknown Source)
        at org.virtualbox_4_2.IVirtualBox.getMachines(IVirtualBox.java:110)
        at Sample.main(Sample.java:9)
noteirak@VBTest:~$

We already had this dicussion tho, and we couldn't get anything out of it easily. Issue look the same, the error being triggered at a different level:
jni_SetLongArrayRegion+0x107 vs java.lang.ArrayIndexOutOfBoundsException

I don't desperate to find enough time and energy to look at VB code and try to see what the hell is going on... but no great hope yet, C/C++ is not my thing.

comment:10 Changed 9 years ago by klaus

This is getting super mysterious... with the VM you provided this is easily reproducible. But whenever I replace libvboxjxpcom.so with a locally built one (i.e. including debug info so that I can work out exactly where it crashes, what the parameters are and so on, the crash magically disappears and the previously crashing test completes just fine. Of course there were no changes to the sources of libvboxjxpcom.so since 4.3 was branched off, so it's either a super indirect issue (behavior differences caused by different header files or the like), or specific to how we build the debian packages (or the Linux release packages in general).

comment:11 Changed 9 years ago by klaus

I hope I squashed the super well hidden bug in libvboxjxpcom.so (why don't compilers warn when there's really fishy code?). The bug is in the base package, NOT in the sdk, so you'll have to wait for updates which rectify this...

Check out  http://www.virtualbox.org/download/testcase/virtualbox-4.3_4.3.7-92153~Debian~wheezy_amd64.deb

comment:12 Changed 9 years ago by noteirak

No more crash with your test build, seems like you got it!

I'll do more indepth tests and let you know but seems like you can mark this as fixed.

Last edited 9 years ago by noteirak (previous) (diff)

comment:13 Changed 9 years ago by frank

  • Summary changed from Java XPCOM Bridge crash Oracle Java JVM to Java XPCOM Bridge crash Oracle Java JVM => Fixed in SVN

comment:14 Changed 9 years ago by frank

Could you test  VBox 4.3.8 RC1?

comment:15 Changed 9 years ago by noteirak

I confirm it is fixed with the 4.3.8 RC1 release. Thank you!

comment:16 Changed 9 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fix is part of VBox 4.3.8.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use