adoptium-support icon indicating copy to clipboard operation
adoptium-support copied to clipboard

Fatal Error in JRE - Apple M1

Open Otaphoque opened this issue 3 years ago • 7 comments

This error happens every time I try to run a Java Application that includes any kind of Java FX elements (could be as simple as a Button or an empty GridPane). The app will run form anywhere between 2 and 15 seconds, it is not regular and does not depend on whether the user interacted with any of the Java FX elements. My laptop is a 2020 Mac (running on M1). I use IntelliJ (latest version 2021.3.2) but this also happens with any other IDE I have tried. I am using the latest version of the JDK, that is version 17.0.1. I have also re-installed my OS once and reformatted my laptop twice, nothing worked. Below is the full error message as well as sample code that created the error. Thanks :)

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x000000010bea94f0, pid=37946, tid=30223
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.1+12 (17.0.1+12) (build 17.0.1+12)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (17.0.1+12, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# v  ~StubRoutines::SafeFetchN
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# *path to the error report*
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

public class HelloApplication extends Application {

    @Override
    public void start(Stage stage) {

        GridPane grid = new GridPane();
        grid.setAlignment(Pos.CENTER);
        grid.getChildren().add(new Button("Patate"));

        Scene scene = new Scene(grid, 300, 300);
        stage.setScene(scene);
        stage.show();
    }

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

Otaphoque avatar Feb 01 '22 05:02 Otaphoque

Can you try 17.02 that was just released?

Also are you running an Mac Os X ARM JVM or a x86-64 JVM via Rosetta?

karianna avatar Feb 01 '22 13:02 karianna

Hi, I just downloaded and tried the 17.0.2 version. The compiling seems to be working but I get the following error right after (the program does not run, it only compiles) :

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/knstnce/.openjfx/cache/17.0.0.1/libprism_es2.dylib

I don't remember downloading Rosetta, but I might be wrong because it says "Intel" in the type column of my Java Process (see picture, the notes in brackets are just the French-English translation).

I did find a 17.0.2 JDK that works (Bellsoft Liberica) so that is what I will be using for the future. For reference, the 17.0.2 OpenJDK from Oracle does not work either.

Illustration_sans_titre

Otaphoque avatar Feb 01 '22 22:02 Otaphoque

@knstnce Did you try the 17.0.2 aarch64 binary to see if it has the same problem? The UnsatisfiedLinkError could be from an intel/aarch64 mismatch. And was the Liberica JRE that you downloaded the arm or x64 one?

sxa avatar Feb 08 '22 11:02 sxa

I get the same error on my M1 laptop. I have tried many versions including Temurin 17.0.3 aarch64. I also tried zulu-jdk17.0.2-aarch64 and still I get the same error.

gspinoza avatar Mar 18 '22 18:03 gspinoza

I get the same error on my M1 laptop. I have tried many versions including Temurin 17.0.3 aarch64. I also tried zulu-jdk17.0.2-aarch64 and still I get the same error.

The only one that has worked so far for me was the Bellsoft Liberica 17.0.2. Hope that helps !

Otaphoque avatar Mar 18 '22 18:03 Otaphoque

The only one that has worked so far for me was the Bellsoft Liberica 17.0.2. Hope that helps !

Thanks for the suggestion, but unfortunately that did not worked for me.

gspinoza avatar Mar 18 '22 18:03 gspinoza

ok, installing Liberica Full JDK 17.0.2 ARM did the work!

Note: Liberica Standard JDK or Liberica Lite JDK will not work, only the Full JDK works.

gspinoza avatar Mar 18 '22 19:03 gspinoza