swiftlang / swift

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

[Source compatibility suite] swift-distributed-actors assertion failure after rebranch merge #69411

Open justice-adams-apple opened 10 months ago

justice-adams-apple commented 10 months ago

Description The swift-distributed-actors project is failing to build after the rebranch merge https://github.com/apple/swift/pull/69163

Assertion failed: (isa<X>(Val) && "cast_if_present<Ty>() argument of incompatible type!"), function cast_if_present, file Casting.h, line 707.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.  While splitting coroutine @"$s18DistributedCluster0B13SingletonBossC8activate33_CB5C22BA6D7DBA0CECB3DE4B4A793241LLyxxAA0B6SystemCYaKXEYaKF"
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):
Rename failed: /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/Props+Metrics.swift-cf4a8afe.o.tmp -> /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/Props+Metrics.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/Props+Metrics.swift.o' for output: /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/Props+Metrics.swift-cf4a8afe.o.tmp => /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/Props+Metrics.swift.o: No such file or directory
0  swift-frontend           0x0000000109c471e7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x0000000109c45368 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x0000000109c47890 SignalHandler(int) + 288
3  libsystem_platform.dylib 0x00007ff8086b0dfd _sigtramp + 29
4  swift-frontend           0x0000000109bcc1b0 llvm::performOptimizedStructLayout(llvm::MutableArrayRef<llvm::OptimizedStructLayoutField>)::$_0::__invoke(llvm::OptimizedStructLayoutField const*, llvm::OptimizedStructLayoutField const*) + 0
5  libsystem_c.dylib        0x00007ff8085e6d24 abort + 123
6  libsystem_c.dylib        0x00007ff8085e60cb err + 0
7  swift-frontend           0x000000010b7288e3 llvm::FindDbgDeclareUses(llvm::Value*) (.cold.2) + 35
8  swift-frontend           0x0000000109854596 llvm::FindDbgDeclareUses(llvm::Value*) + 246
9  swift-frontend           0x0000000106ea79f5 llvm::coro::buildCoroutineFrame(llvm::Function&, llvm::coro::Shape&, std::__1::function<bool (llvm::Instruction&)> const&) + 38581
10 swift-frontend           0x0000000106eb88e9 splitCoroutine(llvm::Function&, llvm::SmallVectorImpl<llvm::Function*>&, llvm::TargetTransformInfo&, bool, std::__1::function<bool (llvm::Instruction&)>) + 265
11 swift-frontend           0x0000000106eb7a3f llvm::CoroSplitPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 2095
12 swift-frontend           0x0000000106e1ece2 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CoroSplitPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 18
13 swift-frontend           0x000000010923dd7e llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 446
14 swift-frontend           0x0000000106e12272 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 18
15 swift-frontend           0x000000010924041d llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 429
16 swift-frontend           0x0000000106e368c2 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) + 18
17 swift-frontend           0x000000010923f214 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 3172
Rename failed: /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/ClusterSystemSettings+Plugins.swift-34f807bc.o.tmp -> /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/ClusterSystemSettings+Plugins.swift.o: No such file or directory
<unknown>:0: error: error closing '/Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/ClusterSystemSettings+Plugins.swift.o' for output: /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/ClusterSystemSettings+Plugins.swift-34f807bc.o.tmp => /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/swift-distributed-actors/.build/x86_64-apple-macosx/release/DistributedCluster.build/ClusterSystemSettings+Plugins.swift.o: No such file or directory
18 swift-frontend           0x0000000106e12492 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 18
19 swift-frontend           0x0000000109930f55 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 357
20 swift-frontend           0x0000000106fc5701 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 577
21 swift-frontend           0x0000000106e18e52 llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 18
22 swift-frontend           0x0000000109930f55 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 357
23 swift-frontend           0x00000001040a213f swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*, llvm::raw_pwrite_stream*) + 5951
24 swift-frontend           0x00000001040a2c74 swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, llvm::vfs::OutputBackend&, swift::UnifiedStatsReporter*) + 996
25 swift-frontend           0x00000001040ad897 (anonymous namespace)::LLVMCodeGenThreads::Thread::run() + 503
26 swift-frontend           0x00000001040ad699 (anonymous namespace)::LLVMCodeGenThreads::runThread(void*) + 9
27 libsystem_pthread.dylib  0x00007ff80869b4e1 _pthread_start + 125
28 libsystem_pthread.dylib  0x00007ff808696f6b thread_start + 15

Steps to reproduce To reproduce the issue, you can use the source compatibility suite and run

./runner.py --swift-branch main --projects projects.json --include-actions 'action.startswith("Build")' --include-repos 'path == "swift-distributed-actors"' --swiftc <PATH_TO_MAIN_COMPILER>

Expected behavior The project should build fine

Environment

'Apple Swift version 5.11-dev (LLVM bc209195a648bf2, Swift 8381f01e9ea5e37)'

https://ci.swift.org/job/swift-main-source-compat-suite/585

ktoso commented 4 months ago

Tracking with rdar://127182162