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

Component.printAll Invalid local JNI handle

XMLWordPrintable

    • b64
    • x86
    • windows_xp
    • Verified

      FULL PRODUCT VERSION :
      java version "1.6.0_07"
      Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
      Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Running java with -Xcheck:jni

      A DESCRIPTION OF THE PROBLEM :
      Component.printAll causes the JVM to abort when Xcheck:jni is enabled. The reported cause is due to an Invalid local JNI handle passed to DeleteLocalRef.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Call printAll on a JFrame with XCheck:jni enabled.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No error.
      ACTUAL -
      FATAL ERROR in native method: Invalid local JNI handle passed to DeleteLocalRef
      at sun.awt.windows.WComponentPeer.createPrintedPixels


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      FATAL ERROR in native method: Invalid local JNI handle passed to DeleteLocalRef
      at sun.awt.windows.WComponentPeer.createPrintedPixels(Native Method)
      at sun.awt.windows.WComponentPeer.print(Unknown Source)
      at sun.awt.windows.WCanvasPeer.print(Unknown Source)
      at sun.awt.windows.WPanelPeer.print(Unknown Source)
      at sun.awt.windows.WWindowPeer.print(Unknown Source)
      at java.awt.GraphicsCallback$PeerPrintCallback.run(Unknown Source)
      at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
      at java.awt.Component.printAll(Unknown Source)
      at XCheckPrint.run(XCheckPrint.java:17)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.image.BufferedImage;
      import java.awt.*;

      public class XCheckPrint implements Runnable {
        public XCheckPrint() {
        }

        public void run() {
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
          BufferedImage img = new BufferedImage(frame.getWidth(),
                                                frame.getHeight(),
                                                BufferedImage.TYPE_INT_RGB);
          Graphics2D g = img.createGraphics();
          frame.printAll(g);
          g.dispose();
          img.flush();
        }

        public static void main(String[] args) {
          SwingUtilities.invokeLater(new XCheckPrint());
        }
      }
      ---------- END SOURCE ----------

            dcherepanov Dmitry Cherepanov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: