In our JVM (see Comments section) we do some extra validity testing in our
debug version and assert when running:
-Xverify -Xmx128m -Xgc:gencon -cp c:\testing\jck\JCK-runtime-14a\classes
-Djava.security.policy=c:\testing\jck\JCK-runtime-14a\lib\jck.policy
javasoft.sqe.tests.api.java.awt.java2d.font.LineBreakMeasurer.ConstructorTest
-TestCaseID testCase4
Java stack-trace:
at java.text.Bidi.nativeBidiChars(Native Method)
at java.text.Bidi.<init>(Bidi.java:189)@0BB0CB6B
at java.awt.font.TextMeasurer.initAll(TextMeasurer.java:190)
at java.awt.font.TextMeasurer.<init>(TextMeasurer.java:149)
at java.awt.font.LineBreakMeasurer.<init>(LineBreakMeasurer.java:292)
at javasoft.sqe.tests.api.java.awt.java2d.font.LineBreakMeasurer.Constructor
Test.testCase4(ConstructorTest.java:237)
The problem is in nativeBidiChars (in jbidi.c) it does:
jchar *cText = (jchar*)(*env)->GetPrimitiveArrayCritical(env, text, NULL);
..
..
.. resetBidi(); <-----
..
(*env)->ReleasePrimitiveArrayCritical(env, text, cText, JNI_ABORT);
The problem is in resetBidi which does
g_bidi_class = (*env)->NewGlobalRef(env, cls);
while holding the PrimitiveArrayCriticial(cText)
The JNI specification clearly dictates that no other JNI-calls may be
made between GetPrimitive and ReleasePrimitive.
debug version and assert when running:
-Xverify -Xmx128m -Xgc:gencon -cp c:\testing\jck\JCK-runtime-14a\classes
-Djava.security.policy=c:\testing\jck\JCK-runtime-14a\lib\jck.policy
javasoft.sqe.tests.api.java.awt.java2d.font.LineBreakMeasurer.ConstructorTest
-TestCaseID testCase4
Java stack-trace:
at java.text.Bidi.nativeBidiChars(Native Method)
at java.text.Bidi.<init>(Bidi.java:189)@0BB0CB6B
at java.awt.font.TextMeasurer.initAll(TextMeasurer.java:190)
at java.awt.font.TextMeasurer.<init>(TextMeasurer.java:149)
at java.awt.font.LineBreakMeasurer.<init>(LineBreakMeasurer.java:292)
at javasoft.sqe.tests.api.java.awt.java2d.font.LineBreakMeasurer.Constructor
Test.testCase4(ConstructorTest.java:237)
The problem is in nativeBidiChars (in jbidi.c) it does:
jchar *cText = (jchar*)(*env)->GetPrimitiveArrayCritical(env, text, NULL);
..
..
.. resetBidi(); <-----
..
(*env)->ReleasePrimitiveArrayCritical(env, text, cText, JNI_ABORT);
The problem is in resetBidi which does
g_bidi_class = (*env)->NewGlobalRef(env, cls);
while holding the PrimitiveArrayCriticial(cText)
The JNI specification clearly dictates that no other JNI-calls may be
made between GetPrimitive and ReleasePrimitive.
- duplicates
-
JDK-4757223 some JNI-warning reported by -Xcheck:jni option (2D)
- Resolved