Skip to content

Fix random crashes on macOS when started from lazygit, gh or another Go tool - #584

Open
a-team-app[bot] wants to merge 3 commits into
mainfrom
milestone-563-sdk-pin
Open

a-team-app[bot] wants to merge 3 commits into
mainfrom
milestone-563-sdk-pin

Conversation

@a-team-app

@a-team-app a-team-app Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Every build of TuiCode, local, CI and release, now uses SDK 10.0.402 or a newer 10.0 SDK. Its Native AOT compiler is ILCompiler 10.0.13, which fixes the macOS crash when TuiCode is started by a Go program: lazygit or gh opening it as $EDITOR, or tuirec (dotnet/runtime#132581).

Closes #563

What changed

  • global.json asks for SDK 10.0.402, with rollForward: latestFeature and allowPrerelease: false. A newer 10.0 SDK is accepted. An older one or a .NET 11 preview isn't.
  • CI's build and aot jobs, and release.yml, install the SDK through global-json-file: global.json instead of a floating 10.0.x.
  • AGENTS.md Quick start says which SDK to install.

Checked on this Mac

  • ILCompiler: the osx-arm64 publish resolves "runtime.osx-arm64.Microsoft.DotNet.ILCompiler/10.0.13" (src/TuiCode/obj/project.assets.json). I'll add the CI aot log line once it has run.
  • Older SDK refused: with only 10.0.401 and 11.0.100-rc.2 visible, dotnet build stops with A compatible .NET SDK was not found. Requested SDK version: 10.0.402. So a .NET 11 SDK doesn't satisfy the pin either.
  • The 200-GC repro from macOS: TuiCode segfaults when started by a Go program such as tuirec (.NET 10.0.12 NativeAOT signal bug) #509, built with this branch's global.json and launched by tuirec 0.9.1, ran 10 times on each SDK:
    • SDK 10.0.401 (ILCompiler 10.0.12): crashed all 10 times with EXC_BAD_ACCESS (SIGSEGV), pc=0x0, x0=30.
    • SDK 10.0.402 (ILCompiler 10.0.13): printed 200 GCs, no crash all 10 times.
  • TuiCode itself: the AOT build of this branch, started by tuirec with AGENTS.md open, was sent SIGUSR1 five times. It kept running and kept scrolling afterwards. In macOS: TuiCode segfaults when started by a Go program such as tuirec (.NET 10.0.12 NativeAOT signal bug) #509 a 10.0.12 build died on the first one.

Worth flagging

a-team try tuicode 584

On macOS, Native AOT builds from ILCompiler 10.0.12 crash on a GC when a
Go program started them (dotnet/runtime#132581, fixed in 10.0.13). The SDK
picks the ILCompiler, so global.json asks for 10.0.402 (rolling forward
within 10.0, no previews), and CI and the release workflow install the SDK
it names instead of a floating 10.0.x.

Closes #563

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@a-team-app

a-team-app Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

CI fails here because main is red, not because of this change. #581 merged after #582, and its UnsavedEditsHostTests.cs:102 still uses ConfirmView (and its FocusedChoice), which #582 removed. Main's own CI on 1259216 fails with the same error.

The SDK pin itself works: setup-dotnet resolved and the build reached compile on both runners.

Leaving this a draft. Once a fix for that test lands on main, I'll merge it in and mark this ready. Want me to open that fix as a follow-up issue?

a-team-app Bot and others added 2 commits October 20, 2026 21:25
#581 and #582 merged side by side: #581's test still looked for the
ConfirmView that #582 removed, so main stopped compiling.

Closes #563

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every build uses .NET 10.0.13 or later, so TuiCode no longer crashes on macOS when a Go program starts it

0 participants