4

I have had this error for over 6 months now, and I feel like I have tried everything at this point. Whenever I run a Java Application that uses some kind of JavaFX elements (could be as simple as an empty GridPane, with or without an animation,...), it works for a few seconds, then stops and prints the following :

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x00000001300014f0, pid=37716, tid=27919
#
# 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, sharing, 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 file*
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# 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)

Here is one sample of code that will give this error for example:

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);
    }
}

No matter what JDK (Azul, Oracle, Bellsoft,... aarch64) or IDE (Netbeans, IntelliJ,...) I use, the error is always the same. I am on a 2020 Mac (so running with the M1 chip).

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
knstnce
  • 41
  • 4
  • Out of curiosity: Does this only apply to jar files you have compiled on that machine, or does it also apply to external jar files compiled on another machine? – sorifiend Feb 01 '22 at 04:14
  • Welcome to Stack Overflow. Please read [ask] and https://stackoverflow.com/help/minimal-reproducible-example. We can only tell you what is wrong with code that you actually show us. "could be as simple as an empty GridPane" - that's fine; we would still like to see the actual code that sets this up, and the exact steps you take to run the program. Also - can you reproduce the problem with *other* graphical elements that are *not* from JavaFX? – Karl Knechtel Feb 01 '22 at 04:16
  • @KarlKnechtel A fatal error typically means an error that is not evident in code, but rather an underlying bug or issue with the JVM, in this case with `StubRoutines::SafeFetchN`? @knstnce Other than submitting a bug report or reinstalling Java or the OS there is not a lot you can do, see: https://stackoverflow.com/questions/70075585/javafx-error-on-intellij-after-running-program-sigbus-0xa – sorifiend Feb 01 '22 at 04:21
  • @sorifiend Just on files that I have compiled on my machine, haven't tried and don't really know how to do the second case – knstnce Feb 01 '22 at 04:24
  • @KarlKnechtel I just updated the post to include an example of what will give the error, and I have not tried other graphical elements not from JavaFX because we are required to use only JavaFX in my course – knstnce Feb 01 '22 at 04:27
  • @sorifiend I read over the post you sent and this seems to be exactly my problem. I did report the bug issue to Azul but they never really replied. I re-installed my entire OS once and reformatted my Mac a couple of times (for different reasons but it should've solved this as well no ?). From everything you told me, there is just no solution ? – knstnce Feb 01 '22 at 04:31
  • Sadly that seems to be the case. There is some internal issue between Java and the M1 system. You could try downloading a different/newer development version of the JVM, or getting it directly from Oracle rather than using OpenJDK, but that's just grasping at straws. I really hope this gets resolved for you, but these things often take time... – sorifiend Feb 01 '22 at 04:31
  • 1
    "I did report the bug issue to Azul but they never really replied." - Do you have an Azul support contract? – Stephen C Feb 01 '22 at 04:58
  • Did you follow the guidance given in the error message and report it to https://bugreport.java.com/bugreport/crash.jsp (which is not Azul) – mipa Feb 01 '22 at 09:15
  • 1
    I found [this OpenJDK bug report](https://bugs.openjdk.java.net/browse/JDK-8277043) which is marked as a duplicate of [this one](https://bugs.openjdk.java.net/browse/JDK-8275723). Apparentls JavaFx 17.0.2 should contain the fix. Luckily that version was released about a week ago. – Joachim Sauer Feb 01 '22 at 09:17
  • 1
    The solution, as noted in the duplicate answer, is simple, just upgrade your JavaFX version to one that works. 18 early access releases work and the 17.0.2 release should work too, though I don’t have a machine to verify it. – jewelsea Feb 01 '22 at 09:36
  • 1
    Hi everyone, I just tried to run the project with a JDK version 17.0.2 and it seems to work perfectly fine! I did not see that they updated the JDK. Concerning the Azul report contract, I'm not sure what that is so I don't think I have it. For the other bug reports, I had only reported it to Azul (I use multiple JDK), I also submitted a bug issue to Oracle (17.0.1) and Adoptium (17.0.1) yesterday but I don't think it matters now since I have a 17.0.2 one (newest version from Bellsoft Liberica, I had only tried the old before). Thanks again to everyone who answered this, it's been so useful :D – knstnce Feb 01 '22 at 13:30

0 Answers0