[OpenJDK 2D-Dev] Why does the OpenGL pipeline not use setupBlitVector?

Clemens Eisserer linuxhippy at gmail.com
Tue Jun 3 10:31:46 UTC 2008


Hi Dmitri,

>  Did you try to run it with -Xcheck:jni (preferably on a fastdebug
>  build)? What does it say?
Thanks for the hint, it cleans the array-handle is not valid.

I added printf-statements and Hotspot is of course right, the
"original" object handle was != NULL, but the one I passed is zero.
The strange thing is if I call a method in the same shared library
(fontmanager.so) the handle is passed correctly, but when calling into
libmawt.so the array-handle is NULL.
I pass the array-handles by value, is this ok?

For now I could work-arround that by simply calling
GetPrimitiveArrayCritical in the first method, however thats somehow
strange and I would like to understand where my mistake is to learn of
my faults ;)

Thanks a lot for your patience, Clemens

One thing that also puzzles me is how the compiler knows about
AWTXRDrawGlyphList?
There's no header-file which specifies it, does the compiler guess?
This is the how the code looks like:

1.) In libmawt.so the method which is called and crashes:
void AWTXRDrawGlyphList
    (JNIEnv *env, jobject self,
     jlong dstData, jint numGlyphs, jboolean usePositions,
                    jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
                    jfloat glyphListOrigX, jfloat glyphListOrigY,
                    jlongArray imgArray, jfloatArray posArray)
{
    images = (jlong *) (*env)->GetPrimitiveArrayCritical(env, imgArray, NULL);
}

2.)The method called from JNI in libfontmanager.so and a test-dummy method:
JNIEXPORT void JNICALL Java_sun_font_X11TextRenderer_doDrawGlyphList
  //Method called from JNI
    (JNIEnv *env, jobject xtr,
     jlong dstData, jint totalGlyphs, jboolean usePositions,
                    jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
                    jfloat glyphListOrigX, jfloat glyphListOrigY,
                    jlongArray images, jfloatArray positions)
{
  TESTDrawGlyphList(env, xtr, dstData, totalGlyphs, usePositions,
 //Does not crash
                     subPixPos, rgbOrder, lcdContrast, glyphListOrigX,
                     glyphListOrigY, images, positions);

  AWTXRDrawGlyphList(env, xtr, dstData, totalGlyphs, usePositions,
//Does crash, because images == NULL
                     subPixPos, rgbOrder, lcdContrast, glyphListOrigX,
                     glyphListOrigY, images, positions);
}

JNIEXPORT void TESTDrawGlyphList //DummyTestMethod
    (JNIEnv *env, jobject self,
     jlong dstData, jint numGlyphs, jboolean usePositions,
                    jboolean subPixPos, jboolean rgbOrder, jint lcdContrast,
                    jfloat glyphListOrigX, jfloat glyphListOrigY,
                    jlongArray imgArray, jfloatArray posArray)
{
    jlong *images;
    images = (jlong *) (*env)->GetPrimitiveArrayCritical(env, imgArray, NULL);
}

These are the outputs when I run the code with Xcheck:jni:
Pointer: -1388390664 <- Value of imgArray-handle before passed to the
2nd method in libmawt.so
Pointer: 0 <- Passed value
FATAL ERROR in native method: Non-array passed to JNI array operations

and this is without XCheck:jni:
V  [libjvm.so+0x24252b]
C  [libmawt.so+0x1fc81]  AWTXRDrawGlyphList+0xa1
C  [libfontmanager.so+0xb393]
Java_sun_font_X11TextRenderer_doDrawGlyphList+0x113
j  sun.font.X11TextRenderer.doDrawGlyphList(JIZZZIFF[J[F)V+0

So the first call succeed (which basically does exectly the same, its
just in another shared library), but the second time the parameter is
not passed :-/



More information about the 2d-dev mailing list