JDK-8179220 : Crash when using touch bar with open dialog
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u131
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2017-04-24
  • Updated: 2017-05-10
  • Resolved: 2017-04-24
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

EXTRA RELEVANT SYSTEM CONFIGURATION :
MacBook Pro 15" Late 2016 with TouchBar

A DESCRIPTION OF THE PROBLEM :
Whenever a modal dialog is opened in a JavaFX application and the user touches the TouchBar, the application crashes, with the following exception:

2017-04-24 11:16:10.942 java[30383:25930340] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.82.104/AppKit.subproj/NSTouch.m:87
2017-04-24 11:16:10.947 java[30383:25930340] Apple AWT Internal Exception: Cannot get normalizedPosition for this type of NSTouch
2017-04-24 11:16:10.948 java[30383:25930340] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot get normalizedPosition for this type of NSTouch'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff950a937b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fffa9e9d48d objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff950ae082 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fff96af5ce0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
	4   AppKit                              0x00007fff92e67ff1 -[NSTouch normalizedPosition] + 155
	5   libglass.dylib                      0x000000012385d1f7 -[GlassTouches(hidden) sendJavaTouchEvent:] + 2023
	6   libglass.dylib                      0x000000012385c95c listenTouchEvents + 92
	7   SkyLight                            0x00007fffa6c55312 processDecodedEventRef + 204
	8   SkyLight                            0x00007fffa6c54afc processEventTapData + 544
	9   SkyLight                            0x00007fffa6b7d083 _XPostEventTapData + 280
	10  SkyLight                            0x00007fffa6c54886 eventTapMessageHandler + 137
	11  CoreFoundation                      0x00007fff9502829d __CFMachPortPerform + 253
	12  CoreFoundation                      0x00007fff95028189 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	13  CoreFoundation                      0x00007fff95028101 __CFRunLoopDoSource1 + 465
	14  CoreFoundation                      0x00007fff9501fd75 __CFRunLoopRun + 2389
	15  CoreFoundation                      0x00007fff9501f1c4 CFRunLoopRunSpecific + 420
	16  Foundation                          0x00007fff96a31572 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
	17  libglass.dylib                      0x000000012384a6d8 +[GlassApplication enterNestedEventLoopWithEnv:] + 136
	18  libglass.dylib                      0x000000012384b13a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
	19  ???                                 0x0000000106d019f4 0x0 + 4409268724
	20  ???                                 0x0000000106cf2040 0x0 + 4409204800
)
libc++abi.dylib: terminating with uncaught exception of type NSException



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start the attached sample

java FileChooserSample

2. click on "open picture"
3. when the file chooser dialog is open touch the touchbar anywhere

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Unless you hit one of the 2 options in the touch bar, nothing should happen
ACTUAL -
The application crashes with the following stack trace (100% reproducability)

2017-04-24 11:16:10.942 java[30383:25930340] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.82.104/AppKit.subproj/NSTouch.m:87
2017-04-24 11:16:10.947 java[30383:25930340] Apple AWT Internal Exception: Cannot get normalizedPosition for this type of NSTouch
2017-04-24 11:16:10.948 java[30383:25930340] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot get normalizedPosition for this type of NSTouch'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff950a937b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fffa9e9d48d objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff950ae082 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fff96af5ce0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
	4   AppKit                              0x00007fff92e67ff1 -[NSTouch normalizedPosition] + 155
	5   libglass.dylib                      0x000000012385d1f7 -[GlassTouches(hidden) sendJavaTouchEvent:] + 2023
	6   libglass.dylib                      0x000000012385c95c listenTouchEvents + 92
	7   SkyLight                            0x00007fffa6c55312 processDecodedEventRef + 204
	8   SkyLight                            0x00007fffa6c54afc processEventTapData + 544
	9   SkyLight                            0x00007fffa6b7d083 _XPostEventTapData + 280
	10  SkyLight                            0x00007fffa6c54886 eventTapMessageHandler + 137
	11  CoreFoundation                      0x00007fff9502829d __CFMachPortPerform + 253
	12  CoreFoundation                      0x00007fff95028189 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	13  CoreFoundation                      0x00007fff95028101 __CFRunLoopDoSource1 + 465
	14  CoreFoundation                      0x00007fff9501fd75 __CFRunLoopRun + 2389
	15  CoreFoundation                      0x00007fff9501f1c4 CFRunLoopRunSpecific + 420
	16  Foundation                          0x00007fff96a31572 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
	17  libglass.dylib                      0x000000012384a6d8 +[GlassApplication enterNestedEventLoopWithEnv:] + 136
	18  libglass.dylib                      0x000000012384b13a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
	19  ???                                 0x0000000106d019f4 0x0 + 4409268724
	20  ???                                 0x0000000106cf2040 0x0 + 4409204800
)
libc++abi.dylib: terminating with uncaught exception of type NSException

ERROR MESSAGES/STACK TRACES THAT OCCUR :
2017-04-24 11:16:10.942 java[30383:25930340] *** Assertion failure in -[NSTouch normalizedPosition], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.82.104/AppKit.subproj/NSTouch.m:87
2017-04-24 11:16:10.947 java[30383:25930340] Apple AWT Internal Exception: Cannot get normalizedPosition for this type of NSTouch
2017-04-24 11:16:10.948 java[30383:25930340] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot get normalizedPosition for this type of NSTouch'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff950a937b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fffa9e9d48d objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff950ae082 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fff96af5ce0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
	4   AppKit                              0x00007fff92e67ff1 -[NSTouch normalizedPosition] + 155
	5   libglass.dylib                      0x000000012385d1f7 -[GlassTouches(hidden) sendJavaTouchEvent:] + 2023
	6   libglass.dylib                      0x000000012385c95c listenTouchEvents + 92
	7   SkyLight                            0x00007fffa6c55312 processDecodedEventRef + 204
	8   SkyLight                            0x00007fffa6c54afc processEventTapData + 544
	9   SkyLight                            0x00007fffa6b7d083 _XPostEventTapData + 280
	10  SkyLight                            0x00007fffa6c54886 eventTapMessageHandler + 137
	11  CoreFoundation                      0x00007fff9502829d __CFMachPortPerform + 253
	12  CoreFoundation                      0x00007fff95028189 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	13  CoreFoundation                      0x00007fff95028101 __CFRunLoopDoSource1 + 465
	14  CoreFoundation                      0x00007fff9501fd75 __CFRunLoopRun + 2389
	15  CoreFoundation                      0x00007fff9501f1c4 CFRunLoopRunSpecific + 420
	16  Foundation                          0x00007fff96a31572 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
	17  libglass.dylib                      0x000000012384a6d8 +[GlassApplication enterNestedEventLoopWithEnv:] + 136
	18  libglass.dylib                      0x000000012384b13a Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74
	19  ???                                 0x0000000106d019f4 0x0 + 4409268724
	20  ???                                 0x0000000106cf2040 0x0 + 4409204800
)
libc++abi.dylib: terminating with uncaught exception of type NSException

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
 
public final class FileChooserSample extends Application {
 
    private Desktop desktop = Desktop.getDesktop();
 
    @Override
    public void start(final Stage stage) {
        stage.setTitle("File Chooser Sample");
 
        final FileChooser fileChooser = new FileChooser();
 
        final Button openButton = new Button("Open a Picture...");
        final Button openMultipleButton = new Button("Open Pictures...");
 
        openButton.setOnAction(
            new EventHandler<ActionEvent>() {
                @Override
                public void handle(final ActionEvent e) {
                    File file = fileChooser.showOpenDialog(stage);
                    if (file != null) {
                        openFile(file);
                    }
                }
            });
 
        openMultipleButton.setOnAction(
            new EventHandler<ActionEvent>() {
                @Override
                public void handle(final ActionEvent e) {
                    List<File> list =
                        fileChooser.showOpenMultipleDialog(stage);
                    if (list != null) {
                        for (File file : list) {
                            openFile(file);
                        }
                    }
                }
            });
 
 
        final GridPane inputGridPane = new GridPane();
 
        GridPane.setConstraints(openButton, 0, 0);
        GridPane.setConstraints(openMultipleButton, 1, 0);
        inputGridPane.setHgap(6);
        inputGridPane.setVgap(6);
        inputGridPane.getChildren().addAll(openButton, openMultipleButton);
 
        final Pane rootGroup = new VBox(12);
        rootGroup.getChildren().addAll(inputGridPane);
        rootGroup.setPadding(new Insets(12, 12, 12, 12));
 
        stage.setScene(new Scene(rootGroup));
        stage.show();
    }
 
    public static void main(String[] args) {
        Application.launch(args);
    }
 
    private void openFile(File file) {
        try {
            desktop.open(file);
        } catch (IOException ex) {
            Logger.getLogger(
                FileChooserSample.class.getName()).log(
                    Level.SEVERE, null, ex
                );
        }
    }
}

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

CUSTOMER SUBMITTED WORKAROUND :
NONE, if you have a touchbar.


Comments
Closing as duplicate of JDK-8172847.
24-04-2017