Skip to content

Wasm CI (nightly-main) keeps failing #3369

Description

@kkebo

The CI job "Pull request / Test / Swift SDK for Wasm Build (nightly-main - jammy) (pull_request)" keeps failing.

Error log: https://github.com/swiftlang/swift-syntax/actions/runs/27970621243/job/82775581996

According to my experiments, there are two main problems.

Main problems:

  1. Error: Trap: out of bounds memory access
    • These errors are caused by swift-build and do not occur when using --build-system native.
  2. ParserTests.testSelfParse is failing (No file descriptors available)
    Test Case 'ParserTests.testSelfParse' started at 1970-01-09 19:01:59.743
    Self-parse tests - processing 327 source files
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSelfParse : failed - Self-parse tests: file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/ParserDiagnosticMessages.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSFilePath=/home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/ParserDiagnosticMessages.swift, NSURL=file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/ParserDiagnosticMessages.swift, NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available"}
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSelfParse : failed - Self-parse tests: file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/Utils.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSFilePath=/home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/Utils.swift, NSURL=file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/Utils.swift, NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available"}
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSelfParse : failed - Self-parse tests: file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/MissingNodesError.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSFilePath=/home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/MissingNodesError.swift, NSURL=file:///home/kebo/swift-syntax/Sources/SwiftParserDiagnostics/MissingNodesError.swift, NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available"}
    ...
    
    • I think the root cause might be WasmKit's file descriptor leak.
    • wasmtime run --dir / -W max-wasm-stack=16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest succeeds. (wasmtime 37.0.2)
    • ~/WasmKit/.build/release/wasmkit-cli run --dir .build --dir / --stack-size 16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest --filter SwiftParserTest.ParserTests/testSelfParse succeeds. (WasmKit main branch a0010b6eb445d87b26942466a574e1e8202e2cdb)
    • wasmkit run --dir .build --dir / --stack-size 16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest --filter SwiftParserTest.ParserTests/testSelfParse fails. (WasmKit 0.2.1 included in the Swift toolchain)

Minor problems:

  1. ParserTests.testSwiftTestsuite is failing (No file descriptors available)
    Test Case 'ParserTests.testSwiftTestsuite' started at 2026-06-27 12:53:34.199
    Swift tests - processing 6920 source files
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSwiftTestsuite : failed - Swift tests: file:///home/kebo/swift/test/Sema/typo_correction_limit.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available", NSFilePath=/home/kebo/swift/test/Sema/typo_correction_limit.swift, NSURL=file:///home/kebo/swift/test/Sema/typo_correction_limit.swift}
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSwiftTestsuite : failed - Swift tests: file:///home/kebo/swift/test/Sema/immutability_overload_async.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSURL=file:///home/kebo/swift/test/Sema/immutability_overload_async.swift, NSFilePath=/home/kebo/swift/test/Sema/immutability_overload_async.swift, NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available"}
    /home/kebo/swift-syntax/Tests/SwiftParserTest/ParserTests.swift:79: error: ParserTests.testSwiftTestsuite : failed - Swift tests: file:///home/kebo/swift/test/Sema/clang_types_in_ast.swift failed due to Error Domain=NSCocoaErrorDomain Code=256 "(null)"UserInfo={NSURL=file:///home/kebo/swift/test/Sema/clang_types_in_ast.swift, NSFilePath=/home/kebo/swift/test/Sema/clang_types_in_ast.swift, NSUnderlyingError=Error Domain=NSPOSIXErrorDomain Code=33 "No file descriptors available"}
    ...
    
    • Since this test only runs when swiftlang/swift is checked out, it doesn't affect the CI.
    • wasmtime run --dir / -W max-wasm-stack=16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest succeeds. (wasmtime 37.0.2)
    • ❌ Even ~/WasmKit/.build/release/wasmkit-cli run --dir .build --dir / --stack-size 16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest --filter SwiftParserTest.ParserTests/testSwiftTestsuite fails. (WasmKit main branch a0010b6eb445d87b26942466a574e1e8202e2cdb)
    • wasmkit run --dir .build --dir / --stack-size 16777216 .build/wasm32-unknown-wasip1/release/swift-syntaxPackageTests.xctest --filter SwiftParserTest.ParserTests/testSwiftTestsuite fails. (WasmKit 0.2.1 included in the Swift toolchain)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions