-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Large arm64 macOS debug binaries fail to exec since the v0 mangling default #159426
Copy link
Copy link
Open
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersA-name-manglingArea: Name mangling / decoration aka symbol manglingArea: Name mangling / decoration aka symbol manglingC-bugCategory: This is a bug.Category: This is a bug.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}O-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersA-name-manglingArea: Name mangling / decoration aka symbol manglingArea: Name mangling / decoration aka symbol manglingC-bugCategory: This is a bug.Category: This is a bug.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}O-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Since the switch to v0 mangling by default (#151994), the dev build of our
workspace (~1100 crates,
debug = "line-tables-only") is killed at exec onarm64 macOS:
With the default
-Csplit-debuginfo=unpacked, ld64's debug map puts anN_FUNstab with the full mangled name of every function into theexecutable. Legacy names stay near-constant length under generic nesting (the
hash absorbs the type), while v0 names grow with it — the map is now
3,173,815 functions averaging 475 bytes per name (max 1558), a 1.51 GB
LC_SYMTABstrtab in a 2.45 GB binary, and once the image passes ~2 GB theprocess no longer fits between its load address and the dyld shared region.
The scaling is visible on a 25-line file — a closure inside a generic
function, instantiated at type-nesting depth 4 vs 16:
-Csymbol-mangling-version=legacywould be the escape hatch, but it is gatedon
-Zunstable-options, so there is no stable way back to a bootable debugbuild. Could that gate be lifted, or over-long names be hashed in the
debug-map path the way MCP 934 (#148429) does for PDB?