Why do I keep getting this SIGBUS error code on my MacOS when trying to run a JavaFx Project on Netbeans?
Asked Answered
G

2

10

Whenever I try to run my JavaFX problem I encounter a MacOS error, My code runs fine on other devices so I am not sure what is wrong.

Im using an M1 mac, with Java 17 and JavaFX up to the latest version. When running the JavaFX App, it opens up the gui for either 1 second or 30 seconds before crashing and spitting out the error provided. Any help would be greatly appreciated, and if you have other questions or need more info lmk.

I believe it's a problem with a /private/TMP folder or something with what I've seen online, but I can be completely wrong since that folder is basically empty right now so I don't see it being full or whatever.

If anyone can help or has any idea, I would really appreciate some feedback.

A fatal error has been detected by the Java Runtime Environment:
SIGBUS (0xa) at pc=0x000000010c0314f0, pid=1056, tid=28943

JRE version: Java(TM) SE Runtime Environment (17.0.1+12) (build 17.0.1+12-LTS-39)
Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.1+12-LTS-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:
/Users/peter/Desktop/BookStore/hs_err_pid1056.log

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
Geelong answered 17/12, 2021 at 4:11 Comment(0)
W
7

Update your JavaFX version to the most recent available.

JavaFX bug reports mentioning:

stubroutines::SafeFetchN

are closed as duplicates of JDK-8275723, even though the crash error message there is slightly different.

Bug reports related to this are logged when trying to run early versions (less than 17.0.2) of JavaFX 17 on some M1 macs using the Monterey OS.

The linked case report recommends using JavaFX version 17.0.2 when it is released and notes a fix is also in the most recent JavaFX 18 early access releases, which are available for download.

Asker notes in comments:

I updated the JavaFx to 18 and it's all good

Another asker noted in comments on a duplicate:

I just tried to run the project with a JDK version 17.0.2 and it seems to work perfectly fine

I have a 17.0.2 one (newest version from Bellsoft Liberica).

Wardrobe answered 17/12, 2021 at 5:3 Comment(3)
Do you know how to provoke the bug? If so, I would test myself. But I do not see much of a description on the principal issue page nor on the 21 linked issues, except for these few clues: (a) May take variable amount of time, around 15 seconds into running a JavaFX app, and (b) "use some kind of JavaFX elements (could be as simple as an empty GridPane", and (c) SimpleBrowser.java attached to this.Backswept
@BasilBourque sorry, I don't know how to make the error occur. I don't have an M1 Mac to verify it. I only know the information gleaned from the test cases, which you have already pointed out. However, from the frequency count, seriousness of the issue (crash and complete failure), and that it can happen quickly after app startup and at intermittent times, I think it is best to avoid any builds in which the bug may potentially exist and just use builds where the issue is known to be addressed.Wardrobe
Thanks. working on org.openjfx version 19Gelid
J
0

Yes the issue is with JDK 17 Oracle. I have tried Azul Zulu JDK 17.34.19 and its working great! I am linking it below

Azul Zulu JDK 17 Download Page

Jangro answered 3/6, 2022 at 8:2 Comment(1)
This has nothing to do with Oracle vs. Azul. It is a matter of the correct minor version numbers used.Sandhurst

© 2022 - 2024 — McMap. All rights reserved.