Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run llvm-mctoll occurs error #20

Open
skyel1u opened this issue Nov 23, 2018 · 6 comments
Open

Run llvm-mctoll occurs error #20

skyel1u opened this issue Nov 23, 2018 · 6 comments

Comments

@skyel1u
Copy link

skyel1u commented Nov 23, 2018

Hi, when I am trying to generate LLVM IR for ls, it cause errors as follows:
(ubuntu 16.04 x64 LTS)

build/llvm/bin 
➜ ./llvm-mctoll -d ~/Desktop/ls 
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
*** WARNING Out of range target not added.
./llvm-mctoll[0x30b2ae1]
./llvm-mctoll[0x30b2b72]
./llvm-mctoll[0x30b0adf]
./llvm-mctoll[0x30b2586]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fa669234390]
./llvm-mctoll[0x4ad5aa]
./llvm-mctoll[0x15e41ed]
./llvm-mctoll[0x15e45d3]
./llvm-mctoll[0x4a67fe]
./llvm-mctoll[0x41cdb8]
./llvm-mctoll[0x41f243]
./llvm-mctoll[0x41fa45]
./llvm-mctoll[0x433fcb]
./llvm-mctoll[0x4202aa]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fa6685d8830]
./llvm-mctoll[0x414f89]
Stack dump:
0.	Program arguments: ./llvm-mctoll -d /home/sk/Desktop/ls 
[1]    27055 segmentation fault (core dumped)  ./llvm-mctoll -d ~/Desktop/ls

And here is the binary's info:

build/llvm/bin 
➜ file ~/Desktop/ls
/home/sk/Desktop/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d0bc0fb9b3f60f72bbad3c5a1d24c9e2a1fde775, stripped
@bharadwajy
Copy link
Contributor

Thanks for reporting the failure. Will look at it.

@AndybnACT
Copy link

AndybnACT commented Dec 3, 2018

I have the same issue. The function X86MachineInstructionRaiser::getFunctionReturnType() may push a null pointer on WorkList if it didn't find a proper RetBlock, resulting a dereference of nullptr and crashes the program. However, fixing it by returning nullptr whenever RetBlock not found causes program to abort at X86MachineInstructionRaiser::raiseMachineJumpTable

@bharadwajy
Copy link
Contributor

Thanks for the additional detail.

I will incorporate fixes for this along with the addition of follow on support that is needed to identify memory accesses and the types of accessed data to abstract them as LLVM variables as appropriate. (Issue #21).

@archerbroler
Copy link

hi, when I use this tool to raise ls cmd, get core dump.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff676442a in __GI_abort () at abort.c:89
#2 0x00007ffff675be67 in __assert_fail_base (fmt=,
assertion=assertion@entry=0x555558082670 "tempFunctionPtr != nullptr && "Function not found in module list"",
file=file@entry=0x55555807bb60 "/home/liujingyang/src/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiser.cpp", line=line@entry=1677,
function=function@entry=0x555558084cc0 X86MachineInstructionRaiser::getRaisedFunctionPrototype()::__PRETTY_FUNCTION__ "virtual llvm::FunctionType* X86MachineInstructionRaiser::getRaisedFunctionPrototype()")
at assert.c:92
#3 0x00007ffff675bf12 in __GI___assert_fail (
assertion=0x555558082670 "tempFunctionPtr != nullptr && "Function not found in module list"",
file=0x55555807bb60 "/home/liujingyang/src/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiser.cpp",
line=1677,
function=0x555558084cc0 X86MachineInstructionRaiser::getRaisedFunctionPrototype()::__PRETTY_FUNCTION__ "virtual llvm::FunctionType* X86MachineInstructionRaiser::getRaisedFunctionPrototype()") at assert.c:101
#4 0x000055555672bd8e in X86MachineInstructionRaiser::getRaisedFunctionPrototype() ()
#5 0x0000555555a3c0ca in ModuleRaiser::runMachineFunctionPasses() ()
#6 0x0000555555a0668d in DisassembleObject(llvm::object::ObjectFile const*, bool) [clone .constprop.701] ()
#7 0x000055555597491e in main ()

@aaronsm
Copy link
Contributor

aaronsm commented Jul 11, 2019

This is the current problem I have with raising 'ls'.

Assertion failed: (JmpTblBaseCalcMBB.pred_size() == 1) && "Expect a single predecessor during jump table discovery", file d:\llvm-project\llvm\tools\llvm-mctoll\x86\x86jumptables.cpp, line 221

@aaronsm
Copy link
Contributor

aaronsm commented Oct 20, 2019

Another problem raising CMOV which is issue #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants