swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

Compilation fails with a SIL crash on nightlies #72484

Closed MahdiBM closed 6 months ago

MahdiBM commented 7 months ago

Description

Compilation fails with a SIL crash on nightlies, asking for a bug report.

~ swift test
.........
Building for debugging...
error: compile command failed due to signal 6 (use -v to see invocation)
SIL verification failed: init_existential_ref operand must be lowered to the right abstraction level for the existential
  $ExpiringValue<T>
  $ExpiringValue<τ_0_0>
Verifying instruction:
     %15 = copy_value %14 : $ExpiringValue<T>     // user: %16
->   %16 = init_existential_ref %15 : $ExpiringValue<T> : $ExpiringValue<τ_0_0>, $any Actor // user: %17
     %17 = enum $Optional<any Actor>, #Optional.some!enumelt, %16 : $any Actor // user: %18
In function:
// ExpiringValue.getValueTask(_:)
sil [ossa] @$s8SotoCore13ExpiringValueC03getD4TaskyScTyxs5Error_pGx_10Foundation4DateVtyYaYbKcKF : $@convention(method) <T where T : Sendable> (@guaranteed @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <T>, @sil_isolated @guaranteed ExpiringValue<T>) -> (@owned Task<T, any Error>, @error any Error) {
// %0 "getExpiringValue"                          // users: %13, %2
// %1 "self"                                      // users: %14, %3
bb0(%0 : @guaranteed $@Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <T>, %1 : @guaranteed $ExpiringValue<T>):
  debug_value %0 : $@Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <T>, let, name "getExpiringValue", argno 1 // id: %2
  debug_value %1 : $ExpiringValue<T>, let, name "self", argno 2, implicit // id: %3
  debug_value undef : $any Error, var, name "$error", argno 3 // id: %4
  %5 = metatype $@thin Task<Never, Never>.Type    // user: %7
  // function_ref static Task<>.checkCancellation()
  %6 = function_ref @$sScTss5NeverORszABRs_rlE17checkCancellationyyKFZ : $@convention(method) (@thin Task<Never, Never>.Type) -> @error any Error // user: %7
  try_apply %6(%5) : $@convention(method) (@thin Task<Never, Never>.Type) -> @error any Error, normal bb1, error bb2 // id: %7

bb1(%8 : $()):                                    // Preds: bb0
  %9 = metatype $@thin Task<T, any Error>.Type    // user: %21
  %10 = alloc_stack $Optional<TaskPriority>       // users: %22, %21, %11
  inject_enum_addr %10 : $*Optional<TaskPriority>, #Optional.none!enumelt // id: %11
  // function_ref closure #1 in ExpiringValue.getValueTask(_:)
  %12 = function_ref @$s8SotoCore13ExpiringValueC03getD4TaskyScTyxs5Error_pGx_10Foundation4DateVtyYaYbKcKFxyYaYbKcfU_ : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <τ_0_0>, @sil_isolated @guaranteed ExpiringValue<τ_0_0>) -> (@out τ_0_0, @error any Error) // user: %18
  %13 = copy_value %0 : $@Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <T> // user: %18
  %14 = copy_value %1 : $ExpiringValue<T>         // users: %18, %15
  %15 = copy_value %14 : $ExpiringValue<T>        // user: %16
  %16 = init_existential_ref %15 : $ExpiringValue<T> : $ExpiringValue<τ_0_0>, $any Actor // user: %17
  %17 = enum $Optional<any Actor>, #Optional.some!enumelt, %16 : $any Actor // user: %18
  %18 = partial_apply [callee_guaranteed] [isolated_any] %12<T>(%17, %13, %14) : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, Date, @error any Error) for <τ_0_0>, @sil_isolated @guaranteed ExpiringValue<τ_0_0>) -> (@out τ_0_0, @error any Error) // user: %19
  %19 = convert_function %18 : $@isolated(any) @Sendable @async @callee_guaranteed () -> (@out T, @error any Error) to $@isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <T> // user: %21
  // function_ref Task<>.init(priority:operation:)
  %20 = function_ref @$sScTss5Error_pRs_rlE8priority9operationScTyxsAA_pGScPSg_xyYaYbKYAcntcfC : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == any Error> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <τ_0_0>, @thin Task<τ_0_0, any Error>.Type) -> @owned Task<τ_0_0, any Error> // user: %21
  %21 = apply %20<T, any Error>(%10, %19, %9) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == any Error> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <τ_0_0>, @thin Task<τ_0_0, any Error>.Type) -> @owned Task<τ_0_0, any Error> // user: %23
  dealloc_stack %10 : $*Optional<TaskPriority>    // id: %22
  return %21 : $Task<T, any Error>                // id: %23

// %24                                            // user: %25
bb2(%24 : @owned $any Error):                     // Preds: bb0
  throw %24 : $any Error                          // id: %25
} // end sil function '$s8SotoCore13ExpiringValueC03getD4TaskyScTyxs5Error_pGx_10Foundation4DateVtyYaYbKcKF'

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
[stack dump is pasted below, so I omitted it from here]
[2819/2961] Compiling SotoCore Exports.swift
error: fatalError

Reproduction

docker run --rm -it swiftlang/swift:nightly-main-jammy@sha256:6f58d9db1f633a480c93668bc5f0b94175fdb1189241fd72e5589f6707098b68 bash -c "git clone https://github.com/vapor/penny-bot && cd penny-bot && git checkout tags/mmbm-6.0-SIL-crash && swift test"

Stack dump

0.  Program arguments: /usr/bin/swift-frontend -frontend -c /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSClient+Paginate.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSClient.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSEndpointDiscovery.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSService.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSServiceConfig.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSShapes/Base64Data.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/AWSShapes/EventPayload.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/AnyAsyncSequence.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/ByteBufferSequence.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/EventStream.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/ExpiringValue.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/FixedSizeByteBufferAsyncSequence.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/Sequence+concurrentMap.swift -primary-file /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/ConfigFileCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/ConfigFileLoader.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/Credential+IsEmpty.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/CredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/CredentialProviderError.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/CredentialProviderSelector.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/DeferredCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/ExpiringCredential.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/MetaDataCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/NullCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/RotatingCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/RuntimeSelectorCredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/STSAssumeRole.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/StaticCredential+CredentialProvider.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Credential/StaticCredential+Environment.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Doc/AWSShape.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Doc/EndpointVariant.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Doc/Environment.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Doc/Region.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Doc/ServiceProtocol.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/CodableProperties/CodableProperties.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/CodableProperties/CollectionCoders.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/CodableProperties/DateCoders.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/CodableProperties/EC2ArrayCoder.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/EventStreamDecoder.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/QueryEncoder.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/RequestContainer.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Encoder/ResponseContainer.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Errors/ClientErrors.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Errors/Error.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Errors/ServerErrors.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Exports.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/AWSHTTPBody.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/AWSHTTPRequest.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/AWSHTTPResponse+HAL.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/AWSHTTPResponse.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/AsyncHTTPClient.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/HTTP/S3SignedAsyncSequence.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/EditHeadersMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/EndpointDiscoveryMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/ErrorHandlingMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/LoggingMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/RetryMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/S3Middleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/SigningMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/TracingMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/Middleware/TreeHashMiddleware.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Middleware/MiddlewareStack.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/RetryPolicy.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Sendable.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Utils/UnsafeTransfer.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Utils/base64.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Utils/crc32.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Waiters/AWSClient+Waiter.swift /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Waiters/Matcher.swift -supplementary-output-file-map /tmp/TemporaryDirectory.B7cHOy/supplementaryOutputs-2 -target aarch64-unknown-linux-gnu -Xllvm -aarch64-use-tbi -disable-objc-interop -I /penny-bot/.build/aarch64-unknown-linux-gnu/debug/Modules -color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /penny-bot/.build/aarch64-unknown-linux-gnu/debug/ModuleCache -suppress-warnings -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -empty-abi-descriptor -resource-dir /usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /penny-bot -Xcc -fmodule-map-file=/penny-bot/.build/checkouts/swift-numerics/Sources/_NumericsShims/include/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-numerics/Sources/_NumericsShims/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOExtrasZlib.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOBoringSSLShims.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio-ssl/Sources/CNIOBoringSSLShims/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOBoringSSL.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio-ssl/Sources/CNIOBoringSSL/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CAsyncHTTPClient.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/async-http-client/Sources/CAsyncHTTPClient/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CSotoExpat.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/soto-core/Sources/CSotoExpat/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOLLHTTP.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio/Sources/CNIOLLHTTP/include -Xcc -fmodule-map-file=/penny-bot/.build/checkouts/swift-atomics/Sources/_AtomicsShims/include/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-atomics/Sources/_AtomicsShims/include -Xcc -fmodule-map-file=/penny-bot/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio/Sources/CNIOWindows/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOLinux.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio/Sources/CNIOLinux/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIODarwin.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio/Sources/CNIODarwin/include -Xcc -fmodule-map-file=/penny-bot/.build/aarch64-unknown-linux-gnu/debug/CNIOAtomics.build/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-nio/Sources/CNIOAtomics/include -Xcc -fmodule-map-file=/penny-bot/.build/checkouts/swift-crypto/Sources/CCryptoBoringSSLShims/include/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-crypto/Sources/CCryptoBoringSSLShims/include -Xcc -fmodule-map-file=/penny-bot/.build/checkouts/swift-crypto/Sources/CCryptoBoringSSL/include/module.modulemap -Xcc -I -Xcc /penny-bot/.build/checkouts/swift-crypto/Sources/CCryptoBoringSSL/include -Xcc -fPIC -Xcc -g -Xcc -fno-omit-frame-pointer -module-name SotoCore -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins -parse-as-library -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/AnyAsyncSequence.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/ByteBufferSequence.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/EventStream.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/ExpiringValue.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/FixedSizeByteBufferAsyncSequence.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/Sequence+concurrentMap.swift.o -o /penny-bot/.build/aarch64-unknown-linux-gnu/debug/SotoCore.build/ConfigFileCredentialProvider.swift.o -index-store-path /penny-bot/.build/aarch64-unknown-linux-gnu/debug/index/store -index-system-modules
1.  Swift version 6.0-dev (LLVM 38b55e165bf60f0, Swift 5d6ce704dda3abc)
2.  Compiling with effective version 5.10
3.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/ExpiringValue.swift")
4.  While silgen emitFunction SIL function "@$s8SotoCore13ExpiringValueC03getD4TaskyScTyxs5Error_pGx_10Foundation4DateVtyYaYbKcKF".
 for 'getValueTask(_:)' (at /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/ExpiringValue.swift:130:5)
5.  While verifying SIL function "@$s8SotoCore13ExpiringValueC03getD4TaskyScTyxs5Error_pGx_10Foundation4DateVtyYaYbKcKF".
 for 'getValueTask(_:)' (at /penny-bot/.build/checkouts/soto-core/Sources/SotoCore/Concurrency/ExpiringValue.swift:130:5)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend  0x0000aaaaeff5d9d8
1  swift-frontend  0x0000aaaaeff5b9cc
2  swift-frontend  0x0000aaaaeff5e0e4
3  linux-vdso.so.1 0x0000ffff83f037a0 __kernel_rt_sigreturn + 0
4  libc.so.6       0x0000ffff8231f200
5  libc.so.6       0x0000ffff822da67c raise + 28
6  libc.so.6       0x0000ffff822c7130 abort + 228
7  swift-frontend  0x0000aaaaeaa7ca5c
8  swift-frontend  0x0000aaaaeaa8d148
9  swift-frontend  0x0000aaaaeaa80f84
10 swift-frontend  0x0000aaaaeaa7f404
11 swift-frontend  0x0000aaaaeaa78950
12 swift-frontend  0x0000aaaae9fc97c4
13 swift-frontend  0x0000aaaae9fc8e3c
14 swift-frontend  0x0000aaaae9fca0c4
15 swift-frontend  0x0000aaaae9fc7584
16 swift-frontend  0x0000aaaaea0b25e8
17 swift-frontend  0x0000aaaaea0af054
18 swift-frontend  0x0000aaaaea0aef44
19 swift-frontend  0x0000aaaae9fcce5c
20 swift-frontend  0x0000aaaaea09aaf8
21 swift-frontend  0x0000aaaae9fd24ec
22 swift-frontend  0x0000aaaae9fcd964
23 swift-frontend  0x0000aaaae9906f84
24 swift-frontend  0x0000aaaae9919a9c
25 swift-frontend  0x0000aaaae990a228
26 swift-frontend  0x0000aaaae9908afc
27 swift-frontend  0x0000aaaae96fa49c
28 libc.so.6       0x0000ffff822c73fc
29 libc.so.6       0x0000ffff822c74cc __libc_start_main + 152
30 swift-frontend  0x0000aaaae96f9470

Expected behavior

No crash.

Environment

swiftlang/swift:nightly-main-jammy@sha256:6f58d9db1f633a480c93668bc5f0b94175fdb1189241fd72e5589f6707098b68 image.

Additional information

No response

hjyamauchi commented 6 months ago

I am getting a similar crash

SIL verification failed: init_existential_ref operand must be lowered to the right abstraction level for the existential
  $LayeredCache<Value>
  $LayeredCache<τ_0_0>
Verifying instruction:
     %17 = copy_value %15 : $LayeredCache<Value>  // user: %18
->   %18 = init_existential_ref %17 : $LayeredCache<Value> : $LayeredCache<τ_0_0>, $any Actor // user: %19
     %19 = enum $Optional<any Actor>, #Optional.some!enumelt, %18 : $any Actor // user: %20
In function:
// LayeredCache.releaseLock(forKey:afterBackgroundTask:)
sil private [ossa] @$s13ARCFoundation12LayeredCacheC11releaseLock33_C01C6992E4474F9A4084CAA2F158DB96LL6forKey19afterBackgroundTaskySS_yyYactF : $@convention(method) <Value where Value : Sendable> (@guaranteed String, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed LayeredCache<Value>) -> () {
// %0 "key"                                       // users: %16, %3
// %1 "block"                                     // users: %14, %4
// %2 "self"                                      // users: %15, %5
bb0(%0 : @guaranteed $String, %1 : @guaranteed $@async @callee_guaranteed () -> (), %2 : @guaranteed $LayeredCache<Value>):
  debug_value %0 : $String, let, name "key", argno 1 // id: %3
  debug_value %1 : $@async @callee_guaranteed () -> (), let, name "block", argno 2 // id: %4
  debug_value %2 : $LayeredCache<Value>, let, name "self", argno 3, implicit // id: %5
  %6 = metatype $@thin Task<(), Never>.Type       // user: %23
  %7 = alloc_stack $Optional<TaskPriority>        // users: %24, %23, %12, %8
  %8 = init_enum_data_addr %7 : $*Optional<TaskPriority>, #Optional.some!enumelt // user: %11
  %9 = metatype $@thin TaskPriority.Type          // user: %11
  // function_ref static TaskPriority.background.getter
  %10 = function_ref @$sScP10backgroundScPvgZ : $@convention(method) (@thin TaskPriority.Type) -> @out TaskPriority // user: %11
  %11 = apply %10(%8, %9) : $@convention(method) (@thin TaskPriority.Type) -> @out TaskPriority
  inject_enum_addr %7 : $*Optional<TaskPriority>, #Optional.some!enumelt // id: %12
  // function_ref closure #1 in LayeredCache.releaseLock(forKey:afterBackgroundTask:)
  %13 = function_ref @$s13ARCFoundation12LayeredCacheC11releaseLock33_C01C6992E4474F9A4084CAA2F158DB96LL6forKey19afterBackgroundTaskySS_yyYactFyyYaYbcfU_ : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed LayeredCache<τ_0_0>, @guaranteed String) -> @out () // user: %20
  %14 = copy_value %1 : $@async @callee_guaranteed () -> () // user: %20
  %15 = copy_value %2 : $LayeredCache<Value>      // users: %20, %17
  %16 = copy_value %0 : $String                   // user: %20
  %17 = copy_value %15 : $LayeredCache<Value>     // user: %18
  %18 = init_existential_ref %17 : $LayeredCache<Value> : $LayeredCache<τ_0_0>, $any Actor // user: %19
  %19 = enum $Optional<any Actor>, #Optional.some!enumelt, %18 : $any Actor // user: %20
  %20 = partial_apply [callee_guaranteed] [isolated_any] %13<Value>(%19, %14, %15, %16) : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed LayeredCache<τ_0_0>, @guaranteed String) -> @out () // user: %21
  %21 = convert_function %20 : $@isolated(any) @Sendable @async @callee_guaranteed () -> @out () to $@isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <()> // user: %23
  // function_ref Task<>.init(priority:operation:)
  %22 = function_ref @$sScTss5NeverORs_rlE8priority9operationScTyxABGScPSg_xyYaYbYAcntcfC : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == Never> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <τ_0_0>, @thin Task<τ_0_0, Never>.Type) -> @owned Task<τ_0_0, Never> // user: %23
  %23 = apply %22<(), Never>(%7, %21, %6) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == Never> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <τ_0_0>, @thin Task<τ_0_0, Never>.Type) -> @owned Task<τ_0_0, Never> // user: %25
  dealloc_stack %7 : $*Optional<TaskPriority>     // id: %24
  destroy_value %23 : $Task<(), Never>            // id: %25
  %26 = tuple ()                                  // user: %27
  return %26 : $()                                // id: %27
} // end sil function '$s13ARCFoundation12LayeredCacheC11releaseLock33_C01C6992E4474F9A4084CAA2F158DB96LL6forKey19afterBackgroundTaskySS_yyYactF'

I don't have a reproduction test but based on my local experiments, this appears to be started at commit https://github.com/apple/swift/commit/a86b76a3e9ebe352e8d250927c211445ac692c26 https://github.com/apple/swift/pull/72325 (reverting it appears to make it go away):

hjyamauchi commented 6 months ago

Here's a reduced test:

>cat C:\Users\hiroshi\tmp\Test.swift
public actor WaitableEvent2 {
    public func signal() async {
    }
}

public final actor Test<Value: Sendable> {

    private var locks: [String /* cache key */: WaitableEvent2] = [:]

    private func releaseLock(forKey key: String) async {
        guard let event = locks.removeValue(forKey: key) else {
            return
        }
        await event.signal()
    }

    private func releaseLock(forKey key: String, afterBackgroundTask block: @escaping () async -> Void) {
        Task(priority: .background) {
            await block()
            await releaseLock(forKey: key)
        }
    }
}

>"S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swiftc.exe" C:\Users\hiroshi\tmp\Test.swift
error: compile command failed due to exception 3 (use -v to see invocation)
SIL verification failed: init_existential_ref operand must be lowered to the right abstraction level for the existential
  $Test<Value>
  $Test<τ_0_0>
Verifying instruction:
     %17 = copy_value %15 : $Test<Value>          // user: %18
->   %18 = init_existential_ref %17 : $Test<Value> : $Test<τ_0_0>, $any Actor // user: %19
     %19 = enum $Optional<any Actor>, #Optional.some!enumelt, %18 : $any Actor // user: %20
In function:
// Test.releaseLock(forKey:afterBackgroundTask:)
sil private [ossa] @$s4TestAAC11releaseLock33_FD30D9FC47D6AC50355EEC3A2CA8155CLL6forKey19afterBackgroundTaskySS_yyYactF : $@convention(method) <Value where Value : Sendable> (@guaranteed String, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed Test<Value>) -> () {
// %0 "key"                                       // users: %16, %3
// %1 "block"                                     // users: %14, %4
// %2 "self"                                      // users: %15, %5
bb0(%0 : @guaranteed $String, %1 : @guaranteed $@async @callee_guaranteed () -> (), %2 : @guaranteed $Test<Value>):
  debug_value %0 : $String, let, name "key", argno 1 // id: %3
  debug_value %1 : $@async @callee_guaranteed () -> (), let, name "block", argno 2 // id: %4
  debug_value %2 : $Test<Value>, let, name "self", argno 3, implicit // id: %5
  %6 = metatype $@thin Task<(), Never>.Type       // user: %23
  %7 = alloc_stack $Optional<TaskPriority>        // users: %24, %23, %12, %8
  %8 = init_enum_data_addr %7 : $*Optional<TaskPriority>, #Optional.some!enumelt // user: %11
  %9 = metatype $@thin TaskPriority.Type          // user: %11
  // function_ref static TaskPriority.background.getter
  %10 = function_ref @$sScP10backgroundScPvgZ : $@convention(method) (@thin TaskPriority.Type) -> @out TaskPriority // user: %11
  %11 = apply %10(%8, %9) : $@convention(method) (@thin TaskPriority.Type) -> @out TaskPriority
  inject_enum_addr %7 : $*Optional<TaskPriority>, #Optional.some!enumelt // id: %12
  // function_ref closure #1 in Test.releaseLock(forKey:afterBackgroundTask:)
  %13 = function_ref @$s4TestAAC11releaseLock33_FD30D9FC47D6AC50355EEC3A2CA8155CLL6forKey19afterBackgroundTaskySS_yyYactFyyYaYbcfU_ : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed Test<τ_0_0>, @guaranteed String) -> @out () // user: %20
  %14 = copy_value %1 : $@async @callee_guaranteed () -> () // user: %20
  %15 = copy_value %2 : $Test<Value>              // users: %20, %17
  %16 = copy_value %0 : $String                   // user: %20
  %17 = copy_value %15 : $Test<Value>             // user: %18
  %18 = init_existential_ref %17 : $Test<Value> : $Test<τ_0_0>, $any Actor // user: %19
  %19 = enum $Optional<any Actor>, #Optional.some!enumelt, %18 : $any Actor // user: %20
  %20 = partial_apply [callee_guaranteed] [isolated_any] %13<Value>(%19, %14, %15, %16) : $@convention(thin) @Sendable @async <τ_0_0 where τ_0_0 : Sendable> (@guaranteed Optional<any Actor>, @guaranteed @async @callee_guaranteed () -> (), @sil_isolated @guaranteed Test<τ_0_0>, @guaranteed String) -> @out () // user: %21
  %21 = convert_function %20 : $@isolated(any) @Sendable @async @callee_guaranteed () -> @out () to $@isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <()> // user: %23
  // function_ref Task<>.init(priority:operation:)
  %22 = function_ref @$sScTss5NeverORs_rlE8priority9operationScTyxABGScPSg_xyYaYbYAcntcfC : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == Never> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <τ_0_0>, @thin Task<τ_0_0, Never>.Type) -> @owned Task<τ_0_0, Never> // user: %23
  %23 = apply %22<(), Never>(%7, %21, %6) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Sendable, τ_0_1 == Never> (@in Optional<TaskPriority>, @owned @isolated(any) @Sendable @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <τ_0_0>, @thin Task<τ_0_0, Never>.Type) -> @owned Task<τ_0_0, Never> // user: %25
  dealloc_stack %7 : $*Optional<TaskPriority>     // id: %24
  destroy_value %23 : $Task<(), Never>            // id: %25
  %26 = tuple ()                                  // user: %27
  return %26 : $()                                // id: %27
} // end sil function '$s4TestAAC11releaseLock33_FD30D9FC47D6AC50355EEC3A2CA8155CLL6forKey19afterBackgroundTaskySS_yyYactF'

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: "S:/Program Files/swift/Toolchains/0.0.0+Asserts/usr/bin/swift-frontend.exe" -frontend -c -primary-file C:\\Users\\hiroshi\\tmp\\Test.swift -target x86_64-unknown-windows-msvc -disable-objc-interop -sdk "S:\\Program Files\\Swift\\Platforms\\Windows.platform\\Developer\\SDKs\\Windows.sdk" -color-diagnostics -empty-abi-descriptor -resource-dir "S:\\Program Files\\swift\\Toolchains\\0.0.0+Asserts\\usr\\lib\\swift" -module-name Test -plugin-path "S:\\Program Files\\swift\\Toolchains\\0.0.0+Asserts\\usr\\bin" -plugin-path "S:\\Program Files\\swift\\Toolchains\\0.0.0+Asserts\\usr\\local\\bin" -o C:\\Users\\hiroshi\\AppData\\Local\\Temp\\TemporaryDirectory.6Na16N\\Test-1.o
1.      Swift version 6.0-dev (LLVM c079606b0f5b8af, Swift 3b830bffb5aebae)
2.      Compiling with effective version 5.10
3.      While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "C:\Users\hiroshi\tmp\Test.swift")
4.      While silgen emitFunction SIL function "@$s4TestAAC11releaseLock33_FD30D9FC47D6AC50355EEC3A2CA8155CLL6forKey19afterBackgroundTaskySS_yyYactF".
 for 'releaseLock(forKey:afterBackgroundTask:)' (at C:\Users\hiroshi\tmp\Test.swift:17:13)
5.      While verifying SIL function "@$s4TestAAC11releaseLock33_FD30D9FC47D6AC50355EEC3A2CA8155CLL6forKey19afterBackgroundTaskySS_yyYactF".
 for 'releaseLock(forKey:afterBackgroundTask:)' (at C:\Users\hiroshi\tmp\Test.swift:17:13)
Exception Code: 0x80000003
 #0 0x00007ff7f655d175 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x739d175 (S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe+0x739d175)
 #1 0x00007ff7f655d175
 #2 0x00007ff7f655d175 (S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe+0x739d175)
 #3 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x16db4dc S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x16e7c34
 #4 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x1708f8b S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x170d54c
 #5 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x170dc4b S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x16fdf99
 #6 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbf19ee S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbe48cb
 #7 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbe79f9 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbe3b65
 #8 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xc34cd8 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xc2f02d
 #9 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xc35118 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbe7c97
#10 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbe8424 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbf30c6
#11 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbddc02 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0xbf1721
#12 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x3beec1 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x3bd768
#13 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x3bdcde S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x3c022b
#14 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x2049eb S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x20458c
#15 0x00007ffcdf02e5f5 S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe 0x7413d68 (C:\Windows\System32\ucrtbase.dll+0x7e5f5)
#16 0x00007ffcdf02e5f5
#17 0x00007ffcdf02e5f5 (C:\Windows\System32\ucrtbase.dll+0x7e5f5)
0x00007FF7F655D175, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x739D175 byte(s), HandleAbort() + 0x5 byte(s)
0x00007FFCDF02E5F5, C:\Windows\System32\ucrtbase.dll(0x00007FFCDEFB0000) + 0x7E5F5 byte(s), raise() + 0x1E5 byte(s)
0x00007FFCDF02F601, C:\Windows\System32\ucrtbase.dll(0x00007FFCDEFB0000) + 0x7F601 byte(s), abort() + 0x31 byte(s)
0x00007FF7F089B4DC, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x16DB4DC byte(s), ?_Tidy@?$_Func_class@X$$V@std@@IEAAXXZ() + 0x60C byte(s)
0x00007FF7F08A7C34, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x16E7C34 byte(s), ?begin@?$SmallVectorTemplateCommon@PEAVSILInstruction@swift@@X@llvm@@QEAAPEAPEAVSILInstruction@swift@@XZ() + 0xC334 byte(s)
0x00007FF7F08C8F8B, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x1708F8B byte(s), ?verifySILUndefMap@SILFunction@swift@@QEBAXXZ() + 0x1A7B byte(s)
0x00007FF7F08CD54C, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x170D54C byte(s), ?verifySILUndefMap@SILFunction@swift@@QEBAXXZ() + 0x603C byte(s)
0x00007FF7F08CDC4B, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x170DC4B byte(s), ?verifySILUndefMap@SILFunction@swift@@QEBAXXZ() + 0x673B byte(s)
0x00007FF7F08BDF99, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x16FDF99 byte(s), ?verify@SILFunction@swift@@QEBAXPEAVCalleeCache@2@_N11@Z() + 0xD9 byte(s)
0x00007FF7EFDB19EE, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBF19EE byte(s), ?postEmitFunction@SILGenModule@Lowering@swift@@QEAAXUSILDeclRef@3@PEAVSILFunction@3@@Z() + 0x10E byte(s)
0x00007FF7EFDA48CB, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBE48CB byte(s), ?emitFunctionDefinition@SILGenModule@Lowering@swift@@QEAAXUSILDeclRef@3@PEAVSILFunction@3@@Z() + 0xD3B byte(s)
0x00007FF7EFDA79F9, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBE79F9 byte(s), ?emitOrDelayFunction@SILGenModule@Lowering@swift@@QEAAXUSILDeclRef@3@@Z() + 0x299 byte(s)
0x00007FF7EFDA3B65, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBE3B65 byte(s), ?emitFunction@SILGenModule@Lowering@swift@@QEAAXPEAVFuncDecl@3@@Z() + 0x165 byte(s)
0x00007FF7EFDF4CD8, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xC34CD8 byte(s), ?visitFuncDecl@SILGenExtension@@QEAAXPEAVFuncDecl@swift@@@Z() + 0x168 byte(s)
0x00007FF7EFDEF02D, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xC2F02D byte(s), ?emitSelfConformanceWitnessTable@SILGenModule@Lowering@swift@@QEAAXPEAVProtocolDecl@3@@Z() + 0x1FD byte(s)
0x00007FF7EFDF5118, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xC35118 byte(s), ?visitNominalTypeDecl@SILGenModule@Lowering@swift@@QEAAXPEAVNominalTypeDecl@3@@Z() + 0x18 byte(s)
0x00007FF7EFDA7C97, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBE7C97 byte(s), ?emitPropertyWrapperBackingInitializer@SILGenModule@Lowering@swift@@QEAAXPEAVVarDecl@3@@Z() + 0x247 byte(s)
0x00007FF7EFDA8424, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBE8424 byte(s), ?evaluate@ASTLoweringRequest@swift@@AEBA?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@AEAVEvaluator@2@UASTLoweringDescriptor@2@@Z() + 0x284 byte(s)
0x00007FF7EFDB30C6, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBF30C6 byte(s), ?evaluateRequest@?$SimpleRequest@VASTLoweringRequest@swift@@$$A6A?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@UASTLoweringDescriptor@2@@Z$08@swift@@SA?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@AEBVASTLoweringRequest@2@AEAVEvaluator@2@@Z() + 0x36 byte(s)
0x00007FF7EFD9DC02, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBDDC02 byte(s), ??$getResultUncached@VASTLoweringRequest@swift@@V<lambda_1>@?1???$evaluateOrFatal@VASTLoweringRequest@swift@@@2@YA?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@AEAVEvaluator@2@V12@@Z@@Evaluator@swift@@AEAA?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@AEBVASTLoweringRequest@1@V<lambda_1>@?1???$evaluateOrFatal@VASTLoweringRequest@swift@@@1@YA?AV23@AEAV01@V41@@Z@@Z() + 0x212 byte(s)
0x00007FF7EFDB1721, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0xBF1721 byte(s), ?performASTLowering@swift@@YA?AV?$unique_ptr@VSILModule@swift@@U?$default_delete@VSILModule@swift@@@std@@@std@@AEAVFileUnit@1@AEAVTypeConverter@Lowering@1@AEBVSILOptions@1@PEBVIRGenOptions@1@@Z() + 0x101 byte(s)
0x00007FF7EF57EEC1, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x3BEEC1 byte(s), ?performCompileStepsPostSema@swift@@YA_NAEAVCompilerInstance@1@AEAHPEAVFrontendObserver@1@@Z() + 0x561 byte(s)
0x00007FF7EF57D768, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x3BD768 byte(s), ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z() + 0x508 byte(s)
0x00007FF7EF57DCDE, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x3BDCDE byte(s), ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z() + 0xA7E byte(s)
0x00007FF7EF58022B, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x3C022B byte(s), ?performFrontend@swift@@YAHV?$ArrayRef@PEBD@llvm@@PEBDPEAXPEAVFrontendObserver@1@@Z() + 0x9DB byte(s)
0x00007FF7EF3C49EB, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x2049EB byte(s), ?push_back@?$SmallVectorTemplateBase@PEBD$00@llvm@@QEAAXPEBD@Z() + 0x15B byte(s)
0x00007FF7EF3C458C, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x20458C byte(s), ?mainEntry@swift@@YAHHPEAPEBD@Z() + 0xE3C byte(s)
0x00007FF7F65D3D68, S:\Program Files\swift\Toolchains\0.0.0+Asserts\usr\bin\swift-frontend.exe(0x00007FF7EF1C0000) + 0x7413D68 byte(s), __scrt_common_main_seh() + 0x10C byte(s), D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line 288 + 0x22 byte(s)
0x00007FFCE0B0257D, C:\Windows\System32\KERNEL32.DLL(0x00007FFCE0AF0000) + 0x1257D byte(s), BaseThreadInitThunk() + 0x1D byte(s)
0x00007FFCE1C4AA58, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFCE1BF0000) + 0x5AA58 byte(s), RtlUserThreadStart() + 0x28 byte(s)

With https://github.com/apple/swift/commit/a86b76a3e9ebe352e8d250927c211445ac692c26 locally reverted, the crash seems to disappear.

rjmccall commented 6 months ago

This was probably fixed by #72575; can you verify?

hjyamauchi commented 6 months ago

@rjmccall Yes it seems to fix the issue I get. Thanks!

hjyamauchi commented 6 months ago

My issue is fixed but I'll leave this issue open for @MahdiBM to verify

MahdiBM commented 6 months ago

Thanks @hjyamauchi . It can take another 2 weeks or so considering I'm on vacation in a place with improper internet connection.

MahdiBM commented 6 months ago

I can confirm this is resolved on the latest nightly main images.