Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4782534

JNI problem in jbidi.c:nativeBidiChars()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • core-libs
    • generic
    • generic

      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.

            Unassigned Unassigned
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: