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

llvm/clang crash in cspgo build #97962

Closed
avikivity opened this issue Jul 7, 2024 · 21 comments · Fixed by #99064
Closed

llvm/clang crash in cspgo build #97962

avikivity opened this issue Jul 7, 2024 · 21 comments · Fixed by #99064
Labels
coroutines C++20 coroutines crash Prefer [crash-on-valid] or [crash-on-invalid] PGO Profile Guided Optimizations

Comments

@avikivity
Copy link
Contributor

FAILED: CMakeFiles/seastar.dir/src/rpc/rpc.cc.o 
/usr/lib64/ccache/clang++ -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_ATTR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=18 -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -I/home/avi/scylla-maint/seastar/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/src -I/home/avi/scylla-maint/seastar/src -O2 -g -DNDEBUG -std=gnu++23 -U_FORTIFY_SOURCE -Werror=unused-result "-Wno-error=#warnings" -UNDEBUG -Wall -Werror -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -fvisibility=hidden -gz -flto=thin -ffile-prefix-map=/home/avi/scylla-maint=. -march=westmere -Wno-backend-plugin -fprofile-use=/home/avi/scylla-maint/build/release-pgo/profiles/merged.profdata -fcs-profile-generate=/home/avi/scylla-maint/build/release-cs-pgo -mllvm -pgso=false -mllvm -enable-value-profiling=false -MD -MT CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -MF CMakeFiles/seastar.dir/src/rpc/rpc.cc.o.d -o CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -c /home/avi/scylla-maint/seastar/src/rpc/rpc.cc
*** stack smashing detected ***: terminated
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /usr/bin/clang++ -O2 -g -std=gnu++23 -Werror=unused-result -Wno-error=#warnings -Wall -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -fvisibility=hidden -gz -flto=thin -ffile-prefix-map=/home/avi/scylla-maint=. -march=westmere -Wno-backend-plugin -fprofile-use=/home/avi/scylla-maint/build/release-pgo/profiles/merged.profdata -fcs-profile-generate=/home/avi/scylla-maint/build/release-cs-pgo -mllvm -pgso=false -mllvm -enable-value-profiling=false -Werror -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_ATTR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=18 -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -I/home/avi/scylla-maint/seastar/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/src -I/home/avi/scylla-maint/seastar/src -DNDEBUG -U_FORTIFY_SOURCE -UNDEBUG -c -MD -MT CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -MF CMakeFiles/seastar.dir/src/rpc/rpc.cc.o.d -fcolor-diagnostics -o CMakeFiles/seastar.dir/src/rpc/rpc.cc.o /home/avi/scylla-maint/seastar/src/rpc/rpc.cc
1.	<eof> parser at end of file
2.	Optimizer
 #0 0x00007f9d0d8044fa llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.18.1+0x6044fa)
 #1 0x00007f9d0d801ce4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.18.1+0x601ce4)
 #2 0x00007f9d0d736004 (/lib64/libLLVM.so.18.1+0x536004)
 #3 0x00007f9d0cc4fd00 __restore_rt (/lib64/libc.so.6+0x40d00)
 #4 0x00007f9d0cca84a4 __pthread_kill_implementation (/lib64/libc.so.6+0x994a4)
 #5 0x00007f9d0cc4fc4e gsignal (/lib64/libc.so.6+0x40c4e)
 #6 0x00007f9d0cc37902 abort (/lib64/libc.so.6+0x28902)
 #7 0x00007f9d0cc38767 _IO_peekc_locked.cold (/lib64/libc.so.6+0x29767)
 #8 0x00007f9d0cd36769 (/lib64/libc.so.6+0x127769)
 #9 0x00007f9d0cd379e4 (/lib64/libc.so.6+0x1289e4)
#10 0x00007f9d0e7746a1 (/lib64/libLLVM.so.18.1+0x15746a1)
#11 0x00007f9d0e766f53 (/lib64/libLLVM.so.18.1+0x1566f53)
#12 0x00007f9d0e76545b llvm::PGOInstrumentationUse::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/lib64/libLLVM.so.18.1+0x156545b)
#13 0x00007f9d10ff4bf1 (/lib64/libLLVM.so.18.1+0x3df4bf1)
#14 0x00007f9d0d9c8e5d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/lib64/libLLVM.so.18.1+0x7c8e5d)
#15 0x00007f9d15c65092 (/lib64/libclang-cpp.so.18.1+0x1865092)
#16 0x00007f9d15c5c17e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/lib64/libclang-cpp.so.18.1+0x185c17e)
#17 0x00007f9d1605a2a0 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/lib64/libclang-cpp.so.18.1+0x1c5a2a0)
#18 0x00007f9d14974436 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.18.1+0x574436)
#19 0x00007f9d16c1c9f6 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.18.1+0x281c9f6)
#20 0x00007f9d16b94700 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.18.1+0x2794700)
#21 0x00007f9d16c99f65 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.18.1+0x2899f65)
#22 0x00000000004144c6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/cc1_main.cpp:294:15
#23 0x0000000000411164 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:365:12
#24 0x00007f9d167c5acd (/lib64/libclang-cpp.so.18.1+0x23c5acd)
#25 0x00007f9d0d735d44 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM.so.18.1+0x535d44)
#26 0x00007f9d167c5537 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/lib64/libclang-cpp.so.18.1+0x23c5537)
#27 0x00007f9d1678b297 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.18.1+0x238b297)
#28 0x00007f9d1678b4f7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/lib64/libclang-cpp.so.18.1+0x238b4f7)
#29 0x00007f9d167a995e clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/lib64/libclang-cpp.so.18.1+0x23a995e)
#30 0x00000000004109bf clang_main(int, char**, llvm::ToolContext const&) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:540:21
#31 0x000000000041dcca main tools/driver/clang-driver.cpp:17:10
#32 0x00007f9d0cc39088 __libc_start_call_main (/lib64/libc.so.6+0x2a088)
#33 0x00007f9d0cc3914b __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14b)
#34 0x000000000040d8a5 _start (/usr/bin/clang+++0x40d8a5)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 18.1.6 (Fedora 18.1.6-3.fc40)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang++.cfg
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/rpc-195796.cpp
clang++: note: diagnostic msg: /tmp/rpc-195796.sh
clang++: note: diagnostic msg: 

********************
[89/90] Building CXX object CMakeFiles/seastar.dir/src/core/reactor.cc.o
ninja: build stopped: subcommand failed.
@github-actions github-actions bot added the clang Clang issues not falling into any other category label Jul 7, 2024
@avikivity
Copy link
Contributor Author

@avikivity
Copy link
Contributor Author

gdb backtrace:

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fffec8a8513 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007fffec84fc4e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fffec837902 in __GI_abort () at abort.c:79
#4  0x00007fffec838767 in __libc_message_impl (fmt=fmt@entry=0x7fffec9c216e "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:132
#5  0x00007fffec936769 in __GI___fortify_fail (msg=msg@entry=0x7fffec9c2186 "stack smashing detected") at fortify_fail.c:24
#6  0x00007fffec9379e4 in __stack_chk_fail () at stack_chk_fail.c:24
#7  0x00007fffee3746a1 in ub3_sub4_sub5_in_AV_160_with_sub1_sub2_sub3_sub4_in_AV_128_with_sub1_sub2_sub3_in_AV_96_Align2_and_AV_96_with_sub1_sub2_in_AV_64_with_sub1_in_VGPR_32_Lo128BitsE (
     std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > >, __gnu_cxx::__normal_iterator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > *, std::vector<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > > >=<optimized out>) at /usr/src/debug/llvm-18.1.6-2.fc40.x86_64/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1605
#8  0x00007fffee366f53 in _9VETTIImplEE34shouldBuildLookupTablesForConstantEPNS_8ConstantE (lse, llvm::cl::parser<llvm::RegAllocPriorityAdvisorAnalysis::AdvisorMode> >=..., 
    tCallSiteEntryDIEsERKNS_12DISubprogramERNS_16DwarfCompileUnitERNS_3DIEERKNS_15MachineFunctionEENK3$_0clERKNS_12MachineInstrE=..., BAL__N_116GPRMM16MovePBitsE=..., 
    gned int, llvm::DenseMapInfo<unsigned int, void> > >, std::tuple<llvm::Instruction *, std::vector<unsigned long, std::allocator<unsigned long> >, const llvm::Function *, llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int, void> > > >=..., AL__N_129Int32Regs_and_SpecialRegsBitsE=..., 
    nt32Regs_and_SpecialRegsBitsE=..., nd_SpecialRegsBitsE=..., rIKS3_N12_GLOBAL__N_17UseInfoINS0_11GlobalValueEEEESt10_Select1stISA_ESt4lessIS3_ESaISA_EE8key_compEv=<optimized out>, 
    BaseESt14default_deleteIS6_EENS_12DenseMapInfoIS3_vEENS_6detail12DenseMapPairIS3_S9_EEEES3_S9_SB_SE_E10getBucketsEv=<optimized out>) at /usr/src/debug/llvm-18.1.6-2.fc40.x86_64/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:2061
#9  0x00007fffee36545b in sE (
     std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > >, __gnu_cxx::__normal_iterator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > *, std::vector<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > > >=0x198a06c8, lse, llvm::cl::parser<llvm::RegAllocPriorityAdvisorAnalysis::AdvisorMode> >=..., list_sentinel_trackingILb1EEEEEENS_12ilist_traitsIS2_EEE6insertENS_14ilist_iteratorINS_12ilist_detail12node_optionsIS2_Lb1ELb1EvLb0EEELb0ELb0EEEPS2_=...)
    at /usr/src/debug/llvm-18.1.6-2.fc40.x86_64/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:2174
#10 0x00007ffff0bf4bf1 in ISA_ESt4lessIS3_ESaISA_EE11_M_leftmostEv (
     std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > >, __gnu_cxx::__normal_iterator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > *, std::vector<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > > >=<optimized out>, dTypesEv=..., deleterEv=...) at /usr/src/debug/llvm-18.1.6-2.fc40.x86_64/include/llvm/IR/PassManagerInternal.h:89
#11 0x00007fffed5c8e5d in arget/ARM/ARMLoadStoreOptimizer.cpp:1987:19)> > (
     std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > >, __gnu_cxx::__normal_iterator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > *, std::vector<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> >, std::allocator<std::vector<llvm::IRSimilarity::IRSimilarityCandidate, std::allocator<llvm::IRSimilarity::IRSimilarityCandidate> > > > > >=<optimized out>, dTypesEv=..., deleterEv=...) at /usr/src/debug/llvm-18.1.6-2.fc40.x86_64/include/llvm/IR/PassManager.h:543
#12 0x00007ffff5865092 in g12_GLOBAL__N_123NamedDeclFindingVisitorEE32VisitOpenCLLocalAddressSpaceAttrEPNS_27OpenCLLocalAddressSpaceAttrE (Tree<llvm::ImutKeyValueInfo<(anonymous namespace)::ConstructedObjectKey, clang::ento::SVal> > *> >=0x7fffffffa140, 
    gumentLocENS_15TypedefNameDeclEEEET_EE5valueEvE4typeELPv0EEEPNS_14TypeSourceInfoERKSF_=4_SA_EEEES4_SA_SC_SF_E15LookupBucketForIS4_EEbRKT_RPSF_::apturedRecordAttrEPNS_18CapturedRecordAttrE, cl *, clang::Decl *const>=..., =..., 
    r<clang::arcmt::trans::ASTTraverser *>, clang::arcmt::trans::ASTTraverser *>=0x4a4bf0) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/CodeGen/BackendUtil.cpp:1101
#13 0x00007ffff585c17e in S_27OpenCLLocalAddressSpaceAttrE (Tree<llvm::ImutKeyValueInfo<(anonymous namespace)::ConstructedObjectKey, clang::ento::SVal> > *> >=<optimized out>, cl *, clang::Decl *const>=..., r<clang::arcmt::trans::ASTTraverser *>, clang::arcmt::trans::ASTTraverser *>=0x4a4bf0, 
    gumentLocENS_15TypedefNameDeclEEEET_EE5valueEvE4typeELPv0EEEPNS_14TypeSourceInfoERKSF_=<optimized out>) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/CodeGen/BackendUtil.cpp:1166
#14 rmIN12_GLOBAL__N_121AdjustConstraintDepthEE31TransformStmtCoroReturnTypeAttrEPKNS_4StmtES6_PKNS_18CoroReturnTypeAttrE (cl *, llvm::detail::DenseSetEmpty, llvm::DenseMapInfo<const clang::NamedDecl *, void>, llvm::detail::DenseSetPair<const clang::NamedDecl *>, false>, bool, true>=..., 
    EE33TraverseWebAssemblyImportNameAttrEPNS_25WebAssemblyImportNameAttrE=..., eInvocationsRNS_4SemaERNS1_33ExpressionEvaluationContextRecordEE12SimpleRemoveE22VisitPreferredTypeAttrEPNS_17PreferredTypeAttrE=<optimized out>, 
    e_implILm2EJN5clang12ast_matchers8internal7MatcherINS0_4StmtEEEEE7_M_headERS6_=..., d::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > *, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >=..., trE=..., 
    st clang::ento::MemRegion *, unsigned int> > *> >=0x492020, gumentLocENS_15TypedefNameDeclEEEET_EE5valueEvE4typeELPv0EEEPNS_14TypeSourceInfoERKSF_=<optimized out>, 16_x=..., cl *, clang::Decl *const>=..., 
    r<clang::arcmt::trans::ASTTraverser *>, clang::arcmt::trans::ASTTraverser *>=<optimized out>) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/CodeGen/BackendUtil.cpp:1328
#15 0x00007ffff5c5a2a0 in nto10ExprEngine27VisitObjCAtSynchronizedStmtEPKNS_22ObjCAtSynchronizedStmtEPNS0_12ExplodedNodeERNS0_15ExplodedNodeSetE (Tree<llvm::ImutKeyValueInfo<(anonymous namespace)::ConstructedObjectKey, clang::ento::SVal> > *> >=0x4a4bf0, 
    mallString<128U> >, _Fwd_list_node<SmallString<128U> > >=...) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/CodeGen/CodeGenAction.cpp:379
#16 0x00007ffff4574436 in 0Matcher<clang::OpaqueValueExpr, clang::ast_matchers::internal::Matcher<clang::Expr> >, const std::tuple<clang::ast_matchers::internal::Matcher<clang::Expr> > &> (::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::BindableMatcher<clang::Type> > >=warning: RTTI symbol not found for class 'clang::Sema'
..., 
    sve_svabalt_s32=false, fic_attr_iteratorINS_20AMDGPUKernelCallAttrEN4llvm11SmallVectorIPNS_4AttrELj4EEEEppEi=<optimized out>) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/Parse/ParseAST.cpp:176
#17 0x00007ffff681c9f6 in mtE (Tree<llvm::ImutKeyValueInfo<(anonymous namespace)::ConstructedObjectKey, clang::ento::SVal> > *> >=0x4a8220) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/Frontend/FrontendAction.cpp:1069
#18 0x00007ffff6794700 in tualExclusionERNS_4SemaEPKNS_4StmtE (Tree<llvm::ImutKeyValueInfo<(anonymous namespace)::ConstructedObjectKey, clang::ento::SVal> > *> >=0x4a23b0, sitorBaseIN4llvm14make_const_ptrEN12_GLOBAL__N_114CallExprFinderEvJEE5VisitEPKNS_4StmtE=warning: RTTI symbol not found for class 'clang::EmitBCAction'
...)
    at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/Frontend/CompilerInstance.cpp:1057
#19 0x00007ffff6899f65 in IPN5clang12ast_matchers8internal7MatcherINS0_16CXXConstCastExprEEEEmIEl (
    NS_15mapped_iteratorINS_12ImmutableMapIN12_GLOBAL__N_110BindingKeyEN5clang4ento4SValENS_16ImutKeyValueInfoIS4_S7_EEE8iteratorEZNS_17make_second_rangeIRKSA_EEDaOT_EUlRKSt4pairIS4_S7_EE_RKS7_EESt26bidirectional_iterator_tagSM_lPSM_SN_EleERKSO_=0x4a23b0)
    at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/lib/FrontendTool/ExecuteCompilerInvocation.cpp:272
#20 0x00000000004144c6 in 2DenseMapPairIS2_iEEEES2_iS4_S7_E16FindAndConstructERKS2_ (eRefCountedBaseINS_3vfs10FileSystemEEaSERKS3_=..., odelEEaSERKS3_=0x7fffffffd356 "/usr/bin/clang++", ngops=0x40d970 <GetExecutablePath[abi:cxx11](char const*, bool)>)
    at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/cc1_main.cpp:294
#21 0x0000000000411164 in ExecuteCC1Tool (ArgV=..., ToolContext=...) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:365
#22 0x000000000040fea8 in clang_main (Argc=<optimized out>, Argv=<optimized out>, ToolContext=...) at /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:405
#23 0x000000000041dcca in ConstructERKS2_(l_base_implIN4llvm23PrettyStackTraceProgramESt14_Optional_baseIS1_Lb0ELb0EEE13_M_is_engagedEv, t_self<Triple>, __not_<__and_<is_scalar<Triple>, is_same<Triple, decay_t<Triple> > > >, is_constructible<Triple, Triple>, is_assignable<Triple &, Triple> >, optional<Triple> &> **) (nseSetEmpty=790750, _ZN4llvm15SmallVectorImplIPvE6assignEmS1_=0xc10de) at tools/driver/clang-driver.cpp:17

@avikivity
Copy link
Contributor Author

The crash is at the end of the function during stack check, so presumably the bug happened earlier. Maybe asan can help.

@avikivity
Copy link
Contributor Author

Does not reproduce with llvmorg-18.1.8 (3b5b5c1) build from source

@avikivity
Copy link
Contributor Author

Although, maybe clang itself wasn't build with stack smashing protection.

@avikivity
Copy link
Contributor Author

Did not reproduce with llvmorg-18.1.6, so likely need extra fortification.

@avikivity
Copy link
Contributor Author

Plain llvmorg-18.1.6 with -fstack-protector-all did not reproduce.

@avikivity
Copy link
Contributor Author

llvmorg-18.1.6 with -fstack-protector-all and built with clang reproduces

@avikivity
Copy link
Contributor Author

llvmorg-18.1.8 with -fstack-protector-all and built with clang reproduces

@avikivity
Copy link
Contributor Author

main (7f3c40a) works

@EugeneZelenko EugeneZelenko added PGO Profile Guided Optimizations crash Prefer [crash-on-valid] or [crash-on-invalid] and removed clang Clang issues not falling into any other category labels Jul 7, 2024
@avikivity
Copy link
Contributor Author

avikivity commented Jul 8, 2024

# fixed: [7f3c40a] [libc] implement pathconf/fpathconf (#87165)
# broken: [1118c2e] [libcxx][libcxxabi] Fix build for OpenBSD (#92186)
git bisect start 'main' 'llvmorg-18.1.6'
# broken: [9324872] [RISCV][MC] Split tests for A into Zaamo and Zalrsc parts
git bisect broken 9324872
# fixed: [466017c] Work around test failure due to new aslr default
git bisect fixed 466017c
# broken: [90e9e96] [mlir][NFC] Apply rule of five to *Pass classes (#80998)
git bisect broken 90e9e96
# fixed: [51268a5] [BOLT] Enable --keep-nops option for Linux kernel by default (#86349)
git bisect fixed 51268a5
# fixed: [db058b9] [asan][windows] fix issue64990 test (#85137)
git bisect fixed db058b9
# broken: [e0d4906] [IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
git bisect broken e0d4906
# fixed: [672fc89] [NFC] [hwasan] factor out selective instrumentation logic (#84408)
git bisect fixed 672fc89
# fixed: [d8d2dea] [RISCV] Handle FP riscv_masked_strided_load with 0 stride. (#84576)
git bisect fixed d8d2dea
# broken: [ba13fa2] [llvm][Support] Add and use errnoAsErrorCode (#84423)
git bisect broken ba13fa2
# broken: [0be1c3b] [workflows] Mention the correct user who makes a /cherry-pick comment (#82680)
git bisect broken 0be1c3b
# broken: [e3444ad] [InstCombine] Add tests for expanding foldICmpWithLowBitMaskedVal; NFC
git bisect broken e3444ad
# broken: [cef862e] [InstCombine] Tests for (icmp eq/ne (and (shl -1, X), Y), 0) -> (icmp eq/ne (lshr Y, X), 0); NFC
git bisect broken cef862e
# fixed: [6bec4fc] [libc] Fix flag parsing bugs. (#84706)
git bisect fixed 6bec4fc
# broken: [edd4c6c] [LoongArch] Make sure that the LoongArchISD::BSTRINS node uses the correct MSB value (#84454)
git bisect broken edd4c6c
# fixed: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)
git bisect fixed f786881
# first fixed commit: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)

@avikivity
Copy link
Contributor Author

avikivity commented Jul 8, 2024

@fpasserby looks like your commit f786881 fixed cs-pgo; can it be backported to 18.1?

@avikivity
Copy link
Contributor Author

Looks like it's not intended as a fix but rather feature; so it fixed cs-pgo incidentally.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 8, 2024

broken: [7f3c40a] [libc] implement pathconf/fpathconf (#87165)

fixed: [1118c2e] [libcxx][libcxxabi] Fix build for OpenBSD (#92186)

git bisect start 'main' 'llvmorg-18.1.6'

fixed: [9324872] [RISCV][MC] Split tests for A into Zaamo and Zalrsc parts

git bisect fixed 9324872

broken: [466017c] Work around test failure due to new aslr default

git bisect broken 466017c

fixed: [90e9e96] [mlir][NFC] Apply rule of five to *Pass classes (#80998)

git bisect fixed 90e9e96

broken: [51268a5] [BOLT] Enable --keep-nops option for Linux kernel by default (#86349)

git bisect broken 51268a5

broken: [db058b9] [asan][windows] fix issue64990 test (#85137)

git bisect broken db058b9

fixed: [e0d4906] [IR] Add new Range attribute using new ConstantRange Attribute type (#83171)

git bisect fixed e0d4906

broken: [672fc89] [NFC] [hwasan] factor out selective instrumentation logic (#84408)

git bisect broken 672fc89

broken: [d8d2dea] [RISCV] Handle FP riscv_masked_strided_load with 0 stride. (#84576)

git bisect broken d8d2dea

fixed: [ba13fa2] [llvm][Support] Add and use errnoAsErrorCode (#84423)

git bisect fixed ba13fa2

fixed: [0be1c3b] [workflows] Mention the correct user who makes a /cherry-pick comment (#82680)

git bisect fixed 0be1c3b

fixed: [e3444ad] [InstCombine] Add tests for expanding foldICmpWithLowBitMaskedVal; NFC

git bisect fixed e3444ad

fixed: [cef862e] [InstCombine] Tests for (icmp eq/ne (and (shl -1, X), Y), 0) -> (icmp eq/ne (lshr Y, X), 0); NFC

git bisect fixed cef862e

broken: [6bec4fc] [libc] Fix flag parsing bugs. (#84706)

git bisect broken 6bec4fc

fixed: [edd4c6c] [LoongArch] Make sure that the LoongArchISD::BSTRINS node uses the correct MSB value (#84454)

git bisect fixed edd4c6c

broken: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)

git bisect broken f786881

first broken commit: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)

Error: Command failed due to missing milestone.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 8, 2024

# broken: [7f3c40a] [libc] implement pathconf/fpathconf (#87165)
# fixed: [1118c2e] [libcxx][libcxxabi] Fix build for OpenBSD (#92186)
git bisect start 'main' 'llvmorg-18.1.6'
# fixed: [9324872] [RISCV][MC] Split tests for A into Zaamo and Zalrsc parts
git bisect fixed 9324872
# broken: [466017c] Work around test failure due to new aslr default
git bisect broken 466017c
# fixed: [90e9e96] [mlir][NFC] Apply rule of five to *Pass classes (#80998)
git bisect fixed 90e9e96
# broken: [51268a5] [BOLT] Enable --keep-nops option for Linux kernel by default (#86349)
git bisect broken 51268a5
# broken: [db058b9] [asan][windows] fix issue64990 test (#85137)
git bisect broken db058b9
# fixed: [e0d4906] [IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
git bisect fixed e0d4906
# broken: [672fc89] [NFC] [hwasan] factor out selective instrumentation logic (#84408)
git bisect broken 672fc89
# broken: [d8d2dea] [RISCV] Handle FP riscv_masked_strided_load with 0 stride. (#84576)
git bisect broken d8d2dea
# fixed: [ba13fa2] [llvm][Support] Add and use errnoAsErrorCode (#84423)
git bisect fixed ba13fa2
# fixed: [0be1c3b] [workflows] Mention the correct user who makes a /cherry-pick comment (#82680)
git bisect fixed 0be1c3b
# fixed: [e3444ad] [InstCombine] Add tests for expanding foldICmpWithLowBitMaskedVal; NFC
git bisect fixed e3444ad
# fixed: [cef862e] [InstCombine] Tests for (icmp eq/ne (and (shl -1, X), Y), 0) -> (icmp eq/ne (lshr Y, X), 0); NFC
git bisect fixed cef862e
# broken: [6bec4fc] [libc] Fix flag parsing bugs. (#84706)
git bisect broken 6bec4fc
# fixed: [edd4c6c] [LoongArch] Make sure that the LoongArchISD::BSTRINS node uses the correct MSB value (#84454)
git bisect fixed edd4c6c
# broken: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)
git bisect broken f786881
# first broken commit: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)

Error: Command failed due to missing milestone.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 8, 2024

# fixed: [7f3c40a] [libc] implement pathconf/fpathconf (#87165)
# broken: [1118c2e] [libcxx][libcxxabi] Fix build for OpenBSD (#92186)
git bisect start 'main' 'llvmorg-18.1.6'
# broken: [9324872] [RISCV][MC] Split tests for A into Zaamo and Zalrsc parts
git bisect broken 9324872
# fixed: [466017c] Work around test failure due to new aslr default
git bisect fixed 466017c
# broken: [90e9e96] [mlir][NFC] Apply rule of five to *Pass classes (#80998)
git bisect broken 90e9e96
# fixed: [51268a5] [BOLT] Enable --keep-nops option for Linux kernel by default (#86349)
git bisect fixed 51268a5
# fixed: [db058b9] [asan][windows] fix issue64990 test (#85137)
git bisect fixed db058b9
# broken: [e0d4906] [IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
git bisect broken e0d4906
# fixed: [672fc89] [NFC] [hwasan] factor out selective instrumentation logic (#84408)
git bisect fixed 672fc89
# fixed: [d8d2dea] [RISCV] Handle FP riscv_masked_strided_load with 0 stride. (#84576)
git bisect fixed d8d2dea
# broken: [ba13fa2] [llvm][Support] Add and use errnoAsErrorCode (#84423)
git bisect broken ba13fa2
# broken: [0be1c3b] [workflows] Mention the correct user who makes a /cherry-pick comment (#82680)
git bisect broken 0be1c3b
# broken: [e3444ad] [InstCombine] Add tests for expanding foldICmpWithLowBitMaskedVal; NFC
git bisect broken e3444ad
# broken: [cef862e] [InstCombine] Tests for (icmp eq/ne (and (shl -1, X), Y), 0) -> (icmp eq/ne (lshr Y, X), 0); NFC
git bisect broken cef862e
# fixed: [6bec4fc] [libc] Fix flag parsing bugs. (#84706)
git bisect fixed 6bec4fc
# broken: [edd4c6c] [LoongArch] Make sure that the LoongArchISD::BSTRINS node uses the correct MSB value (#84454)
git bisect broken edd4c6c
# fixed: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)
git bisect fixed f786881
# first fixed commit: [f786881] [coroutine] Implement llvm.coro.await.suspend intrinsic (#79712)

Error: Command failed due to missing milestone.

@avikivity
Copy link
Contributor Author

Cannot reproduce with 17.0.6:

error: Error in reading profile /home/avi/scylla-maint/build/release-pgo/profiles/merged.profdata: unsupported instrumentation profile format version

@avikivity
Copy link
Contributor Author

Without loading merged.profdata, clang 18.1.6 doesn't crash, so it may not be possible to bisect to find the patch that introduced the bug.

@avikivity
Copy link
Contributor Author

Bisected to

ffd337b is the first bad commit
commit ffd337b
Author: Mircea Trofin mtrofin@google.com
Date: Wed Nov 15 11:12:59 2023 -0800

[coro][pgo] Do not insert counters in the `suspend` block (#71262)

If we did, we couldn't lower symmetric transfer resumes to tail calls.

We can instrument the other 2 edges instead, as long as they also don't
point to the same basic block.

@mtrofin any ideas how to fix this for 18.1.6?

@avikivity
Copy link
Contributor Author

@mtrofin can you help here? clang 18.1 is broken with coroutines + pgo.

@EugeneZelenko EugeneZelenko added the coroutines C++20 coroutines label Jul 11, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 11, 2024

@llvm/issue-subscribers-coroutines

Author: Avi Kivity (avikivity)

``` FAILED: CMakeFiles/seastar.dir/src/rpc/rpc.cc.o /usr/lib64/ccache/clang++ -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_ATTR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=18 -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -I/home/avi/scylla-maint/seastar/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/src -I/home/avi/scylla-maint/seastar/src -O2 -g -DNDEBUG -std=gnu++23 -U_FORTIFY_SOURCE -Werror=unused-result "-Wno-error=#warnings" -UNDEBUG -Wall -Werror -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -fvisibility=hidden -gz -flto=thin -ffile-prefix-map=/home/avi/scylla-maint=. -march=westmere -Wno-backend-plugin -fprofile-use=/home/avi/scylla-maint/build/release-pgo/profiles/merged.profdata -fcs-profile-generate=/home/avi/scylla-maint/build/release-cs-pgo -mllvm -pgso=false -mllvm -enable-value-profiling=false -MD -MT CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -MF CMakeFiles/seastar.dir/src/rpc/rpc.cc.o.d -o CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -c /home/avi/scylla-maint/seastar/src/rpc/rpc.cc *** stack smashing detected ***: terminated PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: /usr/bin/clang++ -O2 -g -std=gnu++23 -Werror=unused-result -Wno-error=#warnings -Wall -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -fvisibility=hidden -gz -flto=thin -ffile-prefix-map=/home/avi/scylla-maint=. -march=westmere -Wno-backend-plugin -fprofile-use=/home/avi/scylla-maint/build/release-pgo/profiles/merged.profdata -fcs-profile-generate=/home/avi/scylla-maint/build/release-cs-pgo -mllvm -pgso=false -mllvm -enable-value-profiling=false -Werror -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_ATTR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=18 -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -I/home/avi/scylla-maint/seastar/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/include -I/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto/gen/src -I/home/avi/scylla-maint/seastar/src -DNDEBUG -U_FORTIFY_SOURCE -UNDEBUG -c -MD -MT CMakeFiles/seastar.dir/src/rpc/rpc.cc.o -MF CMakeFiles/seastar.dir/src/rpc/rpc.cc.o.d -fcolor-diagnostics -o CMakeFiles/seastar.dir/src/rpc/rpc.cc.o /home/avi/scylla-maint/seastar/src/rpc/rpc.cc 1. <eof> parser at end of file 2. Optimizer #0 0x00007f9d0d8044fa llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.18.1+0x6044fa) #1 0x00007f9d0d801ce4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.18.1+0x601ce4) #2 0x00007f9d0d736004 (/lib64/libLLVM.so.18.1+0x536004) #3 0x00007f9d0cc4fd00 __restore_rt (/lib64/libc.so.6+0x40d00) #4 0x00007f9d0cca84a4 __pthread_kill_implementation (/lib64/libc.so.6+0x994a4) #5 0x00007f9d0cc4fc4e gsignal (/lib64/libc.so.6+0x40c4e) #6 0x00007f9d0cc37902 abort (/lib64/libc.so.6+0x28902) #7 0x00007f9d0cc38767 _IO_peekc_locked.cold (/lib64/libc.so.6+0x29767) #8 0x00007f9d0cd36769 (/lib64/libc.so.6+0x127769) #9 0x00007f9d0cd379e4 (/lib64/libc.so.6+0x1289e4) #10 0x00007f9d0e7746a1 (/lib64/libLLVM.so.18.1+0x15746a1) #11 0x00007f9d0e766f53 (/lib64/libLLVM.so.18.1+0x1566f53) #12 0x00007f9d0e76545b llvm::PGOInstrumentationUse::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/lib64/libLLVM.so.18.1+0x156545b) #13 0x00007f9d10ff4bf1 (/lib64/libLLVM.so.18.1+0x3df4bf1) #14 0x00007f9d0d9c8e5d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/lib64/libLLVM.so.18.1+0x7c8e5d) #15 0x00007f9d15c65092 (/lib64/libclang-cpp.so.18.1+0x1865092) #16 0x00007f9d15c5c17e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/lib64/libclang-cpp.so.18.1+0x185c17e) #17 0x00007f9d1605a2a0 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/lib64/libclang-cpp.so.18.1+0x1c5a2a0) #18 0x00007f9d14974436 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.18.1+0x574436) #19 0x00007f9d16c1c9f6 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.18.1+0x281c9f6) #20 0x00007f9d16b94700 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.18.1+0x2794700) #21 0x00007f9d16c99f65 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.18.1+0x2899f65) #22 0x00000000004144c6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/cc1_main.cpp:294:15 #23 0x0000000000411164 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:365:12 #24 0x00007f9d167c5acd (/lib64/libclang-cpp.so.18.1+0x23c5acd) #25 0x00007f9d0d735d44 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM.so.18.1+0x535d44) #26 0x00007f9d167c5537 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/lib64/libclang-cpp.so.18.1+0x23c5537) #27 0x00007f9d1678b297 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.18.1+0x238b297) #28 0x00007f9d1678b4f7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/lib64/libclang-cpp.so.18.1+0x238b4f7) #29 0x00007f9d167a995e clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/lib64/libclang-cpp.so.18.1+0x23a995e) #30 0x00000000004109bf clang_main(int, char**, llvm::ToolContext const&) /usr/src/debug/clang-18.1.6-3.fc40.x86_64/tools/driver/driver.cpp:540:21 #31 0x000000000041dcca main tools/driver/clang-driver.cpp:17:10 #32 0x00007f9d0cc39088 __libc_start_call_main (/lib64/libc.so.6+0x2a088) #33 0x00007f9d0cc3914b __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14b) #34 0x000000000040d8a5 _start (/usr/bin/clang+++0x40d8a5) clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation) clang version 18.1.6 (Fedora 18.1.6-3.fc40) Target: x86_64-redhat-linux-gnu Thread model: posix InstalledDir: /usr/bin Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang++.cfg clang++: note: diagnostic msg: ********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/rpc-195796.cpp
clang++: note: diagnostic msg: /tmp/rpc-195796.sh
clang++: note: diagnostic msg:


[89/90] Building CXX object CMakeFiles/seastar.dir/src/core/reactor.cc.o
ninja: build stopped: subcommand failed.





</details>

avikivity added a commit to avikivity/llvm-project that referenced this issue Jul 16, 2024
SetBranchWeights() calculates the size of the EdgeCounts vector
using OutEdges.Size(), but this is an under-estimate with coroutines.

Use the number of successors, as the vector will be indexed by
the result of the GetSuccessorNumber() function.

This crashes in 18.1, but somehow doesn't in main. Still, it looks
like the fix is applicable to both.

Fixes llvm#97962
avikivity added a commit to avikivity/llvm-project that referenced this issue Jul 21, 2024
SetBranchWeights() calculates the size of the EdgeCounts vector
using OutEdges.Size(), but this is an under-estimate with coroutines.

Use the number of successors, as the vector will be indexed by
the result of the GetSuccessorNumber() function.

Rename the Size local, to make it clear what it refers to.

This crashes in 18.1, but somehow doesn't in main. Still, it looks
like the fix is applicable to both.

Fixes llvm#97962
avikivity added a commit to avikivity/llvm-project that referenced this issue Aug 8, 2024
SetBranchWeights() calculates the size of the EdgeCounts vector
using OutEdges.Size(), but this is an under-estimate with coroutines.

Use the number of successors, as the vector will be indexed by
the result of the GetSuccessorNumber() function.

Rename the Size local, to make it clear what it refers to.

This crashes in 18.1, but somehow doesn't in main. Still, it looks
like the fix is applicable to both.

Fixes llvm#97962
avikivity added a commit to avikivity/llvm-project that referenced this issue Aug 18, 2024
SetBranchWeights() calculates the size of the EdgeCounts vector
using OutEdges.Size(), but this is an under-estimate with coroutines.

Use the number of successors, as the vector will be indexed by
the result of the GetSuccessorNumber() function.

Rename the Size local, to make it clear what it refers to.

A unit test, provided by @ellishg, is included.

Fixes llvm#97962

(regression from ffd337b)
avikivity added a commit to avikivity/llvm-project that referenced this issue Aug 18, 2024
SetBranchWeights() calculates the size of the EdgeCounts vector
using OutEdges.Size(), but this is an under-estimate with coroutines.

Use the number of successors, as the vector will be indexed by
the result of the GetSuccessorNumber() function.

Rename the Size local, to make it clear what it refers to.

A unit test, provided by @ellishg, is included.

Fixes llvm#97962

(regression from ffd337b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coroutines C++20 coroutines crash Prefer [crash-on-valid] or [crash-on-invalid] PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants