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

Win: Crash outside the JVM when drag and dropping files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7u15
    • javafx

      This was originally filed as JDK bug 8016536.

      The following bug description is copied from http://bugs.sun.com/view_bug.do?bug_id=8016536

      -----------------------------

      FULL PRODUCT VERSION :
      java version " 1.7.0_17 "
      Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
      Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

      FULL OS VERSION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      JavaFX Drag and Drop causes crash outside the Java Virtual Machine.
      When i drag a file into the Windowsexplorer the file is created/moved correctly.
      But after the event is complete the JVM causes a fatalerror, which causes the programm to shut down.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the code below.

      Drag the Lable somewhere in the windowsexplorer => crash
      This does not happen if you change the drag and drop to text.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      File is dropped correctly and no crash happens
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NullPointerException
      at com.sun.javafx.tk.quantum.QuantumToolkit$14.actionPerformed(QuantumToolkit.java:1154)
      at com.sun.glass.ui.Clipboard.actionPerformed(Clipboard.java:139)
      at com.sun.glass.ui.win.WinDnDClipboard.push(Native Method)
      at com.sun.glass.ui.win.WinSystemClipboard.pushToSystem(WinSystemClipboard.java:213)
      at com.sun.glass.ui.SystemClipboard.flush(SystemClipboard.java:28)
      at com.sun.glass.ui.ClipboardAssistance.flush(ClipboardAssistance.java:34)
      at com.sun.javafx.tk.quantum.QuantumClipboard.flush(QuantumClipboard.java:197)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startDrag(QuantumToolkit.java:1195)
      at javafx.scene.Scene$DnDGesture.dragDetectedProcessed(Scene.java:2652)
      at javafx.scene.Scene$DnDGesture.process(Scene.java:2713)
      at javafx.scene.Scene$DnDGesture.access$8700(Scene.java:2607)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3344)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3168)
      at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3123)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2265)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
      at java.security.AccessController.doPrivileged(Native Method)#
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x74efc41f, pid=6592, tid=6596
      #
      # JRE version: 7.0_17-b02
      # Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode, sharing windows-x86 )
      # Problematic frame:
      # C [KERNELBASE.dll+0xc41f]
          at

      com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
      at com.sun.glass.ui.View.handleMouseEvent(View.java:528)
      at com.sun.glass.ui.View.notifyMouse(View.java:922)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
      at java.lang.Thread.run(Thread.java:722)
      Exception in thread " JavaFX Application Thread " Error: 80de0001 in checkJavaException(env) RaiseException+0x58
      #
      # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
      #
      # An error report file with more information is saved as:
      # C:\Users\Apfelmaennchen\workspace\asd\hs_err_pid6592.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      # The crash happened outside the Java Virtual Machine in native code.
      # See problematic frame for where to report the bug.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Main extends Application {

          @Override
          public void start(Stage primaryStage) {
              primaryStage.setTitle( " Test App " );
              Group rootGroup = new Group();
              Scene scene = new Scene(rootGroup);
              Text text = new Text(100,100, " Drag For new file " );
              rootGroup.getChildren().add(text);
              setupGestureSource(text);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          void setupGestureSource(final Text source) {
              source.setOnDragDetected(new EventHandler<MouseEvent>() {
                  @Override
                  public void handle(MouseEvent event) {
                      List<File> list= new ArrayList<File>();
                      Dragboard db = source.startDragAndDrop(TransferMode.ANY);
                      File tmpFile = new File( " test.txt " );
                      try {
                          tmpFile.createNewFile();
                      } catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      }
                      list.add(tmpFile);
                      ClipboardContent content = new ClipboardContent();
                      content.putFiles(list);
                      db.setContent(content);
                      event.consume();
                  }
              });
          }

          public static void main(String[] args) {
              launch(args);
          }
      }
      ---------- END SOURCE ----------

            anthony Anthony Petrov (Inactive)
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: