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

[macos] Swing InterOp Platform.exit() crash

XMLWordPrintable

    • b14
    • os_x

      It is possible to crash Swing by calling Platform.Exit()

      import javafx.application.Application;
      import javafx.application.Platform;
      import javafx.stage.Stage;

      import javax.swing.*;

      public class PlatformExitCrash extends Application {

          public static void main(String[] args) {
              SwingUtilities.invokeLater(PlatformExitCrash::createSwing);
              Application.launch(args);
          }

          private static void createSwing() {
              JDialog d = new JDialog();
              Platform.runLater(()-> {
                  Platform.exit();
              });
              try {
                  Thread.sleep(3000);
              } catch (InterruptedException e) {
              }
              d.setVisible(true);
          }

          @Override
          public void start(Stage st) {
          }
      }

        1. hs_err_pid13979.log
          40 kB
        2. hs_err_pid14011.log
          40 kB
        3. hs_err_pid14033.log
          40 kB
        4. PlatformExitCrash.java
          0.7 kB
        5. PlatformExitCrash2.java
          0.8 kB

            psadhukhan Prasanta Sadhukhan
            azvegint Alexander Zvegintsev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: