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

clang-13: clang frontend command failed with exit code 139 building libdispatch-5.8 #62584

Closed
jharvell opened this issue May 7, 2023 · 3 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:optimizations needs-reduction Large reproducer that should be reduced into a simpler form worksforme Resolved as "works for me"

Comments

@jharvell
Copy link

jharvell commented May 7, 2023

Stack dump:
0.      Program arguments: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DBlocksRuntime_EXPORTS -DDISPATCH_USE_DTRACE=0 -DHAVE_CONFIG_H -D_GNU_SOURCE=1 -I/var/tmp/portage/dev-libs/libdispatch-5.8/work/swift-cor
elibs-libdispatch-swift-5.8-RELEASE/src/BlocksRuntime -O3 -DNDEBUG -pipe -march=native -ggdb -ftree-vectorize -fPIC -fvisibility=hidden -Wall -Wextra -Warray-bounds-pointer-arithmetic -Wassign-enum -Watomic-prope
rties -Wcomma -Wconditional-uninitialized -Wconversion -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdocumentation -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parent
heses -Winfinite-recursion -Wmissing-prototypes -Wnewline-eof -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wshadow -Wshorten-64-to-32 -Wsign-conversi
on -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch -Wunguarded-availability -Wunreachable-code -Wunused -Wno-unknown-warning-option -Wno-trigraphs -Wno-four-char-constants -Wno-disabled-macro-expansion 
-Wno-pedantic -Wno-bad-function-cast -Wno-c++-compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-dec
larations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-void-pointer-to-int-cast -
Wno-vla -Wno-error=assign-enum -std=gnu11 -MD -MT src/BlocksRuntime/CMakeFiles/BlocksRuntime.dir/runtime.c.o -MF src/BlocksRuntime/CMakeFiles/BlocksRuntime.dir/runtime.c.o.d -o src/BlocksRuntime/CMakeFiles/Blocks
Runtime.dir/runtime.c.o -c /var/tmp/portage/dev-libs/libdispatch-5.8/work/swift-corelibs-libdispatch-swift-5.8-RELEASE/src/BlocksRuntime/runtime.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007f138479478f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/Unix/Signals.inc:565:22
 #1 0x00007f138479478f PrintStackTraceSignalHandler /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/Unix/Signals.inc:631:23
 #2 0x00007f138477d64c llvm::sys::RunSignalHandlers() /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/Signals.cpp:97:20
 #3 0x00007f138477d64c llvm::sys::CleanupOnSignal(unsigned long) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/Unix/Signals.inc:361:31
 #4 0x00007f13846dd4d8 HandleCrash /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/CrashRecoveryContext.cpp:76:0
 #5 0x00007f13846dd4d8 CrashRecoverySignalHandler /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/CrashRecoveryContext.cpp:389:0
 #6 0x00007f138386ea10 (/lib64/libc.so.6+0x37a10)
 #7 0x00007f13852040be llvm::Use::removeFromList() /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Use.h:108:0
 #8 0x00007f13852040be llvm::Use::set(llvm::Value*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Value.h:861:0
 #9 0x00007f13852040be llvm::Use::operator=(llvm::Value*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Value.h:867:0
#10 0x00007f13852040be llvm::PHINode::setOperand(unsigned int, llvm::Value*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Instructions.h:2835:0
#11 0x00007f13852040be llvm::PHINode::setIncomingValue(unsigned int, llvm::Value*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Instructions.h:2700:15
#12 0x00007f13852040be llvm::PHINode::addIncoming(llvm::Value*, llvm::BasicBlock*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/Instructions.h:2752:21
#13 0x00007f13852040be RenamePass /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:920:27
#14 0x00007f13852064dc std::vector<llvm::DebugLoc, std::allocator<llvm::DebugLoc> >::~vector() /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/stl_vector.h:680:15
#15 0x00007f13852064dc ~RenamePassData /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:159:8
#16 0x00007f13852064dc run /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:664:3
#17 0x00007f13852085b9 llvm::DenseMap<llvm::BasicBlock const*, unsigned int, llvm::DenseMapInfo<llvm::BasicBlock const*>, llvm::detail::DenseMapPair<llvm::BasicBlock const*, unsigned int> >::~DenseMap() /var/tmp/
portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/DenseMap.h:755:50
#18 0x00007f13852085b9 ~PromoteMem2Reg /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:222:8
#19 0x00007f13852085b9 llvm::PromoteMemToReg(llvm::ArrayRef<llvm::AllocaInst*>, llvm::DominatorTree&, llvm::AssumptionCache*) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Utils/PromoteMemoryToR
egister.cpp:1019:3
#20 0x00007f1385562bd7 std::vector<llvm::AllocaInst*, std::allocator<llvm::AllocaInst*> >::clear() /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/stl_vector.h:1499:24
#21 0x00007f1385562bd7 llvm::SROA::promoteAllocas(llvm::Function&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Scalar/SROA.cpp:4748:26
#22 0x00007f1385562bd7 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Transforms/Scalar/SROA.cpp:4793:0
#23 0x00007f1386551d03 llvm::detail::PassModel<llvm::Function, llvm::SROA, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /var/tmp/p
ortage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#24 0x00007f138490137d llvm::SmallPtrSetImplBase::isSmall() const /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:194:0
#25 0x00007f138490137d llvm::SmallPtrSetImplBase::MoveFrom(unsigned int, llvm::SmallPtrSetImplBase&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/SmallPtrSet.cpp:184:0
#26 0x00007f138490137d llvm::SmallPtrSet<void*, 2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#27 0x00007f138490137d llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManager.h:155:0
#28 0x00007f138490137d llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManager.h:509:0
#29 0x00007f138616ee52 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#30 0x00007f1384901881 llvm::SmallPtrSetImplBase::isSmall() const /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:194:0
#31 0x00007f1384901881 llvm::SmallPtrSetImplBase::MoveFrom(unsigned int, llvm::SmallPtrSetImplBase&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/SmallPtrSet.cpp:184:0
#32 0x00007f1384901881 llvm::SmallPtrSet<void*, 2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#33 0x00007f1384901881 llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManager.h:155:0
#34 0x00007f1384901881 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/IR/PassManager.cpp:117:0
#35 0x00007f138616ee02 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#36 0x00007f1384900d5a llvm::SmallPtrSetImplBase::isSmall() const /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:194:0
#37 0x00007f1384900d5a llvm::SmallPtrSetImplBase::MoveFrom(unsigned int, llvm::SmallPtrSetImplBase&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/SmallPtrSet.cpp:184:0
#38 0x00007f1384900d5a llvm::SmallPtrSet<void*, 2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#39 0x00007f1384900d5a llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManager.h:155:0
#40 0x00007f1384900d5a llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/include/llvm/IR/PassManager.h:509:0
#41 0x00007f138a824caa llvm::SmallPtrSetImplBase::isSmall() const /usr/lib/llvm/13/include/llvm/ADT/SmallPtrSet.h:194:0
#42 0x00007f138a824caa llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /usr/lib/llvm/13/include/llvm/ADT/SmallPtrSet.h:82:0
#43 0x00007f138a824caa llvm::SmallPtrSetImpl<llvm::AnalysisKey*>::~SmallPtrSetImpl() /usr/lib/llvm/13/include/llvm/ADT/SmallPtrSet.h:343:0
#44 0x00007f138a824caa llvm::SmallPtrSet<llvm::AnalysisKey*, 2u>::~SmallPtrSet() /usr/lib/llvm/13/include/llvm/ADT/SmallPtrSet.h:449:0
#45 0x00007f138a824caa llvm::PreservedAnalyses::~PreservedAnalyses() /usr/lib/llvm/13/include/llvm/IR/PassManager.h:155:0
#46 0x00007f138a824caa (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (.constprop.0) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/CodeGen/BackendUtil.cpp:1494:0
#47 0x00007f1389891411 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/CodeGen/BackendUtil.cpp:1660:45
#48 0x00007f1389b6dd9d std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >::~unique_ptr() /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/unique_ptr.h:360:0
#49 0x00007f1389b6dd9d clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/CodeGen/CodeGenAction.cpp:334:0
#50 0x00007f1388ba0acd __gnu_cxx::__normal_iterator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >*, std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > > >::__normal_iterator(std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >* const&) /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/stl_iterator.h:1011:0
#51 0x00007f1388ba0acd std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > >::begin() /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/include/g++-v11/bits/stl_vector.h:812:0
#52 0x00007f1388ba0acd void clang::finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > > >(std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > >&, clang::Sema const&) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/include/clang/Sema/TemplateInstCallback.h:54:0
#53 0x00007f1388ba0acd clang::ParseAST(clang::Sema&, bool, bool) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Parse/ParseAST.cpp:178:0
#54 0x00007f138a192b59 clang::FrontendAction::Execute() /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Frontend/FrontendAction.cpp:951:21
#55 0x00007f138a135777 llvm::Error::getPtr() const /usr/lib/llvm/13/include/llvm/Support/Error.h:277:12
#56 0x00007f138a135777 llvm::Error::operator bool() /usr/lib/llvm/13/include/llvm/Support/Error.h:236:22
#57 0x00007f138a135777 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Frontend/CompilerInstance.cpp:974:42
#58 0x00007f138a1e076d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:0
#59 0x000055fc939827bc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/tools/driver/cc1_main.cpp:246:40
#60 0x000055fc93986e76 ExecuteCC1Tool /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/tools/driver/driver.cpp:343:34
#61 0x00007f1389e9e815 operator() /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Driver/Job.cpp:405:32
#62 0x00007f1389e9e815 callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::string*, bool*) const::<lambda()> > /usr/lib/llvm/13/include/llvm/ADT/STLExtras.h:177:52
#63 0x00007f13846be0d3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /var/tmp/portage/sys-devel/llvm-13.0.0/work/llvm/lib/Support/CrashRecoveryContext.cpp:427:1
#64 0x00007f1389ecd7d0 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Driver/Job.cpp:409:10
#65 0x00007f1389e8708c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Driver/Compilation.cpp:197:0
#66 0x00007f1389e874b9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Driver/Compilation.cpp:249:0
#67 0x00007f1389e8e331 llvm::SmallVectorBase<unsigned int>::empty() const /usr/lib/llvm/13/include/llvm/ADT/SmallVector.h:73:0
#68 0x00007f1389e8e331 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/lib/Driver/Driver.cpp:1556:0
#69 0x000055fc9397b7ae main /var/tmp/portage/sys-devel/clang-13.0.0/work/clang/tools/driver/driver.cpp:505:39
#70 0x00007f138385a9ca __libc_start_call_main /var/tmp/portage/sys-libs/glibc-2.37-r2/work/glibc-2.37/csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#71 0x00007f138385aa85 call_init /var/tmp/portage/sys-libs/glibc-2.37-r2/work/glibc-2.37/csu/../csu/libc-start.c:128:20
#72 0x00007f138385aa85 __libc_start_main /var/tmp/portage/sys-libs/glibc-2.37-r2/work/glibc-2.37/csu/../csu/libc-start.c:347:5
#73 0x000055fc9397cef1 _start (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x10ef1)
clang-13: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 13.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
clang-13: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /var/tmp/portage/dev-libs/libdispatch-5.8/temp/runtime-a67a3f.c
clang-13: note: diagnostic msg: /var/tmp/portage/dev-libs/libdispatch-5.8/temp/runtime-a67a3f.sh
clang-13: note: diagnostic msg: 

********************

sources.tar.gz

@EugeneZelenko EugeneZelenko added llvm:optimizations crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels May 7, 2023
@EugeneZelenko
Copy link
Contributor

Could you please try 16 or main branch?

@jharvell
Copy link
Author

jharvell commented May 7, 2023

Yes, I'm building 16 now.

@shafik shafik added the needs-reduction Large reproducer that should be reduced into a simpler form label May 7, 2023
@jharvell
Copy link
Author

jharvell commented May 7, 2023

I was able to build libdispatch fine with clang-16

@shafik shafik closed this as completed May 18, 2023
@EugeneZelenko EugeneZelenko added the worksforme Resolved as "works for me" label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:optimizations needs-reduction Large reproducer that should be reduced into a simpler form worksforme Resolved as "works for me"
Projects
None yet
Development

No branches or pull requests

3 participants