Skip to content

fix: resolve ConfigValidator SIGTRAP crash#700

Merged
batonogov merged 3 commits intomainfrom
fix/config-validator-crash-hotfix
Mar 31, 2026
Merged

fix: resolve ConfigValidator SIGTRAP crash#700
batonogov merged 3 commits intomainfrom
fix/config-validator-crash-hotfix

Conversation

@batonogov
Copy link
Copy Markdown
Owner

Summary

  • HOTFIX for v1.16.0 crash: ConfigValidator (line 593) was a final class without explicit actor isolation, inheriting @MainActor from SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor. It dispatched validation work to background queue com.pine.config-validation (line 611), causing dispatch_assert_queue_fail → SIGTRAP at runtime.
  • Extracted all heavy validation work (tool execution, file I/O, parsing) into nonisolated enum ConfigValidationWorker, following the established GitFetcher pattern.
  • Made ConfigValidator explicitly @MainActor with Task.sleep-based debounce instead of DispatchQueue.asyncAfter.
  • Marked all supporting types (ValidatorKind, ValidatorDetector, ToolAvailability, ValidatorOutputParser, BuiltinValidator) as nonisolated so they can be called from any isolation domain.

Audit results

Full codebase audit of DispatchQueue/OperationQueue background usage:

No other classes with background queue usage are missing isolation annotations.

Test plan

  • All 98 ConfigValidator tests pass (including 6 new ConfigValidationWorker tests)
  • worker_canBeCalledFromBackgroundThread — explicitly verifies the fix by calling worker from Task.detached
  • SwiftLint clean
  • Type-check clean (zero warnings)

…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.
@batonogov batonogov added bug Something isn't working priority: high Critical priority labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

✅ Code Coverage: 76.4%

Threshold: 70%

Coverage is above the minimum threshold.

Generated by CI — see job summary for detailed file-level breakdown.

@batonogov batonogov merged commit 018e6cc into main Mar 31, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high Critical priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant