Open antonvmironov opened 2 years ago
On main
you get:
Assertion failed: (data.InnerResults.empty()), function plan, file SILGenPoly.cpp, line 1951.
I have a program that crashes in a similar way and I'm not sure if it's the same bug.
struct SackOfCallbacks {
var callbacks = [() async throws -> Void]()
}
var sack = SackOfCallbacks()
sack.callbacks.append {}
Crash log:
% swiftc -v crash.swift
Apple Swift version 5.7.1 (swiftlang-5.7.1.134.3 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file crash.swift -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -color-diagnostics -new-driver-path /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name crash -disable-clang-spi -target-sdk-version 13.0 -o /var/folders/v6/2_xws2vj4lz6zjtj7xtjh3_80000gn/T/TemporaryDirectory.iwGmul/crash-1.o
error: compile command failed due to signal 6 (use -v to see invocation)
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: SmallVector unable to grow. Requested capacity (4294967297) is larger than maximum value for size type (4294967295)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file crash.swift -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -color-diagnostics -new-driver-path /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name crash -disable-clang-spi -target-sdk-version 13.0 -o /var/folders/v6/2_xws2vj4lz6zjtj7xtjh3_80000gn/T/TemporaryDirectory.iwGmul/crash-1.o
1. Apple Swift version 5.7.1 (swiftlang-5.7.1.134.3 clang-1400.0.29.51)
2. Compiling with the current language version
3. While evaluating request IRGenRequest(IR Generation for file "crash.swift")
4. While emitting IR SIL function "@$sytIegHr_yts5Error_pIegHrzo_TR".
for <<debugloc at "<compiler-generated>":0:0>>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 0x0000000104fe3630 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x0000000104fe2634 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x0000000104fe3cb4 SignalHandler(int) + 344
3 libsystem_platform.dylib 0x0000000197cf02a4 _sigtramp + 56
4 libsystem_pthread.dylib 0x0000000197cc1cec pthread_kill + 288
5 libsystem_c.dylib 0x0000000197bfb2c8 abort + 180
6 swift-frontend 0x0000000100638bc8 PrettyStackTraceFrontend::~PrettyStackTraceFrontend() + 0
7 swift-frontend 0x0000000104f42548 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8 swift-frontend 0x0000000104f8e840 report_at_maximum_capacity(unsigned long) + 0
9 swift-frontend 0x0000000104f8e694 llvm::SmallVectorBase<unsigned int>::grow_pod(void*, unsigned long, unsigned long) + 228
10 swift-frontend 0x00000001008b2704 (anonymous namespace)::AsyncCallEmission::setArgs(swift::irgen::Explosion&, bool, swift::irgen::WitnessMetadata*) + 468
11 swift-frontend 0x0000000100a54938 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 4032
12 swift-frontend 0x0000000100a33f70 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 7860
13 swift-frontend 0x00000001009019a8 swift::irgen::IRGenerator::emitLazyDefinitions() + 1156
14 swift-frontend 0x0000000100a01fac swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 3024
15 swift-frontend 0x0000000100a31df0 swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 188
16 swift-frontend 0x0000000100a0e2cc llvm::Expected<swift::IRGenRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenRequest>(swift::IRGenRequest const&) + 744
17 swift-frontend 0x0000000100a051c0 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**) + 236
18 swift-frontend 0x000000010062fa6c 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*) + 2160
19 swift-frontend 0x00000001006317f8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5932
20 swift-frontend 0x00000001005d22ec swift::mainEntry(int, char const**) + 3940
21 dyld 0x0000000197997e50 start + 2544
Describe the bug following test program crashes the compiler:
Crash:
Steps To Reproduce Steps to reproduce the behavior:
compiler_crash.swift
swiftc compiler_crash.swift
...Expected behavior The compiler should not crash.
Environment (please fill out the following information)
Additional context Add any other context about the problem here.