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

/bin/ls, /bin/cat/, /bin/... - raising doesn't work at all. #75

Open
mitp0sh opened this issue Jun 18, 2020 · 2 comments
Open

/bin/ls, /bin/cat/, /bin/... - raising doesn't work at all. #75

mitp0sh opened this issue Jun 18, 2020 · 2 comments

Comments

@mitp0sh
Copy link

mitp0sh commented Jun 18, 2020

Hello,

I have build everything according to the github instructions (I did use the right LLVM version). I build everything on Ubuntu 20. My mctoll checkout was based on following commit:

ff877f4

I have tried to raise any binary from /bin/* but it doesn't work. I always get following error:

`test@ubuntu:~/Desktop/llvm-project/build/bin$ ./llvm-mctoll -print-after-all -d /bin/cat

; /bin/cat: file format elf64-x86-64

Disassembling section

Function :
Parsed MCInst List
Generated CFG
llvm-mctoll: /home/test/Desktop/llvm-project/llvm/tools/llvm-mctoll/X86/X86JumpTables.cpp:259: bool X86MachineInstructionRaiser::raiseMachineJumpTable(): Assertion JmpTblBaseCalcMBBTermInst != nullptr && "Branch instruction terminating basic block computing jump table " "base not found"' failed. #0 0x000055f3cc99ca7e llvm::sys::PrintStackTrace(llvm::raw_ostream&) (./llvm-mctoll+0xf80a7e) #1 0x000055f3cc99a9e4 llvm::sys::RunSignalHandlers() (./llvm-mctoll+0xf7e9e4) #2 0x000055f3cc99ab28 SignalHandler(int) (./llvm-mctoll+0xf7eb28) #3 0x00007f04633e33c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0) #4 0x00007f0462ed518b raise /build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1 #5 0x00007f0462eb4859 abort /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81:7 #6 0x00007f0462eb4729 get_sysdep_segment_value /build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:509:8 #7 0x00007f0462eb4729 _nl_load_domain /build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:970:34 #8 0x00007f0462ec5f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36) #9 0x000055f3cc9bd35e X86MachineInstructionRaiser::raiseMachineJumpTable() (./llvm-mctoll+0xfa135e) #10 0x000055f3cc9c8430 X86MachineInstructionRaiser::getRaisedFunctionPrototype() (./llvm-mctoll+0xfac430) #11 0x000055f3cbc8d8e2 ModuleRaiser::runMachineFunctionPasses() (./llvm-mctoll+0x2718e2) #12 0x000055f3cbc4fb48 DisassembleObject(llvm::object::ObjectFile const*, bool) (.constprop.0) (./llvm-mctoll+0x233b48) #13 0x000055f3cbc0758c main (./llvm-mctoll+0x1eb58c) #14 0x00007f0462eb60b3 __libc_start_main /build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:342:3 #15 0x000055f3cbc3c82e _start (./llvm-mctoll+0x22082e) PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace. Stack dump: 0. Program arguments: ./llvm-mctoll -print-after-all -d /bin/cat Aborted (core dumped)
Any other binary, than cat will result in a similar looking core dump.

Is this know behaviour? What can I do to make it work?

mitp0sh

@thatreguy
Copy link

With /bin/echo I trigger a different assertion:

root@ubuntu-s-1vcpu-1gb-amd-sgp1-01:~/llvm-project# build/bin/llvm-mctoll -d /bin/echo
llvm-mctoll: /root/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:500: const llvm::MachineOperand& llvm::MachineInstr::getOperand(unsigned int) const: Assertion `i < getNumOperands() && "getOperand() out of range!"' failed.
 #0 0x00005632719e3d00 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (.localalias) /root/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:22
 #1 0x00005632719e3dbb PrintStackTraceSignalHandler(void*) /root/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x00005632719e1a27 llvm::sys::RunSignalHandlers() (.localalias) /root/llvm-project/llvm/lib/Support/Signals.cpp:97:20
 #3 0x00005632719e364c SignalHandler(int) /root/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007fabbb4c03c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x00007fabbaf6518b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007fabbaf44859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
 #7 0x00007fabbaf44729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
 #8 0x00007fabbaf44729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
 #9 0x00007fabbaf55f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#10 0x0000563270327f9d llvm::MachineInstr::getOperand(unsigned int) const /root/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:500:5
#11 0x0000563270326c6e MCInstRaiser::getMCInstIndex(llvm::MachineInstr const&) const (.localalias) /root/llvm-project/llvm/tools/llvm-mctoll/MCInstRaiser.cpp:302:53
#12 0x00005632703269c3 MCInstRaiser::getMBBNumberOfMCInstOffset(unsigned long, llvm::MachineFunction&) const /root/llvm-project/llvm/tools/llvm-mctoll/MCInstRaiser.cpp:264:41
#13 0x0000563271a2b90f X86MachineInstructionRaiser::raiseMachineJumpTable() /root/llvm-project/llvm/tools/llvm-mctoll/X86/X86JumpTables.cpp:102:56
#14 0x0000563271a3caad X86MachineInstructionRaiser::getRaisedFunctionPrototype() /root/llvm-project/llvm/tools/llvm-mctoll/X86/X86FuncPrototypeDiscovery.cpp:192:7
#15 0x000056327031d891 ModuleRaiser::runMachineFunctionPasses() /root/llvm-project/llvm/tools/llvm-mctoll/ModuleRaiser.cpp:108:69
#16 0x00005632701d7a89 DisassembleObject(llvm::object::ObjectFile const*, bool) /root/llvm-project/llvm/tools/llvm-mctoll/llvm-mctoll.cpp:1420:38
#17 0x00005632701d8538 DumpObject(llvm::object::ObjectFile*, llvm::object::Archive const*) /root/llvm-project/llvm/tools/llvm-mctoll/llvm-mctoll.cpp:1492:1
#18 0x00005632701d8b76 DumpInput(llvm::StringRef) /root/llvm-project/llvm/tools/llvm-mctoll/llvm-mctoll.cpp:1552:19
#19 0x00005632701ebeb6 void (*std::for_each<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, void (*)(llvm::StringRef)>(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, void (*)(llvm::StringRef)))(llvm::StringRef) /usr/include/c++/9/bits/stl_algo.h:3875:33
#20 0x00005632701d8f75 main /root/llvm-project/llvm/tools/llvm-mctoll/llvm-mctoll.cpp:1619:10
#21 0x00007fabbaf460b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#22 0x00005632701d1c7e _start (build/bin/llvm-mctoll+0x961c7e)

*** Please submit an issue at https://github.com/microsoft/llvm-mctoll
*** along with a back trace and a reproducer, if possible.
Stack dump:
0.      Program arguments: build/bin/llvm-mctoll -d /bin/echo
Aborted (core dumped)

@dominictarr
Copy link

also got this

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

3 participants