[PATCH] D157061: [SampleProfile] Potential use after move in SampleProfileLoader::promoteMergeNotInlinedContextSamples

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 16:50:54 PDT 2023


ayermolo added a comment.

This diff is causing crash in one of our builds. Not quite sure what is going on yet. Looks like some kind of memory corruption. Can this be reverted in the meantime?

Stack trace.

#0 0x00005583a0ef1338 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x00005583a0eef230 llvm::sys::RunSignalHandlers() /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x00005583a0ef1b0d SignalHandler(int) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x00007fee80a12cf0 __restore_rt (/usr/lib64/libpthread.so.0+0x12cf0)
 #4 0x00005583a22063cf llvm::sampleprof::LineLocation::operator<(llvm::sampleprof::LineLocation const&) const /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:296:23
 #5 0x00005583a22063cf std::less<llvm::sampleprof::LineLocation>::operator()(llvm::sampleprof::LineLocation const&, llvm::sampleprof::LineLocation const&) const /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_function.h:408:20
 #6 0x00005583a22063cf std::_Rb_tree<llvm::sampleprof::LineLocation, std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>, std::_Select1st<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>, std::less<llvm::sampleprof::LineLocation>, std::allocator<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>>::_M_lower_bound(std::_Rb_tree_node<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>*, std::_Rb_tree_node_base*, llvm::sampleprof::LineLocation const&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_tree.h:1951:7
 #7 0x00005583a22063cf std::_Rb_tree<llvm::sampleprof::LineLocation, std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>, std::_Select1st<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>, std::less<llvm::sampleprof::LineLocation>, std::allocator<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>>::lower_bound(llvm::sampleprof::LineLocation const&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_tree.h:1270:16
 #8 0x00005583a22063cf std::map<llvm::sampleprof::LineLocation, llvm::sampleprof::SampleRecord, std::less<llvm::sampleprof::LineLocation>, std::allocator<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>>::lower_bound(llvm::sampleprof::LineLocation const&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_map.h:1307:21
 #9 0x00005583a22063cf std::map<llvm::sampleprof::LineLocation, llvm::sampleprof::SampleRecord, std::less<llvm::sampleprof::LineLocation>, std::allocator<std::pair<llvm::sampleprof::LineLocation const, llvm::sampleprof::SampleRecord>>>::operator[](llvm::sampleprof::LineLocation&&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_map.h:527:17
#10 0x00005583a22063cf llvm::sampleprof::FunctionSamples::addBodySamples(unsigned int, unsigned int, unsigned long, unsigned long) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:785:12
#11 0x00005583a2203547 llvm::sampleprof::ProfileConverter::flattenNestedProfile(llvm::sampleprof::SampleProfileMap&, llvm::sampleprof::FunctionSamples const&) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:1600:21
#12 0x00005583a2202dbf llvm::sampleprof::ProfileConverter::flattenProfile(llvm::sampleprof::SampleProfileMap const&, llvm::sampleprof::SampleProfileMap&, bool) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:0:9
#13 0x00005583a21fd4a8 std::__uniq_ptr_impl<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>>::reset((anonymous namespace)::SampleProfileMatcher*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:200:26
#14 0x00005583a21fd4a8 std::__uniq_ptr_impl<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>>::operator=(std::__uniq_ptr_impl<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>>&&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:183:2
#15 0x00005583a21fd4a8 std::__uniq_ptr_data<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>, true, true>::operator=(std::__uniq_ptr_data<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>, true, true>&&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:235:61
#16 0x00005583a21fd4a8 std::unique_ptr<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>>::operator=(std::unique_ptr<(anonymous namespace)::SampleProfileMatcher, std::default_delete<(anonymous namespace)::SampleProfileMatcher>>&&) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:406:51
#17 0x00005583a21fd4a8 (anonymous namespace)::SampleProfileLoader::doInitialization(llvm::Module&, llvm::AnalysisManager<llvm::Function>*) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2110:21
#18 0x00005583a21fd4a8 llvm::SampleProfileLoaderPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2655:21
#19 0x00005583a210c19d llvm::detail::PassModel<llvm::Module, llvm::SampleProfileLoaderPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:89:5
#20 0x00005583a0a78b99 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/IR/PassManager.h:521:10
#21 0x00005583a162f19f llvm::SmallPtrSetImplBase::isSmall() const /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:195:33
#22 0x00005583a162f19f llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:83:10
#23 0x00005583a162f19f llvm::PreservedAnalyses::~PreservedAnalyses() /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/llvm/include/llvm/IR/PassManager.h:152:7
#24 0x00005583a162f19f (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&) /tmp/tmpely0ut0s_llvm-rebase-with-review/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1104:5


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157061/new/

https://reviews.llvm.org/D157061



More information about the llvm-commits mailing list