Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Crash With Nightly 5.7.20221229101 and 5.7.20221219101 #62797

Closed
Frizlab opened this issue Dec 31, 2022 · 1 comment
Closed

Compiler Crash With Nightly 5.7.20221229101 and 5.7.20221219101 #62797

Frizlab opened this issue Dec 31, 2022 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels

Comments

@Frizlab
Copy link

Frizlab commented Dec 31, 2022

Description
Compiling https://github.com/happn-app/CollectionLoader/tree/__SWIFT_5.7.20221229101_CRASHER__ crashes the compiler.

Steps to reproduce
Clone https://github.com/happn-app/CollectionLoader.git and checkout tag __SWIFT_5.7.20221229101_CRASHER__.
Try and compile the project with Swift nightly 5.7.20221229101 or 5.7.20221219101.

Expected behavior
The compilation should either pass or fail, but the compiler should not crash.

Environment

  • Swift compiler version info swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
  • Xcode version info Xcode 14.2 Build version 14C18
  • Deployment target: macOS, iOS, etc.

Additional context
The crash probably comes from the protocol inheritance of CollectionLoaderHelperProtocol to PageInfoRetrieverProtocol in Sources/CollectionLoader/Core/CollectionLoaderHelper-Protocol.swift.

This did not crash with Swift 5.7.2 prod (Xcode 14.2 prod).

Stack Trace
Begin Error in Function: '$s3BMO22LocalDbImportOperationC9startFrom33_7748B6F36DBB49B62D7FEE169ECE036BLL014finishedRemoteE08userInfo6bridgey13BridgeObjects_0pC00pE0QZ_04UserR0QzxtKF'
Error! Found a leak due to a consuming post-dominance failure!
Value:   %33 = copy_value %0 : $Bridge.BridgeObjects.RemoteDb.RemoteOperation // users: %125, %70, %38, %36
Post Dominating Failure Blocks:
 bb9
End Error in Function: '$s3BMO22LocalDbImportOperationC9startFrom33_7748B6F36DBB49B62D7FEE169ECE036BLL014finishedRemoteE08userInfo6bridgey13BridgeObjects_0pC00pE0QZ_04UserR0QzxtKF'
Found ownership error?!
triggering standard assertion failure routine
UNREACHABLE executed at /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/swift/lib/SIL/Verifier/LinearLifetimeCheckerPrivate.h:211!
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-DEVELOPMENT-SNAPSHOT-2022-12-29-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/Bridge-Protocol.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/BridgeObjects-Protocol.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/LocalDb-Protocol.swift -primary-file /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/LocalDbImportOperation.swift -primary-file /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/LocalDbImporter-Protocol.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/RemoteDb-Protocol.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/Request.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/RequestHelper-Protocol.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/RequestOperation.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/RequestResult.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Errors/ErrorCollection.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Errors/OperationLifecycleError.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Errors/RequestError.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Helpers/GenericLocalDbObject.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Helpers/LocalDbChanges.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Helpers/RelationshipMergeType.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Utilities/Private/MapError.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Utilities/Private/Result+Utils.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Utilities/Public/DummyRequestHelper.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Utilities/Public/RequestHelperCollection.swift /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Utilities/Public/RequestHelperCollectionForOldRuntimes.swift -emit-dependencies-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImportOperation.d -emit-reference-dependencies-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImportOperation.swiftdeps -serialize-diagnostics-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImportOperation.dia -emit-dependencies-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImporter-Protocol.d -emit-reference-dependencies-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImporter-Protocol.swiftdeps -serialize-diagnostics-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImporter-Protocol.dia -target arm64-apple-macos10.13 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -I /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Products/Debug -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Products/Debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -enable-testing -g -module-cache-path /Users/frizlab/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-29-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/swift-overrides.hmap -Xcc -I/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Products/Debug/include -Xcc -I/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/DerivedSources-normal/arm64 -Xcc -I/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/DerivedSources/arm64 -Xcc -I/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -Xcc -working-directory/Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO -module-name BMO -frontend-parseable-output -disable-clang-spi -target-sdk-version 13.1 -o /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImportOperation.o -o /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Build/Intermediates.noindex/BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImporter-Protocol.o -index-unit-output-path /BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImportOperation.o -index-unit-output-path /BMO.build/Debug/BMO.build/Objects-normal/arm64/LocalDbImporter-Protocol.o -index-store-path /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/Index.noindex/DataStore -index-system-modules
1.	Apple Swift version 5.8-dev (LLVM ab856b0fa3177ee, Swift 71c62c04ace2b5b)
2.	Compiling with the current language version
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for BMO)
4.	While running pass #1434 SILModuleTransform "MandatoryInlining".
5.	While verifying SIL function "@$s3BMO22LocalDbImportOperationC9startFrom33_7748B6F36DBB49B62D7FEE169ECE036BLL014finishedRemoteE08userInfo6bridgey13BridgeObjects_0pC00pE0QZ_04UserR0QzxtKF".
 for 'startFrom(finishedRemoteOperation:userInfo:bridge:)' (at /Users/frizlab/Library/Developer/Xcode/DerivedData/CollectionLoader-hhobuysdhsdgfycmwhngmlpnzjvc/SourcePackages/checkouts/BMO/Sources/BMO/Core/LocalDbImportOperation.swift:135:2)
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           0x00000001071c69a4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x00000001071c5c28 llvm::sys::RunSignalHandlers() + 128
2  swift-frontend           0x00000001071c6fe4 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000182bc72a4 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000182b98cec pthread_kill + 288
5  libsystem_c.dylib        0x0000000182ad22c8 abort + 180
6  swift-frontend           0x000000010712a158 llvm::install_out_of_memory_new_handler() + 0
7  swift-frontend           0x000000010359aea8 swift::LinearLifetimeChecker::ErrorBuilder::tryDumpErrorCounter() const + 0
8  swift-frontend           0x000000010359300c swift::LinearLifetimeChecker::ErrorBuilder::handleLeak(llvm::function_ref<void ()>&&) + 584
9  swift-frontend           0x0000000103590944 swift::LinearLifetimeChecker::checkValueImpl(swift::SILValue, llvm::ArrayRef<swift::Operand*>, llvm::ArrayRef<swift::Operand*>, swift::LinearLifetimeChecker::ErrorBuilder&, llvm::Optional<llvm::function_ref<void (swift::SILBasicBlock*)> >, llvm::Optional<llvm::function_ref<void (swift::Operand*)> >) + 4048
10 swift-frontend           0x0000000103591068 swift::LinearLifetimeChecker::checkValue(swift::SILValue, llvm::ArrayRef<swift::Operand*>, llvm::ArrayRef<swift::Operand*>, swift::LinearLifetimeChecker::ErrorBuilder&) + 44
11 swift-frontend           0x0000000103598bbc swift::SILValueOwnershipChecker::check() + 572
12 swift-frontend           0x000000010359a988 verifySILValueHelper(swift::SILFunction const*, swift::SILValue, swift::LinearLifetimeChecker::ErrorBuilder&, swift::DeadEndBlocks*, swift::GuaranteedPhiVerifier&) + 148
13 swift-frontend           0x000000010359a864 swift::SILValue::verifyOwnership(swift::DeadEndBlocks*) const + 196
14 swift-frontend           0x00000001035b7e5c (anonymous namespace)::SILVerifier::checkValueBaseOwnership(swift::ValueBase*) + 164
15 swift-frontend           0x00000001035ba1b4 (anonymous namespace)::SILVerifier::visitSILInstruction(swift::SILInstruction*) + 5188
16 swift-frontend           0x00000001035a76c4 swift::SILInstructionVisitor<(anonymous namespace)::SILVerifier, void>::visit(swift::SILInstruction*) + 14184
17 swift-frontend           0x00000001035a3ae0 (anonymous namespace)::SILVerifier::visitSILBasicBlock(swift::SILBasicBlock*) + 1380
18 swift-frontend           0x00000001035a24ac (anonymous namespace)::SILVerifier::visitSILFunction(swift::SILFunction*) + 8748
19 swift-frontend           0x000000010359f0fc swift::SILModule::verify() const + 216
20 swift-frontend           0x000000010342ebac swift::SerializedSILLoader::SerializedSILLoader(swift::ASTContext&, swift::SILModule*, swift::DeserializationNotificationHandlerSet*) + 240
21 swift-frontend           0x00000001034d19fc swift::SILModule::getSILLoader() + 104
22 swift-frontend           0x00000001034d6500 swift::SILModule::loadFunction(swift::SILFunction*, swift::SILModule::LinkingMode) + 56
23 swift-frontend           0x000000010304a40c runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*, void> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*, void> >&) + 2368
24 swift-frontend           0x0000000103049904 (anonymous namespace)::MandatoryInlining::run() + 392
25 swift-frontend           0x00000001030accf4 swift::SILPassManager::runModulePass(unsigned int) + 984
26 swift-frontend           0x00000001030b2a10 swift::SILPassManager::execute() + 624
27 swift-frontend           0x00000001030a9d58 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 68
28 swift-frontend           0x00000001030a9ce0 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 68
29 swift-frontend           0x00000001030cd034 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 28
30 swift-frontend           0x00000001030b5d3c llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 252
31 swift-frontend           0x00000001030a9f54 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 84
32 swift-frontend           0x00000001030b9b20 swift::runSILDiagnosticPasses(swift::SILModule&) + 92
33 swift-frontend           0x0000000102a6de54 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 68
34 swift-frontend           0x0000000102907fa4 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*) + 716
35 swift-frontend           0x0000000102907734 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 576
36 swift-frontend           0x0000000102916404 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
37 swift-frontend           0x0000000102909424 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3204
38 swift-frontend           0x00000001027759fc swift::mainEntry(int, char const**) + 3304
39 dyld                     0x000000018286fe50 start + 2544
@Frizlab Frizlab added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Dec 31, 2022
@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler itself compiler crash crash Bug: A crash, i.e., an abnormal termination of software labels Jan 8, 2023
@Frizlab
Copy link
Author

Frizlab commented Apr 22, 2024

This does not crash anymore using swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)

@Frizlab Frizlab closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

2 participants