fix: resolve ConfigValidator SIGTRAP crash#700
Merged
Conversation
…onflict ConfigValidator was a `final class` without explicit isolation, inheriting `@MainActor` from `SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor` build setting. It dispatched work to background queue `com.pine.config-validation`, causing runtime assertion failure (dispatch_assert_queue_fail → SIGTRAP). Fix: Extract heavy validation work into `nonisolated enum ConfigValidationWorker` (same pattern as `GitFetcher`), make `ConfigValidator` explicitly `@MainActor`, replace DispatchQueue-based debounce with Task.sleep. All supporting types (ValidatorKind, ValidatorDetector, ToolAvailability, ValidatorOutputParser, BuiltinValidator) marked `nonisolated` to allow background access.
Contributor
✅ Code Coverage: 76.4%Threshold: 70% Coverage is above the minimum threshold. Generated by CI — see job summary for detailed file-level breakdown. |
batonogov
added a commit
that referenced
this pull request
Mar 31, 2026
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.
Summary
ConfigValidator(line 593) was afinal classwithout explicit actor isolation, inheriting@MainActorfromSWIFT_DEFAULT_ACTOR_ISOLATION = MainActor. It dispatched validation work to background queuecom.pine.config-validation(line 611), causingdispatch_assert_queue_fail→ SIGTRAP at runtime.nonisolated enum ConfigValidationWorker, following the establishedGitFetcherpattern.ConfigValidatorexplicitly@MainActorwithTask.sleep-based debounce instead ofDispatchQueue.asyncAfter.ValidatorKind,ValidatorDetector,ToolAvailability,ValidatorOutputParser,BuiltinValidator) asnonisolatedso they can be called from any isolation domain.Audit results
Full codebase audit of
DispatchQueue/OperationQueuebackground usage:ConfigValidator— FIXED (this PR)GitFetcher— alreadynonisolated enum(fixed in fix: crash in GitStatusProvider.fetchBranches — dispatch_assert_queue_fail on Swift 6 #613/fix: resolve dispatch_assert_queue_fail crash in GitStatusProvider (#613) #683)GitStatusProvider— already@MainActor, delegates toGitFetcherSyntaxHighlighter— alreadynonisolated final classFileSystemWatcher— alreadynonisolated final classWorkspaceManager— already@MainActor, usesnonisolatedstatic methodsProjectSearchProvider— already@MainActor, usesnonisolatedstatic methodsInlineDiffProvider—enum(namespace), no class isolation issueNo other classes with background queue usage are missing isolation annotations.
Test plan
ConfigValidationWorkertests)worker_canBeCalledFromBackgroundThread— explicitly verifies the fix by calling worker fromTask.detached