Skip to content

swift test dies with a Windows fatal exception partway through Test-SourceKitLSP #2769

Description

@rintaro

On Windows CI the swift test process running the sourcekit-lsp suite sometimes dies partway through with a Windows fatal exception instead of reporting test results. There is no Note: Some test targets reported failures line, no failing test, and no captured output for any test — the driver simply stops and build.ps1 reports the raw exit status.

Four occurrences, with three different exception codes:

Build Exit code Meaning Died at
swift-PR-windows-status/1128 -1073740940 0xC0000374 STATUS_HEAP_CORRUPTION test 586 of 1389
swift-PR-windows-status/1138 -1073741819 0xC0000005 STATUS_ACCESS_VIOLATION test 490 of 1389
swift-PR-windows-status/1142 -1073741795 0xC000001D STATUS_ILLEGAL_INSTRUCTION test 598 of 1389
swift-PR-windows/61249 -1073741795 0xC000001D STATUS_ILLEGAL_INSTRUCTION test 940 of 1402

In each case the [n/m] Testing … progress output stops abruptly at the point shown and the log ends with:

Error: Error: swift exited with code -1073740940.
Invocation:
  swift test --scratch-path T:\x86_64-unknown-windows-msvc\SourceKitLSPTests --package-path …\sourcekit-lsp -c release -debug-info-format none --parallel …
  at Test-SourceKitLSP, …\swift\utils\build.ps1: line 5363

The truncation point differs every time (35% to 67% through the run) and the tests being scheduled at that moment are unrelated to each other across the four builds — FoldingRangeTests, CodeActionTests, FormattingTests, SwiftCompletionTests. So this does not look tied to any particular test.

Because SwiftPM's parallel runner prints [n/m] Testing … from the driver and only emits captured per-test output for tests that fail, a driver that dies produces no usable diagnostic at all. That makes this the least debuggable of the Windows CI failures.

STATUS_HEAP_CORRUPTION in particular suggests a genuine memory-safety problem rather than a timeout or a scheduling issue, which is what most of the other Windows CI flakiness looks like (#2766). I have no stack trace, so I can't say which component is at fault — it may well belong in swiftlang/swift-package-manager rather than here, and I'm happy to move it if the driver turns out to be the culprit. Filing here because this is where the Windows Test-SourceKitLSP instability is being tracked (#2360, #2766).

Possibly related and possibly a different manifestation of the same underlying problem: in sourcekit-lsp-PR-windows/4267 a single test worker died silently — WorkspaceTestDiscoveryTests.testTargetWithCustomModuleName printed Test Case … started and never reported a result, with no stderr — while the driver survived and reported the target as failed. That is an individual worker crashing rather than the driver, but it has the same "process vanishes with no diagnostic" character.

Logging

Full Jenkins console logs attached, gzipped (raw they are ~28 MB each, over GitHub's attachment limit).

Attachment Exception
swift-PR-windows-status-1128-heap-corruption.txt.gz 0xC0000374
swift-PR-windows-status-1138-access-violation.txt.gz 0xC0000005
swift-PR-windows-status-1142-illegal-instruction.txt.gz 0xC000001D
swift-PR-windows-61249-illegal-instruction.txt.gz 0xC000001D

Useful greps:

swift exited with code -10737        # the fatal exception
] Testing SourceKitLSPTests          # last scheduled test before the driver died
Some test targets reported failures  # absent in all four, unlike ordinary test failures

swift-PR-windows-61249-illegal-instruction.txt.gz
swift-PR-windows-status-1128-heap-corruption.txt.gz
swift-PR-windows-status-1138-access-violation.txt.gz
swift-PR-windows-status-1142-illegal-instruction.txt.gz

Activity

  1. added theissue type on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsWindows platform support

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions