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

[macos] If you hit the escape key repeatedly to close the subwindow, the process crashes

    XMLWordPrintable

    Details

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_111"
        java version "1.8.0_112"


        ADDITIONAL OS VERSION INFORMATION :
        macOS Sierra 10.12.2

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Mac Book Pro with TouchBar

        A DESCRIPTION OF THE PROBLEM :
        If you hit the escape key repeatedly to close the subwindow, the process crashes.

        This problem can be avoided in the case of Dialog, but it is very serious as it can not be avoided with FileChooser and DirectoryChooser.
        (As a matter of course, it can not be said not to use the Scope Key for the user)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1) Execute the test program
        2) Press the button of the crash case
        3) Press the escape key repeatedly to close the window
        4) If the process does not crash, repeat steps 2 to 3

        * Probably to reproduce this problem I think we need a 2016 latter model with TouchBar.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Process crashes
        ACTUAL -
        Process does not crash

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        2017-01-10 00:40:08.168 java[3261:451661] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.76/AppKit.subproj/NSTouch.m:87
        2017-01-10 00:40:08.195 java[3261:451661] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.76/AppKit.subproj/NSTouch.m:87
        2017-01-10 00:40:09.636 java[3261:451661] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.76/AppKit.subproj/NSTouch.m:87
        2017-01-10 00:40:09.637 java[3261:451661] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot get normalizedPosition for this type of NSTouch'
        *** First throw call stack:
        (
        0 CoreFoundation 0x00007fffb596ce7b __exceptionPreprocess + 171
        1 libobjc.A.dylib 0x00007fffca557cad objc_exception_throw + 48
        2 CoreFoundation 0x00007fffb5971b82 +[NSException raise:format:arguments:] + 98
        3 Foundation 0x00007fffb73bbd50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
        4 AppKit 0x00007fffb3760975 -[NSTouch normalizedPosition] + 155
        5 libglass.dylib 0x0000000128864227 -[GlassTouches(hidden) sendJavaTouchEvent:] + 2023
        6 libglass.dylib 0x000000012886398c listenTouchEvents + 92
        7 SkyLight 0x00007fffc7347e80 processDecodedEventRef + 204
        8 SkyLight 0x00007fffc734766a processEventTapData + 544
        9 SkyLight 0x00007fffc71f2cb0 _XPostEventTapData + 280
        10 SkyLight 0x00007fffc73473f4 eventTapMessageHandler + 137
        11 CoreFoundation 0x00007fffb58eb803 __CFMachPortPerform + 291
        12 CoreFoundation 0x00007fffb58eb6c9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
        13 CoreFoundation 0x00007fffb58eb641 __CFRunLoopDoSource1 + 465
        14 CoreFoundation 0x00007fffb58e3525 __CFRunLoopRun + 2389
        15 CoreFoundation 0x00007fffb58e2974 CFRunLoopRunSpecific + 420
        16 HIToolbox 0x00007fffb4e6eacc RunCurrentEventLoopInMode + 240
        17 HIToolbox 0x00007fffb4e6e809 ReceiveNextEventCommon + 184
        18 HIToolbox 0x00007fffb4e6e736 _BlockUntilNextEventMatchingListInModeWithFilter + 71
        19 AppKit 0x00007fffb3414ae4 _DPSNextEvent + 1120
        20 AppKit 0x00007fffb3b8f21f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
        21 libglass.dylib 0x000000012885172c +[GlassApplication enterNestedEventLoopWithEnv:] + 172
        22 libglass.dylib 0x000000012885216a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
        23 ??? 0x0000000110b219f4 0x0 + 4575074804
        24 ??? 0x0000000110b12040 0x0 + 4575010880
        )
        libc++abi.dylib: terminating with uncaught exception of type NSException


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javafx.application.Application;
        import javafx.scene.Scene;
        import javafx.scene.control.Button;
        import javafx.scene.control.ButtonType;
        import javafx.scene.control.Dialog;
        import javafx.scene.control.Label;
        import javafx.scene.layout.VBox;
        import javafx.stage.DirectoryChooser;
        import javafx.stage.FileChooser;
        import javafx.stage.Stage;

        public class WindowCrashTest extends Application{

        @Override
        public void start(Stage primaryStage) throws Exception {

        Button fileChooserButton1 = new Button("FileChooser.showOpenDialog()");
        Button fileChooserButton2 = new Button("FileChooser.showOpenMultipleDialog()");
        Button fileChooserButton3 = new Button("FileChooser.showSaveDialog()");
        Button directroyChooserButton = new Button("DirectoryChooser.showDialog()");
        Button dialogButton1 = new Button("Dialog.showAndWait()");
        Button dialogButton2 = new Button("Dialog.show()");

        fileChooserButton1.setOnAction((e)->{
        FileChooser chooser = new FileChooser();
        chooser.showOpenDialog(primaryStage);
        });
        fileChooserButton2.setOnAction((e)->{
        FileChooser chooser = new FileChooser();
        chooser.showOpenMultipleDialog(primaryStage);
        });
        fileChooserButton3.setOnAction((e)->{
        FileChooser chooser = new FileChooser();
        chooser.showSaveDialog(primaryStage);
        });
        directroyChooserButton.setOnAction((e)->{
        DirectoryChooser chooser = new DirectoryChooser();
        chooser.showDialog(primaryStage);
        });
        dialogButton1.setOnAction((e)->{
        Dialog<ButtonType> dialog = new Dialog<>();
        dialog.initOwner(primaryStage);
        dialog.getDialogPane().getButtonTypes().addAll(ButtonType.CANCEL);
        dialog.showAndWait();
        });
        dialogButton2.setOnAction((e)->{
        Dialog<ButtonType> dialog = new Dialog<>();
        dialog.initOwner(primaryStage);
        dialog.getDialogPane().getButtonTypes().addAll(ButtonType.CANCEL);
        dialog.show();
        });
        VBox root = new VBox(
        new Label("Crash case"),
        fileChooserButton1,
        fileChooserButton2,
        fileChooserButton3,
        directroyChooserButton,
        dialogButton1,
        new Label("Not Crash case"),
        dialogButton2
        );


        Scene scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.show();

        }

        public static void main(String[] args) {
        Application.launch(args);
        }


        }

        ---------- END SOURCE ----------

          Attachments

          1. screenshot-1.png
            217 kB
            Abhijit Roy
          2. WindowCrashTest.java
            2 kB
            Kevin Rushforth

            Issue Links

              Activity

                People

                • Assignee:
                  azvegint Alexander Zvegintsev (Inactive)
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: