JDK-8276991 : [macos12] JVM crashes with problematic frame StubRoutines::SafeFetchN when using javafx.scene.web.WebView
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: openjfx17
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2021-11-08
  • Updated: 2021-11-15
  • Resolved: 2021-11-11
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
- MacBook Pro 14 2021 having an M1Pro processor
- macOS Monterey 12.0.1 
- openjdk version "17.0.1"
- JavaFX 17.0.1 macOS/aarch64

A DESCRIPTION OF THE PROBLEM :
The JVM crashes with a SIGBUS each time a WebView is used on a Mac having an ARM processor.

There is no such problem on a Mac Intel/macOS Monterey +  OpenJDK 17.0.1 + JavaFX 17.0.1.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Compile attached SimpleBrowser.java:
javac SimpleBrowser.java

2) Run using OpenJDK 17.0.1 + JavaFX 17.0.1 on a Mac M1/macOS Monterey:
java SimpleBrowser <ANY_HTML_FILE>

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
You should see <ANY_HTML_FILE> and the JVM should not crash.

This is what happens on a Mac Intel/macOS Monterey +  OpenJDK 17.0.1 + JavaFX 17.0.1
ACTUAL -
The JVM crashes and report a SIGBUS.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x00000001210014f0, pid=2428, tid=36367
# JRE version: OpenJDK Runtime Environment (17.0.1+12) (build 17.0.1+12-39)
# Java VM: OpenJDK 64-Bit Server VM (17.0.1+12-39, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# v  ~StubRoutines::SafeFetchN


---------- BEGIN SOURCE ----------
import java.io.File;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class SimpleBrowser extends Application {
    public static void main(String[] args) {
        if (args.length != 1) {
            System.err.println("Usage: java SimpleBrowser HTML_file_or_URL");
            System.exit(1);
        }
            
        launch(args);
    }

    public void start(Stage primaryStage) {
        primaryStage.setTitle("JavaFX SimpleBrowser");

        WebView webView = new WebView();

        /*
        com.sun.javafx.webkit.WebConsoleListener.setDefaultListener(
            (aWebView, message, lineNumber, sourceId) ->
            System.err.println("WebConsoleListener: " + message +
                               "[" + aWebView.getEngine().getLocation() +
                               ":" + lineNumber + "]"));
        */
        
        String location = getParameters().getRaw().get(0);
        if (location.indexOf(":/") < 0) {
            File file = new File(location);
            if (file.isFile()) {
                location = file.toURI().toASCIIString();
            }
        }
        
        webView.getEngine().load(location);

        VBox vBox = new VBox(webView);
        Scene scene = new Scene(vBox, 960, 600);

        primaryStage.setScene(scene);
        primaryStage.show();
    }
}

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

CUSTOMER SUBMITTED WORKAROUND :
No workaround.

FREQUENCY : always



Comments
Additional information from submitter: =========================== Attached hs_err_pid2428.log
15-11-2021

Duplicates to JDK-8276551
11-11-2021