[llvm-bugs] [Bug 48578] New: crash in Live Variable Analysis (HandleVirtRegUse) for target bpf

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 22 15:12:41 PST 2020


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

            Bug ID: 48578
           Summary: crash in Live Variable Analysis (HandleVirtRegUse) for
                    target bpf
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andreimatei1 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 24313
  --> https://bugs.llvm.org/attachment.cgi?id=24313&action=edit
my program (including preprocessed) plus the files that clang told me to
include

I've got a program that causes clang to crash (every time) when compiling with
-target bpf. The crash doesn't happen when compiling for x86.

It happens on both clang11 and a recent
trunk(4dce7c2e2092953f2cea1a2c1ffd4a53ec2531ac).

To simply reproduce with the preprocessed source (attached):
clang -O2 -target bpf -c -o probe.bpf.o probe.bpf.preprocessed.c


[andrei:~] clang -g -O2 -target bpf -fcolor-diagnostics -D__TARGET_ARCH_x86
-Ioutput -idirafter /usr/local/include -idirafter
/usr/lib/llvm-11/lib/clang/11.0.0/include -idirafter
/usr/include/x86_64-linux-gnu -idirafter /usr/include -c -o output/probe.bpf.o
probe.bpf.c
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/bin/clang -g -O2 -target bpf
-fcolor-diagnostics -D__TARGET_ARCH_x86 -Ioutput -idirafter /usr/local/include
-idirafter /usr/lib/llvm-11/lib/clang/11.0.0/include -idirafter
/usr/include/x86_64-linux-gnu -idirafter /usr/include -c -o output/probe.bpf.o
probe.bpf.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'probe.bpf.c'.
4.      Running pass 'Live Variable Analysis' on function '@probe'
 #0 0x00007fce4d29dbbf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa6bbf)
 #1 0x00007fce4d29bf20 llvm::sys::RunSignalHandlers()
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa4f20)
 #2 0x00007fce4d29d30d llvm::sys::CleanupOnSignal(unsigned long)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa630d)
 #3 0x00007fce4d1e5940 (/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x9ee940)
 #4 0x00007fce54356bb0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14bb0)
 #5 0x00007fce4d51785e llvm::LiveVariables::HandleVirtRegUse(unsigned int,
llvm::MachineBasicBlock*, llvm::MachineInstr&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd2085e)
 #6 0x00007fce4d519abe llvm::LiveVariables::runOnInstr(llvm::MachineInstr&,
llvm::SmallVectorImpl<unsigned int>&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd22abe)
 #7 0x00007fce4d519ec6
llvm::LiveVariables::runOnBlock(llvm::MachineBasicBlock*, unsigned int)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd22ec6)
 #8 0x00007fce4d51a4bf
llvm::LiveVariables::runOnMachineFunction(llvm::MachineFunction&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd234bf)
 #9 0x00007fce4d570e4e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd79e4e)
#10 0x00007fce4d3acc69 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbb5c69)
#11 0x00007fce4d3b2213 llvm::FPPassManager::runOnModule(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbbb213)
#12 0x00007fce4d3ad280 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbb6280)
#13 0x00007fce52d1c916 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> >)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1581916)
#14 0x00007fce52fd9d06 (/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x183ed06)
#15 0x00007fce520a50e3 clang::ParseAST(clang::Sema&, bool, bool)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x90a0e3)
#16 0x00007fce5366f198 clang::FrontendAction::Execute()
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1ed4198)
#17 0x00007fce53625711
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1e8a711)
#18 0x00007fce536d52d0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1f3a2d0)
#19 0x00000000004125ff cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang+0x4125ff)
#20 0x0000000000410a3e (/usr/bin/clang+0x410a3e)
#21 0x00007fce53359a12 (/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1bbea12)
#22 0x00007fce4d1e574d
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x9ee74d)
#23 0x00007fce53358f3f
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1bbdf3f)
#24 0x00007fce53330d5f
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1b95d5f)
#25 0x00007fce53330f07
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1b95f07)
#26 0x00007fce53344a6c
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1ba9a6c)
#27 0x00000000004104e3 main (/usr/bin/clang+0x4104e3)
#28 0x00007fce4c2e8cb2 __libc_start_main ./csu/../csu/libc-start.c:314:16
#29 0x000000000040dcde _start (/usr/bin/clang+0x40dcde)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version 11.0.0-2
Target: bpf
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg:

-- 
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/20201222/38c76135/attachment-0001.html>


More information about the llvm-bugs mailing list