Skip to content

Fix make test SIGSEGV on Swift 6.2#1638

Merged
jglogan merged 1 commit into
apple:mainfrom
ajemory:test-segfault-fix
Jun 4, 2026
Merged

Fix make test SIGSEGV on Swift 6.2#1638
jglogan merged 1 commit into
apple:mainfrom
ajemory:test-segfault-fix

Conversation

@ajemory

@ajemory ajemory commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

make test crashed with signal code 11. Root cause: in HelpCommandTests, #expect(...) compares an optional metatype (ParsableCommand.Type?) against nil. #expect decomposes the comparison into a generic helper, forcing the Swift 6.2 runtime to instantiate generic metadata over the metatype — which segfaults in libswiftCore. (Works fine on 6.3; 6.2 is still supported by Container.)

Fix: precompute each comparison into a Bool before passing it to #expect, so it never enters the generic-metadata path. Both crash sites needed it (fixing one moves the crash to the other).

Test: full unit suite now runs to completion on Swift 6.2 — no SIGSEGV.

Closes #1637

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 34.63%
Integration 19.74%
Combined 53.75%

@jglogan jglogan merged commit 605045f into apple:main Jun 4, 2026
4 checks passed
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.

[Bug]: make test segfaults on Swift 6.2

2 participants