When building and signing a GraalVM-produced binary for macOS under App Sandbox, the application should work, so long as the developer's code adheres to the rules of the App Sandbox and Hardened Runtime.
Instead, the attached crash is thrown regardless of entitlement state.
Using the latest version of GraalVM can resolve many issues.
Build any GraalVM Native Image binary on macOS (I'm on latest, but App Sandbox was introduced in Catalina)
Prepare an Info.plist
Add arguments to your -H:NativeLinkerFlags to embed the PList section
Sign the binary with entitlements which enable App Sandbox
Run the binary
Additional Context
Step 1:
Entrypoint.java
package repro;
public class Entrypoint {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Compile to native binary and sign
(0) add Entrypoint.java, Info.plist, and Entitlements.plist to a directory. you will also need signing credentials from Apple Developer.
@oubidar-Abderrahim After re-creating the above, I haven't been able to reproduce this issue. Our stacktrace shows a clear source of the error within signal handling code, I can provide that if helpful
Describe the Issue
When building and signing a GraalVM-produced binary for macOS under App Sandbox, the application should work, so long as the developer's code adheres to the rules of the App Sandbox and Hardened Runtime.
Instead, the attached crash is thrown regardless of entitlement state.
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
java --version
:native-image --version
Operating System and Version
Darwin 24.1.0 Darwin Kernel Version 24.1.0: Mon Sep 30 00:07:01 PDT 2024; root:xnu-11215.40.63~39/RELEASE_ARM64_T6020 arm64
Diagnostic Flag Confirmation
-H:ThrowMissingRegistrationErrors=
flag.Run Command
./sample
Expected Behavior
I expect the program to run and print
"Hello World"
Actual Behavior
It unconditionally crashes instead:
See Run-Time Log Output for full crash-trace.
Steps to Reproduce
Info.plist
-H:NativeLinkerFlags
to embed the PList sectionAdditional Context
Step 1:
Entrypoint.java
Compile to native binary and sign (0) add
Entrypoint.java
,Info.plist
, andEntitlements.plist
to a directory. you will also need signing credentials from Apple Developer.Info.plist
Entitlements.plist
Run-Time Log Output and Error Messages
Expand for full crash trace