microsoft / llvm-mctoll

llvm-mctoll
Other
814 stars 123 forks source link

Run llvm-mctoll occurs error #29

Open leepeter2019 opened 5 years ago

leepeter2019 commented 5 years ago

Hi, I test llvm-mctoll on Juliet database (Juliet Test Suite for C/C++) https://samate.nist.gov/SARD/testsuite.php but it has error message when i run llvm-mctoll on binary

./llvm-mctoll ~/test/mctoll/double_pointer_18_v2/CWE457 llvm-mctoll: /home/vmware/src/llvm-project/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiser.cpp:645: unsigned int X86MachineInstructionRaiser::find64BitSuperReg(unsigned int): Assertion SuperRegFound && "Super register not found"' failed.

do you know what this means "Assertion SuperRegFound && "Super register not found"' failed.`" and how to fix it? I tested it on Ubuntu 16 and 18, I had the same result.

I also test on dynist and ls binary. it provided the different error message and it failed to convert to IR

./llvm-mctoll ~/dyninst/bin/cfg_to_dot llvm-mctoll: /home/vmware/src/llvm-project/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiser.cpp:1425: llvm::Value* X86MachineInstructionRaiser::getMemoryAddressExprValue(const llvm::MachineInstr&): Assertion MI.getOperand(MemoryRefOpIndex + X86::AddrSegmentReg).getReg() == X86::NoRegister && "Expect no segment register"' failed.

./llvm-mctoll -d ~/Desktop/ls llvm-mctoll: /home/vmware/src/llvm-project/llvm/tools/llvm-mctoll/X86/X86JumpTables.cpp:221: bool X86MachineInstructionRaiser::raiseMachineJumpTable(): Assertion (JmpTblBaseCalcMBB.pred_size() == 1) && "Expect a single predecessor during jump table discovery"' failed.

bharadwajy commented 5 years ago

Thanks for checking out the tool and reporting the failures.

  1. Support to raise instructions that use XMM registers is not yet implemented. I suspect the first assertion is a result of attempting to raise a binary with such instructions.
  2. Construction of CFG of a binary with indirect (i.e., register-based) branching is not yet fully supported. The second assert may be a consequence of this lack of support.

Raising C++ binaries is not yet implemented or tested. As a result, detection of any C++ abstractions (such as exception handling) needs to be implemented. This could be one of the reasons for the second assertion.

We plan to address these issues as we make progress on the project. Any help is highly appreciated.

leepeter2019 commented 5 years ago

Thanks you for explanation. I hope the progress of your project makes some progress soon.

aaronsm commented 5 years ago

The second issue with the jump table will be fixed soon and is the same issued reported in https://github.com/microsoft/llvm-mctoll/issues/20