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

[macOS] Crash on focus loss from dialog on macOS 10.14 Mojave

    XMLWordPrintable

Details

    Backports

      Description

        ADDITIONAL SYSTEM INFORMATION :
        macOS 10.14 Mojave
        Java 8u181


        A DESCRIPTION OF THE PROBLEM :
        If a JavaFX application is showing a dialog and switch to another application is crashes.

        Reproduced on multiple machines. Updating to 10.14.1 Beta did not resolve the issue.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run the attached program, click the "Say 'Hello World'" button to show the in for dialog. Now switch focus to another application (I'm using Safari for this), the back to the Java app and it will have vanished.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        It to be there.
        ACTUAL -
        Crash, with the following:

        2018-09-26 13:19:26.950 java[1389:16558] unrecognized type is 4294967295
        2018-09-26 13:19:26.950 java[1389:16558] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671/AppKit.subproj/NSEvent.m:1969
        2018-09-26 13:19:26.951 java[1389:16558] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: _type > 0 && _type <= kCGSLastEventType'
        *** First throw call stack:
        (
        0 CoreFoundation 0x00007fff4593b43d __exceptionPreprocess + 256
        1 libobjc.A.dylib 0x00007fff71848720 objc_exception_throw + 48
        2 CoreFoundation 0x00007fff4595608e +[NSException raise:format:arguments:] + 98
        3 Foundation 0x00007fff47cf255d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
        4 AppKit 0x00007fff42de1acd -[NSEvent _initWithCGEvent:eventRef:] + 3272
        5 AppKit 0x00007fff43135188 +[NSEvent eventWithCGEvent:] + 120
        6 libglass.dylib 0x000000010c9af17b listenTouchEvents + 59
        7 SkyLight 0x00007fff6b906782 _ZL19processEventTapDataPvjjjPhj + 148
        8 SkyLight 0x00007fff6b805bb2 _XPostEventTapData + 278
        9 SkyLight 0x00007fff6b906690 _ZL22eventTapMessageHandlerP12__CFMachPortPvlS1_ + 132
        10 CoreFoundation 0x00007fff45899a5b __CFMachPortPerform + 246
        11 CoreFoundation 0x00007fff45899959 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
        12 CoreFoundation 0x00007fff458998b7 __CFRunLoopDoSource1 + 527
        13 CoreFoundation 0x00007fff45881945 __CFRunLoopRun + 2574
        14 CoreFoundation 0x00007fff45880ce4 CFRunLoopRunSpecific + 463
        15 Foundation 0x00007fff47be15da -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280
        16 libglass.dylib 0x000000010c99cad5 +[GlassApplication enterNestedEventLoopWithEnv:] + 165
        17 libglass.dylib 0x000000010c99d51a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
        18 ??? 0x000000010e01d667 0x0 + 4529968743
        )
        libc++abi.dylib: terminating with uncaught exception of type NSException


        ---------- BEGIN SOURCE ----------
        package helloworld;
         
        import javafx.application.Application;
        import javafx.event.ActionEvent;
        import javafx.event.EventHandler;
        import javafx.scene.Scene;
        import javafx.scene.control.Alert;
        import javafx.scene.control.Alert.AlertType;
        import javafx.scene.control.Button;
        import javafx.scene.layout.StackPane;
        import javafx.stage.Stage;
         
        public class HelloWorld extends Application {
            public static void main(String[] args) {
                launch(args);
            }
            
            @Override
            public void start(Stage primaryStage) {
                primaryStage.setTitle("Hello World!");
                Button btn = new Button();
                btn.setText("Say 'Hello World'");
                btn.setOnAction(new EventHandler<ActionEvent>()
                {
         
                    @Override
                    public void handle(ActionEvent event)
                    {
                        Alert alert = new Alert(AlertType.INFORMATION);
                        alert.setTitle("Hellow World!");
                        alert.setHeaderText("Hellow World!");
                        alert.setContentText("Hellow World!");
                       alert.showAndWait();
                    }
                });
                
                final StackPane root = new StackPane();
                root.getChildren().add(btn);
                primaryStage.setScene(new Scene(root, 300, 250));
                primaryStage.show();
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Close dialogs before giving focus to another application.

        FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

                kcr Kevin Rushforth
                webbuggrp Webbug Group
                Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: