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

R2 loop on simple binary #14464

Closed
gotoco opened this issue Jul 1, 2019 · 5 comments
Closed

R2 loop on simple binary #14464

gotoco opened this issue Jul 1, 2019 · 5 comments

Comments

@gotoco
Copy link

gotoco commented Jul 1, 2019

Ubuntu 18.04, radare in version 9a72419f6623ad8ff2a38e73ac526ba630a683c3.
Fresh installation after: sys/install.sh

Simple hello world in C:

#include <stdio.h>

int main( int argc, char *argv[] )  {

   if( argc == 2 ) {
      printf("The argument supplied is %s\n", argv[1]);
   }
   else if( argc > 2 ) {
      printf("Too many arguments supplied.\n");
   }
   else {
      printf("One argument expected.\n");
   }
}

Compiled via gcc -g ./main.c

Run r2 for the binary in different ways, the same effect.
Simple command r2 ./a.out causes infinitive loop (CPU 100% utilized, after 2 h no progress)

Any idea what can cause such behaviour?

@radare
Copy link
Collaborator

radare commented Jul 2, 2019

cant reproduce. can you share the binary instead of the source? or attach gdb/lldb and get a backtrace?

@gotoco
Copy link
Author

gotoco commented Jul 2, 2019

backtrace from gdb, it is identical every time when I stop gdb seems like stuck in libc

#0  0x00007ffff7cb4b7f in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff7ec38f6 in r_str_replace (str=0x555555735960 "      printf(", '\\' <repeats 187 times>..., key=0x7ffff6e0269b "\"", val=0x7ffff6e02698 "\\\"", g=1) at str.c:930
#2  0x00007ffff6d43777 in bin_dwarf (core=0x7ffff7e1d080 <r>, mode=2) at cbin.c:925
#3  0x00007ffff6d4d70d in r_core_bin_info (core=0x7ffff7e1d080 <r>, action=5263359, mode=2, va=1, filter=0x0, chksum=0x0) at cbin.c:3609
#4  0x00007ffff6d40427 in r_core_bin_set_env (r=0x7ffff7e1d080 <r>, binfile=0x5555556d8280) at cbin.c:133
#5  0x00007ffff6d09604 in r_core_file_do_load_for_io_plugin (r=0x7ffff7e1d080 <r>, baseaddr=18446744073709551615, loadaddr=0) at cfile.c:404
#6  0x00007ffff6d09d88 in r_core_bin_load (r=0x7ffff7e1d080 <r>, filenameuri=0x5555556d9090 "a.out", baddr=18446744073709551615) at cfile.c:553
#7  0x00007ffff7e0c91c in r_main_radare2 (argc=2, argv=0x7fffffffdfe8) at radare2.c:1137
#8  0x000055555555540b in main (argc=2, argv=0x7fffffffdfe8) at radare2.c:95

Also in attachment binary but probably wont be useful as most likely is something with libraries. I am running fresh without any tricks Ubuntu.
a.elf.zip

@radare
Copy link
Collaborator

radare commented Jul 2, 2019 via email

@radare
Copy link
Collaborator

radare commented Jul 2, 2019 via email

@gotoco
Copy link
Author

gotoco commented Jul 2, 2019

Can confirm! After 7511d874 the issue is gone.

@gotoco gotoco closed this as completed Jul 3, 2019
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

2 participants