macOS: symbolicate arm64 crashes with atos -arch arm64#3064
Open
tomjn wants to merge 2 commits into
Open
Conversation
The macOS crash handler hardcoded '-arch x86_64' when invoking atos (ADDR2LINE), so backtrace symbolication produced no useful output on Apple Silicon binaries. Select '-arch arm64' at compile time on aarch64/arm64 targets, keeping x86_64 for Intel. Also fix the debug log of the frame address: stackFrame.ip is a void*, but it was printed with '0x%lx', a format/argument mismatch. Use %p.
sprunk
reviewed
Jun 25, 2026
Match the architecture-detection convention in Platform/Misc.cpp (GetArchitectureStr): x86_64 macro set first, then __aarch64__/_M_ARM64, with #error on anything else. Fold the arch into a string so the atos command line isn't duplicated per branch. Addresses review feedback on beyond-all-reason#3064.
sprunk
approved these changes
Jun 25, 2026
tomjn
added a commit
to tomjn/RecoilEngine
that referenced
this pull request
Jun 25, 2026
Match the architecture-detection convention in Platform/Misc.cpp (GetArchitectureStr): x86_64 macro set first, then __aarch64__/_M_ARM64, with #error on anything else. Fold the arch into a string so the atos command line isn't duplicated per branch. Addresses review feedback on beyond-all-reason#3064. (cherry picked from commit 4eacdfe)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two fixes to the macOS crash handler (
rts/System/Platform/Mac/CrashHandler.cpp):arm64 symbolication.
TranslateStackTraceinvokedatos(ADDR2LINE) with a hardcoded-arch x86_64. On Apple Silicon that arch doesn't match the running binary, so symbolication produced no useful output. Select-arch arm64at compile time on__aarch64__/__arm64__targets, keepingx86_64for Intel.Format/argument mismatch. The debug log of the frame address used
0x%lxagainststackFrame.ip, which is avoid*— a format/argument mismatch (UB). Changed to%p.Why
Surfaced bringing up the native macOS (Apple Silicon) build. Without (1), a crash backtrace on arm64 is unsymbolicated and effectively useless for debugging.
Safety
macOS-only file. The arch selection is compile-time, so a binary embeds the
atos -archmatching the architecture it runs on. No effect on Linux/Windows.Verified by inspection; macOS isn't in CI yet. Part of the "big mac" bring-up; an independent change extracted while reviewing #3060 (which re-derived the same arm64 fix).