harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zakharov, Vasily M" <vasily.m.zakha...@intel.com>
Subject [ibmvm][classlib][concurrent] java.util.concurrent doesn't work on IBM VM?
Date Thu, 12 Apr 2007 19:03:39 GMT
Hi, all,

As far as I can see, currently java.util.concurrent package doesn't work
with IBM VM, because it relies on sun.misc.Unsafe that doesn't work with
IBM VM. So I've got a number of interesting questions:

- Does IBM VM have an operational implementation of sun.misc.Unsafe ?

- What is the "official" status of Concurrent package implementation in
Harmony with respect to IBM VM ?

- Can/should we use Concurrent package in implementation of other
Harmony packages (like AWT) ?

This issue showed up while investigating AWT issue HARMONY-3601. The
simple test that demonstrates the problem is simply running:

java java.util.concurrent.locks.LockSupport

Consider the following printouts:

DRL VM:

Uncaught exception in main:
java.lang.NoSuchMethodError: main
(this is clearly the correct behavior)

IBM VM:

Exception in thread "main" java.lang.NoClassDefFoundError:
sun.misc.Unsafe
        at
java.util.concurrent.locks.LockSupport.<clinit>(LockSupport.java:80)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
(sun.misc.Unsafe is just absent)

IBM VM (with Suncompat module enabled in bootclasspath.properties):

Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.harmony.kernel.vm.Objects
        at sun.misc.Unsafe.<init>(Unsafe.java:64)
        at sun.misc.Unsafe.<clinit>(Unsafe.java:34)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
        at
java.util.concurrent.locks.LockSupport.<clinit>(LockSupport.java:80)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)

This stack demonstrates that the default implementation of
sun.misc.Unsafe in Suncompat module doesn't work with IBM VM (it
wouldn't work with DRL VM either, but DRL VM has its own implementation
in jdk/jre/bin/kernel.jar), as org.apache.harmony.kernel.vm.Objects
class doesn't exist in jdk/jre/bin/luni-kernel.jar.

IBM VM has luni-kernel-stubs.jar in jdk/jre/lib/boot, but it's not
mentioned in bootclasspath.properties. Adding it to bootclasspath
manually seems to resolve the problem:

IBM VM (with luni-kernel-stubs.jar appended to bootclasspath):

Uncaught exception in main:
java.lang.NoSuchMethodError: main
(seems like the correct behavior, though the jar name makes me think
this solution is not really proper)

Vasily Zakharov
Intel ESSD

Mime
View raw message