[llvm-bugs] [Bug 44922] New: crash in llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks with -O2 -fsanitize=object-size

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 15 08:01:43 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44922

            Bug ID: 44922
           Summary: crash in
                    llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks
                    with -O2 -fsanitize=object-size
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: keescook at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 23130
  --> https://bugs.llvm.org/attachment.cgi?id=23130&action=edit
creduced test case

Stack dump:
0.      Program arguments: clang -O2 -fsanitize=object-size -c -o /dev/null
test
.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'test.c'.
4.      Running pass 'Jump Threading' on function '@f'
 #0 0x000055819d31194e llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x194a94e)
 #1 0x000055819d30f694 llvm::sys::RunSignalHandlers()
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1948694)
 #2 0x000055819d30f911 llvm::sys::CleanupOnSignal(unsigned long)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1948911)
 #3 0x000055819d28b0a8 CrashRecoverySignalHandler(int)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x18c40a8)
 #4 0x00007fa765c17540 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x15540)
 #5 0x000055819cc15b88 llvm::BasicBlock::phis()
(/home/kees/src/llvm-build/x86/bin/clang-11+0x124eb88)
 #6 0x000055819d10315d AddPHINodeEntriesForMappedBlock(llvm::BasicBlock*,
llvm::BasicBlock*, llvm::BasicBlock*, llvm::DenseMap<llvm::Instruction*,
llvm::Value*, llvm::DenseMapInfo<llvm::Instruction*>,
llvm::detail::DenseMapPair<llvm::Instruction*, llvm::Value*> >&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x173c15d)
 #7 0x000055819d1081e5
llvm::JumpThreadingPass::ThreadThroughTwoBasicBlocks(llvm::BasicBlock*,
llvm::BasicBlock*, llvm::BasicBlock*, llvm::BasicBlock*)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x17411e5)
 #8 0x000055819d108605
llvm::JumpThreadingPass::MaybeThreadThroughTwoBasicBlocks(llvm::BasicBlock*,
llvm::Value*) (/home/kees/src/llvm-build/x86/bin/clang-11+0x(llvm::BasicBlock*,
llvm::Value*) (/home/kees/src/llvm-build/x86/bin/clang-11+0x1741605)
 #9 0x000055819d108bd4
llvm::JumpThreadingPass::ProcessThreadableEdges(llvm::Value*,
llvm::BasicBlock*, llvm::jumpthreading::ConstantPreference, llvm::Instruction*)
(.part.0) (/home/kees/src/llvm-build/x86/bin/clang-11+0x1741bd4)
#10 0x000055819d10c9d3 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x17459d3)
#11 0x000055819d10d82d llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DomTreeUpdater*, bool, std::unique_ptr<llvm::BlockFrequencyInfo,
std::default_delete<llvm::BlockFrequencyInfo> >,
std::unique_ptr<llvm::BranchProbabilityInfo,
std::default_delete<llvm::BranchProbabilityInfo> >)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x174682d)
#12 0x000055819d10e1c5 (anonymous
namespace)::JumpThreading::runOnFunction(llvm::Function&) (.part.0)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x17471c5)
#13 0x000055819ccd9630 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1312630)
#14 0x000055819fbac6cb (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x41e56cb)
#15 0x000055819ccdafa0 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1313fa0)
#16 0x000055819d57277b clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1bab77b)
#17 0x000055819e1971d1
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x27d01d1)
#18 0x000055819edbb709 clang::ParseAST(clang::Sema&, bool, bool)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x33f4709)
#19 0x000055819db69209 clang::FrontendAction::Execute()
(/home/kees/src/llvm-build/x86/bin/clang-11+0x21a2209)
#20 0x000055819db203bb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x21593bb)
#21 0x000055819dc3fecb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x2278ecb)
#22 0x000055819c325b10 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/kees/src/llvm-build/x86/bin/clang-11+0x95eb10)
#23 0x000055819c32397a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x95c97a)
#24 0x000055819d9e8529 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x2021529)
#25 0x000055819d28b1a7
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x18c41a7)
#26 0x000055819d9e913e
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.0)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x202213e)
#27 0x000055819d9bfcac
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1ff8cac)
#28 0x000055819d9c05a9
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/kees/src/llvm-build/x86/bin/clang-11+0x1ff95a9)
#29 0x000055819d9c82ef
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/kees/src/llvm-build/x86/bin/clang-11+0x20012ef)
#30 0x000055819c2c29be main
(/home/kees/src/llvm-build/x86/bin/clang-11+0x8fb9be)
#31 0x00007fa76568d1e3 __libc_start_main
/build/glibc-4WA41p/glibc-2.30/csu/../csu/libc-start.c:342:3
#32 0x000055819c32355e _start
(/home/kees/src/llvm-build/x86/bin/clang-11+0x95c55e)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
895cad1a133a9ec5fc3ebc042491aa78256d797f)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200215/5ee0fd8e/attachment.html>


More information about the llvm-bugs mailing list