Skip to content

Fix isolated deinit crashes in Markdown rendering helpers - #16

Merged
gtokman merged 1 commit into
mainfrom
codex/ios-0037-markdown-deinit
Oct 16, 2026
Merged

gtokman merged 1 commit into
mainfrom
codex/ios-0037-markdown-deinit

Conversation

@gtokman

@gtokman gtokman commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Avoid the isolated-deinitializer back-deployment path when synchronous Markdown rendering releases ListProcessor and its owned InlineAttributeCache.

Problem

Production SIGABRT stacks during assistant-message and plan-preview rendering show nested destruction of these classes through swift_task_deinitOnExecutorMainActorBackDeploy, ending in swift::TaskLocal::StopLookupScope and an invalid free. Both classes inherit the target's default MainActor isolation and have implicit destructors.

Solution

Add explicit empty nonisolated deinit implementations to both classes. Their rendering APIs retain MainActor isolation; the destructors contain no actor-dependent cleanup. Add synchronous lifetime tests for direct cache release and processor/owned-cache release inside a task-local scope.

Validation

  • Swift 6.4 optimized iOS and macOS code generation in a reduced harness: executor-deinit calls are present in both original destructors and absent with this change.
  • Reduced macOS harness passes 100 synchronous nested releases and task-local restoration checks. The original also passes on this runtime, so this is not a reproduction of the production crash.
  • Full changed MarkdownView source and new tests type-check using direct Swift 6.3.3 compiler and existing dependency modules, with a matching Litext module emitted from source.
  • Parsing and diff checks pass. Full package tests and affected-device verification remain outstanding.

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markdown-view Ready Ready Preview, v0 Oct 16, 2026 5:29pm UTC

Request Review

@gtokman
gtokman marked this pull request as ready for review October 16, 2026 17:30
@gtokman
gtokman merged commit 852fb17 into main Oct 16, 2026
5 of 6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 3999685f Deployed Oct 16, 2026 by vercel[bot]
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.

1 participant