[LLVMbugs] [Bug 20993] New: Mips's disassembler crash on several inputs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 18 02:43:04 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20993

            Bug ID: 20993
           Summary: Mips's disassembler crash on several inputs
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: junkoi2004 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Some input crash Mips's disassembler

==========
$ echo "0xcc,0x00,0x00,0x00" | ./Release+Asserts/bin/llvm-mc -disassemble
-arch=mips

    .text
    pref    Assertion failed: (begin() + idx < end()), function operator[],
file /Users/jun/projects/llvm/mips-5.git/include/llvm/ADT/SmallVector.h, line
142.
0  llvm-mc                  0x000000010b201838
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  llvm-mc                  0x000000010b201d4b SignalHandler(int) + 635
2  libsystem_platform.dylib 0x00007fff883b45aa _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 2009381488
4  llvm-mc                  0x000000010b201ab6 abort + 22
5  llvm-mc                  0x000000010b201a91 __assert_rtn + 81
6  llvm-mc                  0x000000010b1ac4a3
llvm::MipsInstPrinter::printInstruction(llvm::MCInst const*,
llvm::raw_ostream&) + 4179
7  llvm-mc                  0x000000010b1ae96e
llvm::MipsInstPrinter::printInst(llvm::MCInst const*, llvm::raw_ostream&,
llvm::StringRef) + 478
8  llvm-mc                  0x000000010b1c127e (anonymous
namespace)::MCAsmStreamer::EmitInstruction(llvm::MCInst const&,
llvm::MCSubtargetInfo const&) + 2718
9  llvm-mc                  0x000000010b14bf43
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::raw_ostream&) + 1955
10 llvm-mc                  0x000000010b14e8cd main + 8189
11 libdyld.dylib            0x00007fff859a55fd start + 1
12 libdyld.dylib            0x0000000000000003 start + 2053483015
Stack dump:
0.    Program arguments: ./Release+Asserts/bin/llvm-mc -disassemble -arch=mips 
[1]    96776 done                          echo "0xcc,0x00,0x00,0x00" | 
       96777 illegal hardware instruction  ./Release+Asserts/bin/llvm-mc
-disassemble -arch=mips
=============

$ echo "0x00,0x00,0x00,0xcc" | ./Release+Asserts/bin/llvm-mc -disassemble
-arch=mipsel -show-encoding

    .text
llvm-mc: MipsMCCodeEmitter.cpp:588: unsigned int
llvm::MipsMCCodeEmitter::getMemEncoding(const llvm::MCInst&, unsigned int,
llvm::SmallVectorImpl<llvm::MCFixup>&, const llvm::MCSubtargetInfo&) const:
Assertion `MI.getOperand(OpNo).isReg()' failed.
0  llvm-mc         0x00000000004be9b2
1  llvm-mc         0x00000000004be571
2  libpthread.so.0 0x00007f8862a33340
3  libc.so.6       0x00007f8861a46bb9 gsignal + 57
4  libc.so.6       0x00007f8861a49fc8 abort + 328
5  libc.so.6       0x00007f8861a3fa76
6  libc.so.6       0x00007f8861a3fb22
7  llvm-mc         0x00000000004546f2
8  llvm-mc         0x0000000000458897
9  llvm-mc         0x0000000000459eb2
10 llvm-mc         0x0000000000470305
11 llvm-mc         0x0000000000470e08
12 llvm-mc         0x000000000040f974
13 llvm-mc         0x000000000040d13b
14 libc.so.6       0x00007f8861a31ec5 __libc_start_main + 245
15 llvm-mc         0x000000000040f0bd
Stack dump:
0.    Program arguments: ./Release+Asserts/bin/llvm-mc --disassemble
-arch=mipsel -show-encoding 
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/20140918/feb7f23f/attachment.html>


More information about the llvm-bugs mailing list