Skip to content

Mac launcher: avoid weak-imported Date.>= crash in psoArchiveProgress (#1131) - #1187

Merged
LNPANDY merged 1 commit into
mainfrom
fix/pso-archive-progress-crash
Nov 11, 2026
Merged

LNPANDY merged 1 commit into
mainfrom
fix/pso-archive-progress-crash

Conversation

@LNPANDY

@LNPANDY LNPANDY commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Fix or feature

  • Fix
  • Feature

What and why

Problem. The Mac launcher crashes (EXC_BAD_ACCESS at pc = 0x0) inside BuildProgress.psoArchiveProgress during 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 the 27.2.0 availability check while Foundation does not yet export that symbol, binding the stub to NULL.
Change. Compare TimeInterval (timeIntervalSinceReferenceDate) directly across BuildProgress, PlaySessions and ConsoleNotices, drop .mappedIfSafe when reading bases.mtl4-json while pso_offline writes beside it, and add an -O symbol regression test verifying zero weak-imported Foundation.Date symbols.

Fixes #1131

Disassembly and symbol verification

In the reported v1.3.0 crash (UUID 6E07E8FF-D0B1-3B7B-8743-0B9EF57BA47E, load base 0x104868000, lr = 0x104acfe44):

  • 0x104acfe44 - 0x104868000 = 0x267e44 (BuildProgress.psoArchiveProgress + 1404)
  • The preceding call 100267e40: bl 0x1003f6b68 targets the dyld stub for weak external _$s10Foundation4DateV2geoiySbAC_ACtFZ (if mtime >= rootMtime).
  • Verified with swift build -c release + nm -m on the final NX2Apple executable: weak external _$s10Foundation4DateV2geoiySbAC_ACtFZ was emitted before this change (from BuildProgress.o, PlaySessions.o and ConsoleNotices.o) and is completely absent after it.

Checked

  • Tests: cd frontend && swift test and python3 -m unittest discover -s frontend-qt/tests
  • Test for a fix: BuildProgressTests.testOptimizedDateComparisonsEmitNoWeakImportedFoundationDateSymbols (verified it fails before the fix and passes after)
  • Run on a device or Mac: verified swift build -c release produces zero (undefined) weak Foundation4DateV symbols in NX2Apple

Screenshots

None, no visible change.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments

…#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.
@github-actions github-actions Bot added the launcher The NX2Apple launcher app label Nov 11, 2026
@LNPANDY
LNPANDY merged commit 4bdbc19 into main Nov 11, 2026
17 checks passed
@LNPANDY
LNPANDY deleted the fix/pso-archive-progress-crash branch November 11, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

launcher The NX2Apple launcher app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NX2Apple crashes during Pipeline Archive at psoArchiveProgress on M2 MacBook Air

1 participant