Skip to content

SIL verifier abort on ~Copyable Optional var captured into async task group #89932

@broken-circle

Description

@broken-circle

Description

A recent main toolchain aborts the SIL verifier while compiling swift-subprocess in the debug configuration. The failing check is:

SIL verification failed: debug_value type chain should hold: inst->isExprTypeValid()
Verifying instruction:
   undef<${ var Optional<IODescriptor> }>
->   debug_value [moveable_value_debuginfo] undef : ${ var Optional<IODescriptor> }, var, name "diskIO", type $Optional<IODescriptor> // id: %247
In function:
// closure #1 in closure #1 in run<A, B, C, D>(_:input:output:error:body:)
// Isolation: @concurrent

Observed on swiftlang/swift-subprocess#261, where the offending function is Subprocess.run(_:input:output:error:body:) in Sources/Subprocess/API.swift.

Reproduction

Reproduces identically on unrelated PRs against the same base (same failing SIL instruction, same source range), so this is a toolchain regression rather than anything specific to the changes under test. Examples:

swiftlang/swift-subprocess#261
swiftlang/swift-subprocess#314

Stack dump

https://github.com/swiftlang/swift-subprocess/actions/runs/27469889276/job/81198764398?pr=261
https://github.com/swiftlang/swift-subprocess/actions/runs/27441717856/job/81117121105?pr=314

Expected behavior

The package compiles, or at minimum the compiler emits a diagnostic rather than aborting in the SIL verifier.

Environment

  • Swift version: 6.5-dev (LLVM 0ada7abaeee4c8c, Swift d1ce3ae)
  • Platform: x86_64 Linux (Ubuntu 22.04.5 LTS)
  • Configuration: -Onone, -swift-version 6, -enable-testing, with StrictConcurrency, Lifetimes, NonisolatedNonsendingByDefault, ExistentialAny, MemberImportVisibility, InternalImportsByDefault

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions