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

Multi-threaded access to a BufferedImage can cause a JNI error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic

      The attached test case is a simple double buffering application which
      has one thread drawing lines into an image and issuing delayed repaints.

      When the repaint handler calls the update() method, the simultaneous
      access to the image from both the rendering thread and the thread copying
      the image to the window causes a JNI fault in the rendering code. The
      JNI fault is unrecoverable and causes the application to crash.

      The problem appears to be that the code to allow native access to a
      BufferedImage data array is trying to share the JNI array accesses between
      threads such that when the thread that locked the array for native access
      returns from its native method it may not be able to unlock the array since
      another thread may be also using that locked pointer.

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: