RFC: Shark calling static jni method jclass argument fix

Xerxes Ranby xerxes at zafena.se
Wed Apr 21 16:23:10 PDT 2010


When Shark jits code that calls static jni methods then the jvm bombs if 
the static jni code tries to use the passed jclass argument.

testcase: (tested to be fully reproduceable on ARM and AMD_64)
cd openjdk/jdk/test/java/awt/geom/Path2D
javac FillPPathTest.java
java -Xcomp -XX:CompileOnly=java.awt.image.BufferedImage::initIDs 
-XX:+SharkTraceInstalls FillPPathTest

output:
 [0x680c4010-0x680c412c): java.awt.image.BufferedImage::initIDs (284 
bytes code)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_linux_zero.cpp:236), pid=10552, tid=1090999440
#  Error: caught unhandled signal 11
#
...

backtrace:
#0  0xe592300c in ?? ()
#1  0x40362760 in jni_GetFieldID (env=<value optimized out>, 
clazz=<value optimized out>,
    name=0x684484b4 "raster", sig=<value optimized out>)
    at 
/media/disk/icedtea6-shark/openjdk/hotspot/src/share/vm/prims/jni.cpp:1634
#2  0x683dcbfc in Java_java_awt_image_BufferedImage_initIDs 
(env=0x40568620, cls=0x2c888)
    at ../../../src/share/native/sun/awt/image/imageInitIDs.c:32
#3  0x680c409c in ?? ()

The attached patch fix!
The fix are inspired from how the cppInterpreter_zero.cpp created the 
passed jclass argument.

ok to commit?

Cheers and have a great day!
Xerxes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 22apr-shark-static-jni-cls.patch
Type: text/x-patch
Size: 674 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20100422/792021b2/22apr-shark-static-jni-cls.patch 


More information about the distro-pkg-dev mailing list