You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CertWizard 2.2.1 crashes on first launch MacOS 27.2 (26B123) A64 #67
As in the title, the latest 2.2.1 release crashes on a new ARM MacBook when running. First time, and every time.
I was using this to migrate certs/etc. between laptops but didn't even get to point the wizard at a directory. I guess it's either a permission or a bug introduced into the code without check.
This is a slightly modified ootb setup with very, very little installed at this point in terms of 3rd party libraries/tools but I doubt the laptop software env is to blame.
2.2.0 works fine so I've dropped back to that build for now and afaict the changes are minimal.
If I get a chance I'll throw AI at building the latest branch and see if it's been fixed but right now it's a non-starter.
Root cause found: the 2.2.1 Mac bundles are signed without JVM entitlements
I dug into this with Claude Code. This is not a code bug, and it is not a permissions problem on my machine. It's a packaging and signing defect, and it affects both Mac downloads (ARM64 and Intel64).
What's wrong
The 2.2.1 .app bundles are signed with the hardened runtime (flags=0x10000(runtime)) but carry zero entitlements. The 2.2.0 bundle, which works, carried the standard four that any HotSpot JVM needs under the hardened runtime:
Without allow-jit, macOS kills the JVM as soon as it tries to set up its code cache. That happens inside JNI_CreateJavaVM, before a single line of CertWizard runs, which is why it dies on first launch, every launch, before any window appears. Every crash report shows the same thing:
The Java changes between 2.2.0 and 2.2.1 (the PPPK alias fix and the Locale.UK date formatter) are fine and are not involved.
How to see it yourself
# 2.2.1: no entitlements at all
codesign -dvv --entitlements - CertWizard.app 2>&1| grep -E 'flags|Key\]'# CodeDirectory v=20500 size=1629 flags=0x10000(runtime) ...# (no [Key] lines)# 2.2.0: the four JVM entitlements are present
codesign -dvv --entitlements - CertWizard-2.2.0-Mac-ARM64-Signed.app 2>&1| grep -E 'flags|Key\]'# ... flags=0x10000(runtime) ...# [Key] com.apple.security.cs.allow-dyld-environment-variables# [Key] com.apple.security.cs.allow-jit# [Key] com.apple.security.cs.allow-unsigned-executable-memory# [Key] com.apple.security.cs.disable-library-validation
The release assets also show the Mac zips were signed and uploaded by hand on 2026-10-30, seven weeks after the release was published on 2026-09-10. They weren't produced by the package.yml workflow, which builds an unsigned app and never launches the signed bundle.
The fix Claude applied, which confirms the cause
I took the unmodified 2.2.1 ARM64 bundle and re-signed only the launcher with the four entitlements 2.2.0 had:
Result: the JVM starts, SysProperty initialises, and CertWizard reaches the data-directory dialog as normal. Nothing else was changed: no rebuild, and the same runtime and jar.
⚠️ That's an ad-hoc signature, so it removes the STFC Developer ID and notarization. It's fine as a local workaround and as proof of the cause, but it's not something to redistribute. The real fix has to be done with the project's signing identity.
Recommended fix for maintainers
1. Short term: re-sign 2.2.1 (or cut 2.2.2) with entitlements, then notarize, staple and re-upload.
Commit the plist above to the repo (e.g. src/main/packaging/macos/CertWizard.entitlements) so it can't be forgotten again, and sign with it:
codesign --force --timestamp --options runtime \
--entitlements src/main/packaging/macos/CertWizard.entitlements \
--sign "Developer ID Application: The Science and Technology Facilities Council (F6C2P3VQP7)" \
CertWizard.app/Contents/MacOS/CertWizard
If you're signing with rcodesign (the pom comments suggest so), pass the same plist through its entitlements option for the main executable. Check rcodesign sign --help for the exact flag name in your version.
2. Better: let jpackage sign it, in CI.
jpackage already knows how to sign a Java app correctly, and its default entitlements include allow-jit. Add these to the existing jpackage-mac-app-image execution:
--mac-sign
--mac-signing-key-user-name "The Science and Technology Facilities Council (F6C2P3VQP7)"
--mac-entitlements src/main/packaging/macos/CertWizard.entitlements
Then import the Developer ID cert into a temporary keychain from repository secrets, and notarize with xcrun notarytool submit --wait plus xcrun stapler staple, all inside package.yml. That way the published assets are the artifacts CI actually built, not hand-signed zips swapped onto a release weeks later.
3. Add a release gate that would have caught this. Run it on both the macos-latest (ARM64) and macos-26-intel jobs, after signing, against the exact bundle that gets uploaded:
- name: Verify signed bundle has JVM entitlementsrun: | codesign -d --entitlements - --xml target/CertWizard.app/Contents/MacOS/CertWizard \ | grep -q com.apple.security.cs.allow-jit \ || { echo "::error::CertWizard launcher is missing com.apple.security.cs.allow-jit"; exit 1; }
- name: Smoke-test launch of the signed bundlerun: | mkdir -p "$RUNNER_TEMP/cw-data" target/CertWizard.app/Contents/MacOS/CertWizard "$RUNNER_TEMP/cw-data" & pid=$! sleep 15 if ! kill -0 "$pid" 2>/dev/null; then wait "$pid"; echo "::error::CertWizard exited on launch (code $?)"; exit 1 fi kill "$pid"
I ran the entitlement check against the real downloads. It fails both 2.2.1 Mac zips and passes 2.2.0 and the re-signed 2.2.1, so it separates good builds from bad ones exactly. The launch test needs no app changes, because the bad build dies within a second in JNI_CreateJavaVM. A --self-test flag that starts up and exits 0 would make it cleaner.
4. Small release-hygiene items spotted along the way:
Publish SHA-256 checksums alongside the assets.
Don't silently replace assets on an already-published release.
The tag is 2.2.1 while all earlier tags are vX.Y.Z.
package.yml's version_tag default still says v2.2.0.
Until a fixed build is out, Mac users can stay on 2.2.0. Bear in mind that 2.2.0 still has the PPPK renewal bug fixed in #66, which matters if your keystore holds the same certificate under two aliases, as can happen after migrating between machines.
changed the title [-]CertWizard 2.2.1 crashes on first launch MacOS 27.2 (26B123) A4[/-][+]CertWizard 2.2.1 crashes on first launch MacOS 27.2 (26B123) A64[/+]on Nov 7, 2026
Activity
rob-c commentedon Nov 6, 2026
Root cause found: the 2.2.1 Mac bundles are signed without JVM entitlements
I dug into this with Claude Code. This is not a code bug, and it is not a permissions problem on my machine. It's a packaging and signing defect, and it affects both Mac downloads (ARM64 and Intel64).
What's wrong
The 2.2.1
.appbundles are signed with the hardened runtime (flags=0x10000(runtime)) but carry zero entitlements. The 2.2.0 bundle, which works, carried the standard four that any HotSpot JVM needs under the hardened runtime:com.apple.security.cs.allow-jitcom.apple.security.cs.allow-unsigned-executable-memorycom.apple.security.cs.disable-library-validationcom.apple.security.cs.allow-dyld-environment-variablesWithout
allow-jit, macOS kills the JVM as soon as it tries to set up its code cache. That happens insideJNI_CreateJavaVM, before a single line of CertWizard runs, which is why it dies on first launch, every launch, before any window appears. Every crash report shows the same thing:The Java changes between 2.2.0 and 2.2.1 (the PPPK alias fix and the
Locale.UKdate formatter) are fine and are not involved.How to see it yourself
The release assets also show the Mac zips were signed and uploaded by hand on 2026-10-30, seven weeks after the release was published on 2026-09-10. They weren't produced by the
package.ymlworkflow, which builds an unsigned app and never launches the signed bundle.The fix Claude applied, which confirms the cause
I took the unmodified 2.2.1 ARM64 bundle and re-signed only the launcher with the four entitlements 2.2.0 had:
Result: the JVM starts,
SysPropertyinitialises, and CertWizard reaches the data-directory dialog as normal. Nothing else was changed: no rebuild, and the same runtime and jar.Recommended fix for maintainers
1. Short term: re-sign 2.2.1 (or cut 2.2.2) with entitlements, then notarize, staple and re-upload.
Commit the plist above to the repo (e.g.
src/main/packaging/macos/CertWizard.entitlements) so it can't be forgotten again, and sign with it:codesign --force --timestamp --options runtime \ --entitlements src/main/packaging/macos/CertWizard.entitlements \ --sign "Developer ID Application: The Science and Technology Facilities Council (F6C2P3VQP7)" \ CertWizard.app/Contents/MacOS/CertWizardIf you're signing with
rcodesign(the pom comments suggest so), pass the same plist through its entitlements option for the main executable. Checkrcodesign sign --helpfor the exact flag name in your version.2. Better: let jpackage sign it, in CI.
jpackage already knows how to sign a Java app correctly, and its default entitlements include
allow-jit. Add these to the existingjpackage-mac-app-imageexecution:Then import the Developer ID cert into a temporary keychain from repository secrets, and notarize with
xcrun notarytool submit --waitplusxcrun stapler staple, all insidepackage.yml. That way the published assets are the artifacts CI actually built, not hand-signed zips swapped onto a release weeks later.3. Add a release gate that would have caught this. Run it on both the
macos-latest(ARM64) andmacos-26-inteljobs, after signing, against the exact bundle that gets uploaded:I ran the entitlement check against the real downloads. It fails both 2.2.1 Mac zips and passes 2.2.0 and the re-signed 2.2.1, so it separates good builds from bad ones exactly. The launch test needs no app changes, because the bad build dies within a second in
JNI_CreateJavaVM. A--self-testflag that starts up and exits 0 would make it cleaner.4. Small release-hygiene items spotted along the way:
2.2.1while all earlier tags arevX.Y.Z.package.yml'sversion_tagdefault still saysv2.2.0.Until a fixed build is out, Mac users can stay on 2.2.0. Bear in mind that 2.2.0 still has the PPPK renewal bug fixed in #66, which matters if your keystore holds the same certificate under two aliases, as can happen after migrating between machines.
[-]CertWizard 2.2.1 crashes on first launch MacOS 27.2 (26B123) A4[/-][+]CertWizard 2.2.1 crashes on first launch MacOS 27.2 (26B123) A64[/+]