native method registerTargetForFlavor uses a bad JNI fieldID

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.2.0
    • Component/s: client-libs
    • None
    • sparc
    • solaris_2.5.1

      The following problem was discovered by running JCK under hotspot on Solaris.
      Test "JCK-runtime-api-12a/api/javax_swing/text/DefaultEditorKit/index_SubCtors"
      fails when trying to test the effect of a CutAction, call the native method
      "Java_sun_awt_motif_X11Selection_registerTargetForFlavor", and triggers an
      assert (or a core dump, if VM asserts are disabled).

      The following line of code in awt_Selection.c is at fault:
          (*env)->SetIntField(env, flavor, x11SelectionIDs.atom, (jint) target);

      The problem is that "flavor" is not of class X11Selection. It is a method
      argument, not the method invocation target "this", and it is of class
      DataFlavor. Although it does have a field named "atom", it is not the
      same field as in X11Selection, and in fact is at a different offset.

      This bug appears to be an erroneous fix to a larger bug, number 4107322.
      This bug may be fixed by correctly applying the techniques described in
      the bugtraq entry for 4107322.

            Assignee:
            Unassigned
            Reporter:
            John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: