-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Copy link
Description
If I fix the MCSubtargetInfo constructor to properly configure 64-bit mode bits, many disassembler test cases start crashing. Here is one reduced sample. Manually adding +ptr64 exposes the crash
# RUN: llvm-mc -triple=mips64el-unknown-linux -disassemble -mattr=+ptr64 -mcpu=mips3 %s | FileCheck %s
0xd8 0x49 0x6f 0xe2 # CHECK: sc $15, 18904($19)
sc $19, Assertion failed: (idx < size()), function operator[], file SmallVector.h, line 296.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llvm-mc /Users/matt/src/llvm-project/llvm/test/MC/Disassembler/Mips/mips3/x.txt -triple=mips64el-unknown-linux -disassemble -mcpu=mips3 -show-inst -mattr=+ptr64
#0 0x000000010086f280 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/llvm-mc+0x1005af280)
#1 0x000000010086d4a4 llvm::sys::RunSignalHandlers() (/usr/local/bin/llvm-mc+0x1005ad4a4)
#2 0x000000010086fd30 SignalHandler(int, __siginfo*, void*) (/usr/local/bin/llvm-mc+0x1005afd30)
#3 0x0000000185500624 (/usr/lib/system/libsystem_platform.dylib+0x1804ac624)
#4 0x00000001854c688c (/usr/lib/system/libsystem_pthread.dylib+0x18047288c)
#5 0x00000001853cfc60 (/usr/lib/system/libsystem_c.dylib+0x18037bc60)
#6 0x00000001853ceeec (/usr/lib/system/libsystem_c.dylib+0x18037aeec)
#7 0x0000000100926570 AsLexInput(llvm::SourceMgr&, llvm::MCAsmInfo&, llvm::raw_ostream&) (.cold.3) (/usr/local/bin/llvm-mc+0x100666570)
#8 0x00000001005d79ec llvm::MipsInstPrinter::printOperand(llvm::MCInst const*, unsigned int, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) (/usr/local/bin/llvm-mc+0x1003179ec)
#9 0x00000001005d7cac llvm::MipsInstPrinter::printMemOperand(llvm::MCInst const*, int, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) (/usr/local/bin/llvm-mc+0x100317cac)
#10 0x00000001005d9300 llvm::MipsInstPrinter::printInst(llvm::MCInst const*, unsigned long long, llvm::StringRef, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) (/usr/local/bin/llvm-mc+0x100319300)
#11 0x000000010076ae70 (anonymous namespace)::MCAsmStreamer::emitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&) (/usr/local/bin/llvm-mc+0x1004aae70)
#12 0x00000001002c98dc llvm::Disassembler::disassemble(llvm::Target const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, llvm::MCSubtargetInfo&, llvm::MCStreamer&, llvm::MemoryBuffer&, llvm::SourceMgr&, llvm::MCContext&, llvm::MCTargetOptions const&, bool, unsigned int) (/usr/local/bin/llvm-mc+0x1000098dc)
#13 0x00000001002c30f4 main (/usr/local/bin/llvm-mc+0x1000030f4)
#14 0x0000000185126b98