Skip to content

Swift 6.2. Error! Found a leaked owned value that was never consumed. #85697

@bioche

Description

@bioche

Description

When building in release mode on XCode 26.1, I encounter a crash. Maybe a duplicate of #84552 as it seems to start with the same error :

Cache miss
Begin Error in Function: '$sSci19GSMODPairingIoTViewE5first7ElementQzSgvg'
Error! Found a leaked owned value that was never consumed.
Value: %16 = argument of bb3 : $any Error

End Error in Function: '$sSci19GSMODPairingIoTViewE5first7ElementQzSgvg'
Found ownership error?!

Reproduction

Building on release mode a swift package included in an iOS project. This is a big project and I can't really pinpoint the precise code causing this.

Stack dump

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           0x000000010942deb4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x000000010942b844 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x000000010942e4e0 SignalHandler(int, __siginfo*, void*) + 344
3  libsystem_platform.dylib 0x00000001910a96a4 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019106f88c pthread_kill + 296
5  libsystem_c.dylib        0x0000000190f78a3c abort + 124
6  swift-frontend           0x0000000103446ea4 swift::DiagnosticHelper::~DiagnosticHelper() + 0
7  swift-frontend           0x000000010939c1ac llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8  swift-frontend           0x000000010939c094 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x0000000103abdb38 swift::LinearLifetimeChecker::ErrorBuilder::handleError(llvm::function_ref<void ()>&&, bool) const + 684
10 swift-frontend           0x0000000103acb244 verifySILValueHelper(swift::SILFunction const*, swift::SILValue, swift::LinearLifetimeChecker::ErrorBuilder&, swift::DeadEndBlocks*, swift::GuaranteedPhiVerifier&) + 6076
11 swift-frontend           0x0000000103acb708 swift::SILFunction::verifyOwnership(swift::DeadEndBlocks*) const + 668
12 swift-frontend           0x000000010404ac60 (anonymous namespace)::CopyPropagation::run() + 9032
13 swift-frontend           0x0000000103fb7ca4 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 3556
14 swift-frontend           0x0000000103fb3cc4 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 11988
15 swift-frontend           0x0000000103fd6b28 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 52
16 swift-frontend           0x0000000103fba8e4 swift::ExecuteSILPipelineRequest::OutputType swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()>(swift::ExecuteSILPipelineRequest const&, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()) + 412
17 swift-frontend           0x0000000103fbd410 swift::runSILOptimizationPasses(swift::SILModule&) + 448
18 swift-frontend           0x0000000103463698 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 1148
19 swift-frontend           0x0000000103067f18 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*) + 1360
20 swift-frontend           0x0000000103067874 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 2680
21 swift-frontend           0x000000010306a534 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764
22 swift-frontend           0x0000000103069144 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3580
23 swift-frontend           0x0000000102fea724 swift::mainEntry(int, char const**) + 5412
24 dyld                     0x0000000190cceb98 start + 6076

Expected behavior

Code compiles without crashing

Environment

Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Compiling with effective version 5.10

Additional information

I attach the full output with all arguments in this file : xcode_26_1_crash_release_mode.txt

Metadata

Metadata

Assignees

No one assigned

    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