Repository navigation
Mac launcher: avoid weak-imported Date.>= crash in psoArchiveProgress (#1131) - #1187
Merged
Merged
Conversation
…#1131) Release builds compiled against the Xcode 27.2 SDK emit Foundation.Date.>= (_$s10Foundation4DateV2geoiySbAC_ACtFZ) as a weak-imported symbol under -O. Early macOS 27.2 betas satisfy the platform version check while Foundation does not yet export that symbol, so dyld binds it to NULL and calling BuildProgress.psoArchiveProgress jumps to pc = 0 during Pipeline archive. Compare TimeInterval (timeIntervalSinceReferenceDate) directly across BuildProgress, PlaySessions and ConsoleNotices, drop .mappedIfSafe when reading bases.mtl4-json while pso_offline writes beside it, and assert under -O that no weak-imported Foundation.Date symbol is emitted.
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.
Fix or feature
What and why
Problem. The Mac launcher crashes (
EXC_BAD_ACCESSatpc = 0x0) insideBuildProgress.psoArchiveProgressduring Pipeline archive on early macOS 27.2 betas (#1131).Cause. Release builds compiled against the Xcode 27.2 SDK emit
static Foundation.Date.>=(_:_:)(_$s10Foundation4DateV2geoiySbAC_ACtFZ) as a weak-imported symbol under-O, and early macOS 27.2 builds (26B5091g) pass the27.2.0availability check whileFoundationdoes not yet export that symbol, binding the stub toNULL.Change. Compare
TimeInterval(timeIntervalSinceReferenceDate) directly acrossBuildProgress,PlaySessionsandConsoleNotices, drop.mappedIfSafewhen readingbases.mtl4-jsonwhilepso_offlinewrites beside it, and add an-Osymbol regression test verifying zero weak-importedFoundation.Datesymbols.Fixes #1131
Disassembly and symbol verification
In the reported v1.3.0 crash (
UUID 6E07E8FF-D0B1-3B7B-8743-0B9EF57BA47E, load base0x104868000,lr = 0x104acfe44):0x104acfe44 - 0x104868000 = 0x267e44(BuildProgress.psoArchiveProgress + 1404)100267e40: bl 0x1003f6b68targets the dyld stub forweak external _$s10Foundation4DateV2geoiySbAC_ACtFZ(if mtime >= rootMtime).swift build -c release+nm -mon the finalNX2Appleexecutable:weak external _$s10Foundation4DateV2geoiySbAC_ACtFZwas emitted before this change (fromBuildProgress.o,PlaySessions.oandConsoleNotices.o) and is completely absent after it.Checked
cd frontend && swift testandpython3 -m unittest discover -s frontend-qt/testsBuildProgressTests.testOptimizedDateComparisonsEmitNoWeakImportedFoundationDateSymbols(verified it fails before the fix and passes after)swift build -c releaseproduces zero(undefined) weakFoundation4DateVsymbols inNX2AppleScreenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#..., orpendinguntil that PR is open