icedtea-1.14 JamVM + OpenJDK 7 -version patch

Robert Lougher rob.lougher at gmail.com
Fri May 27 05:56:36 PDT 2011


Hi,

On 27 May 2011 11:48, Xerxes RĂ„nby <xerxes at zafena.se> wrote:
>
>> What I currently observe are a
>> unsatisfied link error.
>>
>> xranby at xranby-ESPRIMO-P7935:~/test
>> $ ../icedtea-1.14/openjdk.build/j2sdk-image/bin/java Linpack
>> java.lang.UnsatisfiedLinkError: registerNatives
>>       at sun.misc.Perf.registerNatives(Native Method)
>>       at sun.misc.Perf.<clinit>(Perf.java:536)
> ...
>>       at sun.misc.PerfCounter.<clinit>(PerfCounter.java:51)
>>       at java.net.URLClassLoader.defineClass(URLClassLoader.java:448)
>>
>> The URLClassLoader uses sun.misc.Perf to register startup time.
>>
>> I start to think this are a bug in OpenJDK 7 that the sun.misc.Perf
>> constructor expects to be able to use the native registerNatives method
>> in libhprof.so without explicilty making sure that this library have
>> already been loaded.
>>
>> The libhprof.so are part of the Hotspot JVMTI implementation so it are
>> no surprise that JamVM currently dont not load it.
>>
>> Rob can you tell if registerNative are supposed to be part of the public
>> JNI interface between OpenJDK7 classes and the JVM?
>

No.  It's an idiom used within OpenJDK to bind the C functions that
implement the native part of the class to the native methods.  Some
classes use it to bind a JVM_xxx interface function directly to a
native method.  It's also used for sun.misc.Unsafe support.

The important question is where are the native methods...  In the case
of most of the classes, they're in libjava.so, which the VM must load
itself.  Sun.misc.Unsafe support was implemented directly in JamVM.
>From the looks of it, these functions are in a JNI library, which
should be preloaded.  But without looking into it, I can't tell when
and how the VM is expected to load it.  It doesn't, however, look to
be a difficult problem.

Rob.

>
> For clarification,the native method in libhprof.so void
> registerNative(void) called by the sun.misc.Perf constructor are not the
> same "RegisterNatives" as the JNI interface RegisterNatives
> http://download.oracle.com/javase/6/docs/technotes/guides/jni/spec/functions.html#wp17734
>
>
> Xerxes
>
>



More information about the distro-pkg-dev mailing list