[llvm-bugs] [Bug 36072] New: Using patchpoint crashes with assertion: Invalid Dwarf register number

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 23 17:18:42 PST 2018


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

            Bug ID: 36072
           Summary: Using patchpoint crashes with assertion: Invalid Dwarf
                    register number
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: pdox at alum.mit.edu
                CC: llvm-bugs at lists.llvm.org

The following is a minimal reproducer created by bugpoint. This crashes llc
with the X86-64 backend:

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-6c93f4a.bc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%PyFrameObject = type opaque

define void @foo(%PyFrameObject*) local_unnamed_addr {
entry:
  tail call void (i64, i32, i8*, i32, ...)
@llvm.experimental.patchpoint.void(i64 0, i32 16, i8* inttoptr (i64 0 to i8*),
i32 1, i8* inttoptr (i64 0 to i8*), %PyFrameObject* nonnull %0)
  %1 = tail call i32 inttoptr (i64 0 to i32 (%PyFrameObject*)*)(%PyFrameObject*
nonnull %0)
  ret void
}

declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...)

The crash produces the following backtrace:

$ ./llc minimal.ll
llc: /home/pdox/llvm/lib/CodeGen/StackMaps.cpp:98: unsigned int
getDwarfRegNum(unsigned int, const llvm::TargetRegisterInfo*): Assertion
`RegNum >= 0 && "Invalid Dwarf register number."' failed.
#0 0x000000000351067d llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/pdox/llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x000000000351070e PrintStackTraceSignalHandler(void*)
/home/pdox/llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x000000000350ebf4 llvm::sys::RunSignalHandlers()
/home/pdox/llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003510015 SignalHandler(int)
/home/pdox/llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007fdf12c5b5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007fdf118521f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007fdf118538e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007fdf1184b266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007fdf1184b312 (/lib64/libc.so.6+0x2e312)
#9 0x0000000002b84596 getDwarfRegNum(unsigned int, llvm::TargetRegisterInfo
const*) /home/pdox/llvm/lib/CodeGen/StackMaps.cpp:99:0
#10 0x0000000002b85382 llvm::StackMaps::createLiveOutReg(unsigned int,
llvm::TargetRegisterInfo const*) const
/home/pdox/llvm/lib/CodeGen/StackMaps.cpp:249:0
#11 0x0000000002b8555a llvm::StackMaps::parseRegisterLiveOutMask(unsigned int
const*) const /home/pdox/llvm/lib/CodeGen/StackMaps.cpp:265:0
#12 0x0000000002b84ada llvm::StackMaps::parseOperand(llvm::MachineOperand
const*, llvm::MachineOperand const*,
llvm::SmallVector<llvm::StackMaps::Location, 8u>&,
llvm::SmallVector<llvm::StackMaps::LiveOutReg, 8u>&) const
/home/pdox/llvm/lib/CodeGen/StackMaps.cpp:170:0
#13 0x0000000002b858d0 llvm::StackMaps::recordStackMapOpers(llvm::MachineInstr
const&, unsigned long, llvm::MachineOperand const*, llvm::MachineOperand
const*, bool) /home/pdox/llvm/lib/CodeGen/StackMaps.cpp:318:0
#14 0x0000000002b85eaa llvm::StackMaps::recordPatchPoint(llvm::MachineInstr
const&) /home/pdox/llvm/lib/CodeGen/StackMaps.cpp:385:0
#15 0x000000000220d7bc llvm::X86AsmPrinter::LowerPATCHPOINT(llvm::MachineInstr
const&, (anonymous namespace)::X86MCInstLower&)
/home/pdox/llvm/lib/Target/X86/X86MCInstLower.cpp:994:0
#16 0x000000000221112d llvm::X86AsmPrinter::EmitInstruction(llvm::MachineInstr
const*) /home/pdox/llvm/lib/Target/X86/X86MCInstLower.cpp:1590:0
#17 0x0000000002770832 llvm::AsmPrinter::EmitFunctionBody()
/home/pdox/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1067:0
#18 0x0000000002205553
llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
/home/pdox/llvm/lib/Target/X86/X86AsmPrinter.cpp:79:0
#19 0x00000000029b9cad
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/pdox/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#20 0x0000000002dc890a llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/pdox/llvm/lib/IR/LegacyPassManager.cpp:1520:0
#21 0x0000000002dc8a9d llvm::FPPassManager::runOnModule(llvm::Module&)
/home/pdox/llvm/lib/IR/LegacyPassManager.cpp:1541:0
#22 0x0000000002dc8e29 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/pdox/llvm/lib/IR/LegacyPassManager.cpp:1597:0
#23 0x0000000002dc951a llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/pdox/llvm/lib/IR/LegacyPassManager.cpp:1700:0
#24 0x0000000002dc975b llvm::legacy::PassManager::run(llvm::Module&)
/home/pdox/llvm/lib/IR/LegacyPassManager.cpp:1732:0
#25 0x000000000140a29d compileModule(char**, llvm::LLVMContext&)
/home/pdox/llvm/tools/llc/llc.cpp:572:0
#26 0x0000000001408b41 main /home/pdox/llvm/tools/llc/llc.cpp:346:0
#27 0x00007fdf1183ec05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#28 0x0000000001406cc9 _start (./llc+0x1406cc9)
Stack dump:
0.      Program arguments: ./llc minimal.ll
1.      Running pass 'Function Pass Manager' on module 'minimal.ll'.
2.      Running pass 'X86 Assembly Printer' on function '@foo'
Aborted (core dumped)

-- 
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/20180124/c112e792/attachment-0001.html>


More information about the llvm-bugs mailing list