swiftwasm / swift

WebAssembly support for the Swift programming language
https://swiftwasm.org
1.3k stars 28 forks source link

Merge main 2023-04-06 #5372

Closed kateinoigakukun closed 1 year ago

kateinoigakukun commented 1 year ago

Hmm, I'll have a look this week

CMake Error at /home/build-user/llvm-project/libcxx/src/CMakeLists.txt:272 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:libcxx-abi-shared,IMPORTED_LIBNAME>

  Target "libcxx-abi-shared" not found.

CMake Error at /home/build-user/llvm-project/libcxx/src/CMakeLists.txt:272 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:libcxx-abi-shared,IMPORTED_LIBNAME>

  Target "libcxx-abi-shared" not found.
kateinoigakukun commented 1 year ago

I could reproduce the compiler crash on my side with debug info

 for 'min(_:_:_:_:)' (at /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/stdlib/public/core/Algorithm.swift:38:8)
 #0 0x00000000051478b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:13
 #1 0x0000000005145c80 llvm::sys::RunSignalHandlers() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/lib/Support/Signals.cpp:105:18
 #2 0x0000000005147c1f SignalHandler(int) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #3 0x00007f599eaec420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x0000000001386f0a (anonymous namespace)::LeafLoadableTypeLowering::LeafLoadableTypeLowering(swift::SILType, swift::Lowering::TypeLowering::RecursiveProperties, swift::Lowering::IsReferenceCounted_t, swift::TypeExpansionContext) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Allocator.h:0:0
 #5 0x0000000001386f0a (anonymous namespace)::ReferenceTypeLowering::ReferenceTypeLowering(swift::SILType, swift::Lowering::TypeLowering::RecursiveProperties, swift::TypeExpansionContext) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SIL/IR/TypeLowering.cpp:1707:11
 #6 0x0000000001386f0a (anonymous namespace)::LowerType::handleReference(swift::CanType, swift::Lowering::TypeLowering::RecursiveProperties) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SIL/IR/TypeLowering.cpp:2135:23
 #7 0x000000000137f28d swift::CanTypeVisitor<(anonymous namespace)::LowerType, swift::Lowering::TypeLowering*, swift::Lowering::AbstractionPattern, swift::Lowering::IsTypeExpansionSensitive_t>::visit(swift::CanType, swift::Lowering::AbstractionPattern, swift::Lowering::IsTypeExpansionSensitive_t) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/TypeNodes.def:0:0
 #8 0x000000000137f28d (anonymous namespace)::TypeClassifierBase<(anonymous namespace)::LowerType, swift::Lowering::TypeLowering*>::visit(swift::CanType, swift::Lowering::AbstractionPattern, swift::Lowering::IsTypeExpansionSensitive_t) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SIL/IR/TypeLowering.cpp:296:21
 #9 0x000000000137f510 swift::Lowering::TypeConverter::getTypeLoweringForLoweredType(swift::Lowering::AbstractionPattern, swift::CanType, swift::TypeExpansionContext, swift::Lowering::IsTypeExpansionSensitive_t) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SIL/IR/TypeLowering.cpp:3171:19
#10 0x000000000137f7ba swift::Lowering::TypeConverter::getTypeLowering(swift::SILType, swift::TypeExpansionContext, swift::CanGenericSignature) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SIL/IR/TypeLowering.cpp:3122:10
#11 0x0000000000573109 swift::SILBuilder::getTypeLowering(swift::SILType) const (/home/katei/ghq/work.katei.dev/swiftwasm-source/host-build/Ninja-RelWithDebInfo/swift-linux-x86_64/bootstrapping1/bin/swift-frontend+0x573109)
#12 0x0000000000573059 swift::SILBuilder::isLoadableOrOpaque(swift::SILType) (/home/katei/ghq/work.katei.dev/swiftwasm-source/host-build/Ninja-RelWithDebInfo/swift-linux-x86_64/bootstrapping1/bin/swift-frontend+0x573059)
#13 0x0000000000572ed0 swift::SILBuilder::createDestroyValue(swift::SILLocation, swift::SILValue, bool) (/home/katei/ghq/work.katei.dev/swiftwasm-source/host-build/Ninja-RelWithDebInfo/swift-linux-x86_64/bootstrapping1/bin/swift-frontend+0x572ed0)
#14 0x0000000000c015a9 swift::SILBuilder::emitDestroyValueOperation(swift::SILLocation, swift::SILValue) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/SIL/SILBuilder.h:2700:3
#15 0x0000000000c013f3 swift::Lowering::SILGenFunction::destroyLocalVariable(swift::SILLocation, swift::VarDecl*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGenDecl.cpp:2192:1
#16 0x0000000000c8c44f llvm::optional_detail::OptionalStorage<swift::DiverseValueBuffer<swift::Lowering::Cleanup>, false>::reset() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/Optional.h:88:9
#17 0x0000000000c8c44f llvm::optional_detail::OptionalStorage<swift::DiverseValueBuffer<swift::Lowering::Cleanup>, false>::~OptionalStorage() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/Optional.h:68:24
#18 0x0000000000c8c44f llvm::Optional<swift::DiverseValueBuffer<swift::Lowering::Cleanup> >::~Optional() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/clang/include/clang/Basic/LLVM.h:40:30
#19 0x0000000000c8c44f swift::Lowering::CleanupManager::emitCleanups(swift::DiverseStackBase::stable_iterator, swift::CleanupLocation, swift::Lowering::ForUnwind_t, bool) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/Cleanup.cpp:137:3
#20 0x0000000000c98372 swift::Lowering::Scope::popImpl() /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/Scope.cpp:135:7
#21 0x0000000000c7e4a6 (anonymous namespace)::StmtEmitter::visitForEachStmt(swift::ForEachStmt*) (/home/katei/ghq/work.katei.dev/swiftwasm-source/host-build/Ninja-RelWithDebInfo/swift-linux-x86_64/bootstrapping1/bin/swift-frontend+0xc7e4a6)
#22 0x0000000000c79d6a swift::Stmt::getKind() const /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/Stmt.h:118:56
#23 0x0000000000c79d6a swift::ReturnStmt::classof(swift::Stmt const*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/Stmt.h:247:50
#24 0x0000000000c79d6a llvm::isa_impl<swift::ReturnStmt, swift::Stmt, void>::doit(swift::Stmt const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:64:53
#25 0x0000000000c79d6a llvm::isa_impl_cl<swift::ReturnStmt, swift::Stmt const*>::doit(swift::Stmt const*) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:110:12
#26 0x0000000000c79d6a llvm::isa_impl_wrap<swift::ReturnStmt, swift::Stmt const*, swift::Stmt const*>::doit(swift::Stmt const* const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:137:12
#27 0x0000000000c79d6a llvm::isa_impl_wrap<swift::ReturnStmt, swift::Stmt const* const, swift::Stmt const*>::doit(swift::Stmt const* const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:127:12
#28 0x0000000000c79d6a llvm::CastIsPossible<swift::ReturnStmt, swift::Stmt const*, void>::isPossible(swift::Stmt const* const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:255:12
#29 0x0000000000c79d6a llvm::CastInfo<swift::ReturnStmt, swift::Stmt* const, void>::isPossible(swift::Stmt* const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:510:12
#30 0x0000000000c79d6a bool llvm::isa<swift::ReturnStmt, swift::Stmt*>(swift::Stmt* const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Casting.h:549:10
#31 0x0000000000c79d6a (anonymous namespace)::StmtEmitter::visitBraceStmt(swift::BraceStmt*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGenStmt.cpp:413:11
#32 0x0000000000c79d6a swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/StmtNodes.def:47:1
#33 0x0000000000c78aed swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGenStmt.cpp:208:1
#34 0x0000000000c34796 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGenFunction.cpp:0:5
#35 0x0000000000bd2cbb swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:0:0
#36 0x0000000000bd40c3 emitOrDelayFunction(swift::Lowering::SILGenModule&, swift::SILDeclRef) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:0:0
#37 0x0000000000bd12ea swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:1438:5
#38 0x0000000000bd69b0 swift::Lowering::SILGenModule::visit(swift::Decl*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:0:15
#39 0x0000000000bd69b0 (anonymous namespace)::SILGenModuleRAII::emitSourceFile(swift::SourceFile*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:2206:11
#40 0x0000000000bd69b0 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:2306:13
#41 0x0000000000c785b8 llvm::optional_detail::OptionalStorage<llvm::SmallVector<swift::SILDeclRef, 1u>, false>::reset() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/Optional.h:88:9
#42 0x0000000000c785b8 llvm::optional_detail::OptionalStorage<llvm::SmallVector<swift::SILDeclRef, 1u>, false>::~OptionalStorage() /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/Optional.h:68:24
#43 0x0000000000c785b8 llvm::Optional<llvm::SmallVector<swift::SILDeclRef, 1u> >::~Optional() /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/Basic/LLVM.h:65:30
#44 0x0000000000c785b8 swift::ASTLoweringDescriptor::~ASTLoweringDescriptor() /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/SILGenRequests.h:47:8
#45 0x0000000000c785b8 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > swift::SimpleRequest<swift::ASTLoweringRequest, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::callDerived<0ul>(swift::Evaluator&, std::integer_sequence<unsigned long, 0ul>) const /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/SimpleRequest.h:267:5
#46 0x0000000000c784c9 swift::SimpleRequest<swift::ASTLoweringRequest, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/SimpleRequest.h:290:5
#47 0x0000000000bd9e1a llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/include/swift/AST/Evaluator.h:388:14
#48 0x0000000000bd79a4 std::__uniq_ptr_impl<swift::SILModule, std::default_delete<swift::SILModule> >::_M_ptr() const /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:154:42
#49 0x0000000000bd79a4 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::get() const /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:361:21
#50 0x0000000000bd79a4 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::release() /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:383:16
#51 0x0000000000bd79a4 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::unique_ptr(std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >&&) /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:258:18
#52 0x0000000000bd79a4 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > llvm::cantFail<std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > >(llvm::Expected<std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> > >, char const*) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/Support/Error.h:775:12
#53 0x0000000000bd79a4 swift::performASTLowering(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/SILGen/SILGen.cpp:2329:10
#54 0x000000000062adb2 std::__uniq_ptr_impl<swift::SILModule, std::default_delete<swift::SILModule> >::_M_ptr() const /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:154:42
#55 0x000000000062adb2 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::get() const /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:361:21
#56 0x000000000062adb2 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::release() /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:383:16
#57 0x000000000062adb2 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >::unique_ptr(std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >&&) /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:258:18
#58 0x000000000062adb2 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:836:52
#59 0x000000000062deb7 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_26::operator()(swift::CompilerInstance&) const /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:0:18
#60 0x000000000062deb7 bool llvm::function_ref<bool (swift::CompilerInstance&)>::callback_fn<performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_26>(long, swift::CompilerInstance&) /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#61 0x000000000062deb7 llvm::function_ref<bool (swift::CompilerInstance&)>::operator()(swift::CompilerInstance&) const /home/katei/ghq/work.katei.dev/swiftwasm-source/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#62 0x000000000062deb7 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:1244:10
#63 0x000000000062deb7 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:1371:12
#64 0x000000000062deb7 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:1412:19
#65 0x000000000062ca72 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/FrontendTool/FrontendTool.cpp:2313:46
#66 0x000000000044f450 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>, llvm::ArrayRef<char const*>) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/DriverTool/driver.cpp:0:0
#67 0x000000000044f450 swift::mainEntry(int, char const**) /home/katei/ghq/work.katei.dev/swiftwasm-source/swift/lib/DriverTool/driver.cpp:418:10
#68 0x00007f599de61083 __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:342:3
#69 0x000000000044e6ae _start (/home/katei/ghq/work.katei.dev/swiftwasm-source/host-build/Ninja-RelWithDebInfo/swift-linux-x86_64/bootstrapping1/bin/swift-frontend+0x44e6ae)
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal 11 (use -v to see invocation)