Skip to content

[6.1] Compiler crash: Instruction missing on-stack pack metadata cleanups! #80054

@dimlio

Description

@dimlio

Description

Hi!

Swift 6.1 crashes while trying to compile the following 2 files with the following output:

$ swiftc -v a.swift b.swift 
Apple Swift version 6.1-dev (LLVM 08670c03fe16573, Swift 493744d5e4900b2)
Target: arm64-apple-macosx15.0
/Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file a.swift b.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -color-diagnostics -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift -module-name main -in-process-plugin-server-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.2 -target-sdk-name macosx15.2 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -o /var/folders/y0/5ch3_9cs0x1fyzdykz2tbz4w0000gn/T/TemporaryDirectory.jCBBgU/a-1.o
error: compile command failed due to signal 6 (use -v to see invocation)
Instruction missing on-stack pack metadata cleanups!
  destroy_addr %2 : $*Optional<MemoryCache<Object>.PublicCacheInfo> // id: %19

 In function:
// MemoryCache.State.unregister(_:)
// Isolation: unspecified
sil hidden @$s4main11MemoryCacheC5StateV10unregisteryyAC06PublicC0Cyx_GF : $@convention(method) <Object> (@guaranteed MemoryCache<Object>.PublicCache, @inout MemoryCache<Object>.State) -> () {
// %0 "publicCache"                               // users: %6, %4
// %1 "self"                                      // users: %12, %5
bb0(%0 : $MemoryCache<Object>.PublicCache, %1 : $*MemoryCache<Object>.State):
  %2 = alloc_stack $Optional<MemoryCache<Object>.PublicCacheInfo> // users: %21, %28, %19, %18, %15
  %3 = alloc_stack [lexical] [var_decl] $MemoryCache<Object>.PublicCacheInfo, let, name "publicCacheInfo" // users: %27, %24, %23
  debug_value %0 : $MemoryCache<Object>.PublicCache, let, name "publicCache", argno 1 // id: %4
  debug_value %1 : $*MemoryCache<Object>.State, var, name "self", argno 2, expr op_deref // id: %5
  %6 = ref_to_unmanaged %0 : $MemoryCache<Object>.PublicCache to $@sil_unmanaged MemoryCache<Object>.PublicCache // user: %7
  %7 = struct $Unmanaged<MemoryCache<Object>.PublicCache> (%6 : $@sil_unmanaged MemoryCache<Object>.PublicCache) // user: %8
  %8 = unchecked_trivial_bit_cast %7 : $Unmanaged<MemoryCache<Object>.PublicCache> to $UnsafeMutableRawPointer // users: %11, %9
  debug_value %8 : $UnsafeMutableRawPointer, let, name "ptr" // id: %9
  %10 = alloc_stack $UnsafeMutableRawPointer      // users: %11, %17, %15
  store %8 to %10 : $*UnsafeMutableRawPointer     // id: %11
  %12 = begin_access [modify] [static] %1 : $*MemoryCache<Object>.State // users: %16, %13
  %13 = struct_element_addr %12 : $*MemoryCache<Object>.State, #MemoryCache.State.publicCaches // user: %15
  // function_ref Dictionary.removeValue(forKey:)
  %14 = function_ref @$sSD11removeValue6forKeyq_Sgx_tF : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in_guaranteed τ_0_0, @inout Dictionary<τ_0_0, τ_0_1>) -> @out Optional<τ_0_1> // user: %15
  %15 = apply %14<UnsafeMutableRawPointer, MemoryCache<Object>.PublicCacheInfo>(%2, %10, %13) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in_guaranteed τ_0_0, @inout Dictionary<τ_0_0, τ_0_1>) -> @out Optional<τ_0_1>
  end_access %12 : $*MemoryCache<Object>.State    // id: %16
  dealloc_stack %10 : $*UnsafeMutableRawPointer   // id: %17
  switch_enum_addr %2 : $*Optional<MemoryCache<Object>.PublicCacheInfo>, case #Optional.some!enumelt: bb2, case #Optional.none!enumelt: bb1 // id: %18

bb1:                                              // Preds: bb0
  destroy_addr %2 : $*Optional<MemoryCache<Object>.PublicCacheInfo> // id: %19
  br bb3                                          // id: %20

bb2:                                              // Preds: bb0
  %21 = unchecked_take_enum_data_addr %2 : $*Optional<MemoryCache<Object>.PublicCacheInfo>, #Optional.some!enumelt // user: %22
  %22 = unchecked_addr_cast %21 : $*MemoryCache<Object>.PublicCacheInfo to $*MemoryCache<Object>.PublicCacheInfo // user: %23
  copy_addr [take] %22 to [init] %3 : $*MemoryCache<Object>.PublicCacheInfo // id: %23
  destroy_addr %3 : $*MemoryCache<Object>.PublicCacheInfo // id: %24
  br bb3                                          // id: %25

bb3:                                              // Preds: bb2 bb1
  %26 = tuple ()                                  // user: %29
  dealloc_stack %3 : $*MemoryCache<Object>.PublicCacheInfo // id: %27
  dealloc_stack %2 : $*Optional<MemoryCache<Object>.PublicCacheInfo> // id: %28
  return %26 : $()                                // id: %29
} // end sil function '$s4main11MemoryCacheC5StateV10unregisteryyAC06PublicC0Cyx_GF'

Allocated the following on-stack pack metadata:
- Metadata Pack:   %10 = alloca [1 x ptr], align 8
define hidden swiftcc void @"$s4main11MemoryCacheC5StateV10unregisteryyAC06PublicC0Cyx_GF"(ptr %0, ptr %1, ptr nocapture swiftself dereferenceable(8) %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 8, i1 false)
  %6 = alloca ptr, align 8
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 8, i1 false)
  %7 = alloca ptr, align 8
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 8, i1 false)
  %8 = alloca ptr, align 8
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 8, i1 false)
  %9 = alloca %TSv, align 8
  %10 = alloca [1 x ptr], align 8
  %11 = alloca i1, align 1
  %12 = getelementptr inbounds ptr, ptr %1, i64 2
  %13 = load ptr, ptr %12, align 8, !invariant.load !2
  store ptr %13, ptr %4, align 8
  %14 = call swiftcc %swift.metadata_response @"$s4main11MemoryCacheC06PublicC4InfoVMa"(i64 255, ptr %13) #7
  %15 = extractvalue %swift.metadata_response %14, 0
  %16 = extractvalue %swift.metadata_response %14, 1
  %17 = call swiftcc %swift.metadata_response @"$sSqMa"(i64 0, ptr %15) #7
  %18 = extractvalue %swift.metadata_response %17, 0
  %19 = getelementptr inbounds ptr, ptr %18, i64 -1
  %20 = load ptr, ptr %19, align 8, !invariant.load !2, !dereferenceable !3
  %21 = getelementptr inbounds %swift.vwtable, ptr %20, i32 0, i32 8
  %22 = load i64, ptr %21, align 8, !invariant.load !2
  %23 = alloca i8, i64 %22, align 16
  call void @llvm.lifetime.start.p0(i64 -1, ptr %23)
  %24 = getelementptr inbounds ptr, ptr %15, i64 -1
  %25 = load ptr, ptr %24, align 8, !invariant.load !2, !dereferenceable !3
  %26 = getelementptr inbounds %swift.vwtable, ptr %25, i32 0, i32 8
  %27 = load i64, ptr %26, align 8, !invariant.load !2
  %28 = alloca i8, i64 %27, align 16
  call void @llvm.lifetime.start.p0(i64 -1, ptr %28)
  store ptr %28, ptr %5, align 8
  store ptr %0, ptr %6, align 8
  store ptr %2, ptr %7, align 8
  store ptr %0, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9)
  %29 = getelementptr inbounds %TSv, ptr %9, i32 0, i32 0
  store ptr %0, ptr %29, align 8
  %30 = getelementptr inbounds %T4main11MemoryCacheC5StateV, ptr %2, i32 0, i32 0
  %31 = call swiftcc %swift.metadata_response @"$sSDMa"(i64 0, ptr @"$sSvN", ptr %15, ptr @"$sSvSHsWP") #7
  %32 = extractvalue %swift.metadata_response %31, 0
  call swiftcc void @"$sSD11removeValue6forKeyq_Sgx_tF"(ptr noalias sret(%swift.opaque) %23, ptr noalias %9, ptr %32, ptr nocapture swiftself dereferenceable(8) %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9)
  %33 = getelementptr inbounds ptr, ptr %25, i32 6
  %34 = load ptr, ptr %33, align 8, !invariant.load !2
  %35 = call i32 %34(ptr noalias %23, i32 1, ptr %15) #8
  %36 = icmp ne i32 %35, 1
  br i1 %36, label %43, label %38

37:                                               ; No predecessors!
  unreachable

38:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10)
  %39 = getelementptr inbounds [1 x ptr], ptr %10, i32 0, i32 0
  store ptr %13, ptr %39, align 8
  %40 = call swiftcc %swift.metadata_response @"$s10Foundation9PredicateVMa"(i64 0, i64 1, ptr %10) #7
  %41 = extractvalue %swift.metadata_response %40, 0
  %42 = call ptr @"$s4main11MemoryCacheC06PublicC4InfoVyx_GSglWOh"(ptr %23, ptr %41, ptr %15, ptr %18)

43:                                               ; preds = %3

44:                                               ; No predecessors!
}
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<unknown>:0: note: Instruction resulted in on-stack pack metadata emission but no cleanup instructions were added
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file a.swift b.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -color-diagnostics -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift -module-name main -in-process-plugin-server-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-12-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.2 -target-sdk-name macosx15.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -o /var/folders/y0/5ch3_9cs0x1fyzdykz2tbz4w0000gn/T/TemporaryDirectory.jCBBgU/a-1.o
1.      Apple Swift version 6.1-dev (LLVM 08670c03fe16573, Swift 493744d5e4900b2)
2.      Compiling with effective version 5.10
3.      While evaluating request IRGenRequest(IR Generation for file "a.swift")
4.      While emitting IR SIL function "@$s4main11MemoryCacheC5StateV10unregisteryyAC06PublicC0Cyx_GF".
 for 'unregister(_:)' (at a.swift:12:18)
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           0x00000001063e7844 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x00000001063e5f70 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x00000001063e7e88 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x000000018436ede4 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000184337f70 pthread_kill + 288
5  libsystem_c.dylib        0x0000000184244908 abort + 128
6  swift-frontend           0x0000000101314f90 swift::DiagnosticHelper::create(swift::CompilerInstance&, llvm::raw_pwrite_stream&, bool) + 0
7  swift-frontend           0x00000001063657e8 llvm::report_fatal_error(llvm::Twine const&, bool) + 256
8  swift-frontend           0x00000001063656e8 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x00000001015e9cf4 (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 83804
10 swift-frontend           0x00000001015d4598 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 8852
11 swift-frontend           0x00000001015d1d64 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1812
12 swift-frontend           0x0000000101476918 swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 728
13 swift-frontend           0x0000000101586270 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2396
14 swift-frontend           0x00000001015d1280 swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 200
15 swift-frontend           0x000000010158da08 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 212
16 swift-frontend           0x00000001015880ac swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 208
17 swift-frontend           0x00000001010fc554 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 156
18 swift-frontend           0x00000001010f924c performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1372
19 swift-frontend           0x00000001010f86b4 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 468
20 swift-frontend           0x00000001011047c8 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
21 swift-frontend           0x00000001010fa3c4 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 716
22 swift-frontend           0x00000001010f9be0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2228
23 swift-frontend           0x0000000100edd568 swift::mainEntry(int, char const**) + 3064
24 dyld                     0x0000000183fb8274 start + 2840

See the similar crash with the latest main:

$ swiftc -v a.swift b.swift
Apple Swift version 6.2-dev (LLVM 162ee50b401fff2, Swift 57288d13c9f3c02)
Target: arm64-apple-macosx15.0
...

Swift 6.0.3 works fine:

$ swiftc -v -c a.swift b.swift 
Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file a.swift b.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -color-diagnostics -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 15.2 -target-sdk-name macosx15.2 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o a.o
a.swift:14:20: warning: value 'publicCacheInfo' was defined but never used; consider replacing with boolean test
12 |         mutating func unregister(_ publicCache: PublicCache) {
13 |             let ptr = Unmanaged.passUnretained(publicCache).toOpaque()
14 |             if let publicCacheInfo = publicCaches.removeValue(forKey: ptr) {}
   |                    `- warning: value 'publicCacheInfo' was defined but never used; consider replacing with boolean test
15 |         }
16 |     }
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c a.swift -primary-file b.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -color-diagnostics -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 15.2 -target-sdk-name macosx15.2 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o b.o

Reproduction

First file:

import Foundation
import Synchronization

public final class MemoryCache<Object> {
    struct PublicCacheInfo {
        let predicate: Predicate<Object>
    }

    struct State {
        var publicCaches = [UnsafeMutableRawPointer: PublicCacheInfo]()

        mutating func unregister(_ publicCache: PublicCache) {
            let ptr = Unmanaged.passUnretained(publicCache).toOpaque()
            if let publicCacheInfo = publicCaches.removeValue(forKey: ptr) {}
        }
    }

    let state = Mutex<State>(State())
}

Second file:

extension MemoryCache {
    final class PublicCache {}
}

Stack dump

0  swift-frontend           0x0000000107d32128 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000107d30854 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000107d32770 SignalHandler(int, __siginfo*, void*) + 296
3  libsystem_platform.dylib 0x000000018436ede4 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000184337f70 pthread_kill + 288
5  libsystem_c.dylib        0x0000000184244908 abort + 128
6  swift-frontend           0x0000000102883c44 swift::DiagnosticHelper::create(swift::CompilerInstance&, swift::CompilerInvocation const&, llvm::ArrayRef<char const*>, llvm::raw_pwrite_stream&, bool) + 0
7  swift-frontend           0x0000000107cb00a0 llvm::report_fatal_error(llvm::Twine const&, bool) + 256
8  swift-frontend           0x0000000107caffa0 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x0000000102b65e90 (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 82700
10 swift-frontend           0x0000000102b50b44 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 8816
11 swift-frontend           0x0000000102b4e358 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1832
12 swift-frontend           0x00000001029ede6c swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 728
13 swift-frontend           0x0000000102b00818 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2384
14 swift-frontend           0x0000000102b4d4e4 swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 200
15 swift-frontend           0x0000000102b07ed4 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 212
16 swift-frontend           0x0000000102b026bc swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 208
17 swift-frontend           0x00000001026655d8 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 156
18 swift-frontend           0x000000010266221c performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1372
19 swift-frontend           0x0000000102661654 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 464
20 swift-frontend           0x000000010266dbdc withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
21 swift-frontend           0x00000001026633a8 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 716
22 swift-frontend           0x0000000102662bc4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2244
23 swift-frontend           0x000000010241e898 swift::mainEntry(int, char const**) + 3060
24 dyld                     0x0000000183fb8274 start + 2840

Expected behavior

No crash.

Environment

Apple Swift version 6.1-dev (LLVM 08670c03fe16573, Swift 493744d)
Target: arm64-apple-macosx15.0

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions