radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.71k stars 3.01k forks source link

Segfault on r_core_cmd_substr_i() when loading '. ~/script.r2' from ~/.config/radare2/radare2rc #319

Closed XVilka closed 11 years ago

XVilka commented 11 years ago

valgrind file is here http://xvilka.me/r2-loadfile.log

Remote debugging using | vgdb relaying data between gdb and process 12015 Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug/lib/ld-2.17.so.debug...done. done. Loaded symbols for /lib/ld-linux.so.2 --------------------------------------------------------------------------egs] EAX: 0x00000000 EBX: 0x00000000 ECX: 0x00000000 EDX: 0x00000000 o d i t s z a p c ESI: 0x00000000 EDI: 0x00000000 EBP: 0x00000000 ESP: 0xB68A2DA0 EIP: 0x04001270 CS: 7B0073 DS: 7B007B ES: 007B FS: 0000 GS: 7B0000 SS: 007B --------------------------------------------------------------------------ode] => 0x4001270 <_start>: mov %esp,%eax 0x4001272 <_start+2>: call 0x4004a20 <_dl_start> 0x4001277 <_dl_start_user>: mov %eax,%edi 0x4001279 <_dl_start_user+2>: call 0x4001260 0x400127e <_dl_start_user+7>: add $0x1fd42,%ebx 0x4001284 <_dl_start_user+13>: mov -0x16c(%ebx),%eax 0x400128a <_dl_start_user+19>: pop %edx

0x400128b <_dl_start_user+20>: lea (%esp,%eax,4),%esp

0x04001270 in _start () from /lib/ld-linux.so.2 Continuing.

Program received signal SIGSEGV, Segmentation fault. --------------------------------------------------------------------------egs] EAX: 0x0010F120 EBX: 0x048CB260 ECX: 0x0000003B EDX: 0x06E50958 o d i t S z a P c ESI: 0x00000000 EDI: 0x06E50958 EBP: 0x0010F120 ESP: 0xB60A4E50 EIP: 0x0488D6B5 CS: 7B0073 DS: 7B007B ES: 007B FS: B0000 GS: 7B000B SS: 007B --------------------------------------------------------------------------ode] => 0x488d6b5 <r_core_cmd_subst_i+21>: mov %edx,(%esp) 0x488d6b8 <r_core_cmd_subst_i+24>: mov %eax,0x2c(%esp) 0x488d6bc <r_core_cmd_subst_i+28>: mov %gs:0x14,%eax 0x488d6c2 <r_core_cmd_subst_i+34>: mov %eax,0x45c(%esp) 0x488d6c9 <r_core_cmd_subst_i+41>: xor %eax,%eax 0x488d6cb <r_core_cmd_subst_i+43>: call 0x486c880 r_str_trim_head_tail@plt 0x488d6d0 <r_core_cmd_subst_i+48>: mov %eax,%esi 0x488d6d2 <r_core_cmd_subst_i+50>: movzbl (%eax),%eax -------------------------------------------------------------------------------- r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x6e50958 ". ~/.config/radare2/radare2rc") at cmd.c:832 832 cmd = r_str_trim_head_tail (cmd); core = 0x10f120 cmd = 0x6e50958 ". ~/.config/radare2/radare2rc" quotestr = 0x48b3f22 "`" ptr = ptr2 = str = arroba = i = ret = pipefd = usemyblock = Undefined info command: "regs". Try "help info". eax 0x10f120 0x10f120 ecx 0x3b 0x3b edx 0x6e50958 0x6e50958 ebx 0x48cb260 0x48cb260 esp 0xb60a4e50 0xb60a4e50 ebp 0x10f120 0x10f120 esi 0x0 0x0 edi 0x6e50958 0x6e50958 eip 0x488d6b5 0x488d6b5 <r_core_cmd_subst_i+21> eflags 0x84 [ PF SF ] cs 0x7b0073 0x7b0073 ss 0x7b 0x7b ds 0x7b007b 0x7b007b es 0x7b 0x7b fs 0xb0000 0xb0000 gs 0x7b000b 0x7b000b

XVilka commented 11 years ago

Here is backtrace:

49832 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x6983928 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49833 0x0488c1d8 in r_core_cmd_lines (lines=0x69838c8 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49834 r_core_cmd_lines (core=0x10f120 , lines=0x69838c8 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49835 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x6982582 "~/.config/radare2/radare2rc") at cmd.c:1437

49836 0x0488cb0c in r_core_run_script (file=0x6982582 "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49837 r_core_run_script (core=0x10f120 , file=0x6982582 "~/.config/radare2/radare2rc") at cmd.c:298

49838 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x6982581 " ~/.config/radare2/radare2rc") at cmd.c:375

49839 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x6982580 ". ~/.config/radare2/radare2rc") at cmd.c:166

49840 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x6982580 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49841 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x6982580 ". ~/.config/radare2/radare2rc", cmd@entry=0x6981530 ".

~/.config/radare2/radare2rc") at cmd.c:798

49842 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x69814d0 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49843 0x0488c1d8 in r_core_cmd_lines (lines=0x6981470 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49844 r_core_cmd_lines (core=0x10f120 , lines=0x6981470 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49845 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x698012a "~/.config/radare2/radare2rc") at cmd.c:1437

49846 0x0488cb0c in r_core_run_script (file=0x698012a "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49847 r_core_run_script (core=0x10f120 , file=0x698012a "~/.config/radare2/radare2rc") at cmd.c:298

49848 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x6980129 " ~/.config/radare2/radare2rc") at cmd.c:375

49849 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x6980128 ". ~/.config/radare2/radare2rc") at cmd.c:166

49850 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x6980128 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49851 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x6980128 ". ~/.config/radare2/radare2rc", cmd@entry=0x697f0d8 ".

~/.config/radare2/radare2rc") at cmd.c:798

49852 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697f078 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49853 0x0488c1d8 in r_core_cmd_lines (lines=0x697f018 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49854 r_core_cmd_lines (core=0x10f120 , lines=0x697f018 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49855 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x697dcd2 "~/.config/radare2/radare2rc") at cmd.c:1437

49856 0x0488cb0c in r_core_run_script (file=0x697dcd2 "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49857 r_core_run_script (core=0x10f120 , file=0x697dcd2 "~/.config/radare2/radare2rc") at cmd.c:298

49858 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x697dcd1 " ~/.config/radare2/radare2rc") at cmd.c:375

49859 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x697dcd0 ". ~/.config/radare2/radare2rc") at cmd.c:166

49860 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x697dcd0 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49861 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x697dcd0 ". ~/.config/radare2/radare2rc", cmd@entry=0x697cc80 ".

~/.config/radare2/radare2rc") at cmd.c:798

49862 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697cc20 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49863 0x0488c1d8 in r_core_cmd_lines (lines=0x697cbc0 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49864 r_core_cmd_lines (core=0x10f120 , lines=0x697cbc0 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49865 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x697b87a "~/.config/radare2/radare2rc") at cmd.c:1437

49866 0x0488cb0c in r_core_run_script (file=0x697b87a "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49867 r_core_run_script (core=0x10f120 , file=0x697b87a "~/.config/radare2/radare2rc") at cmd.c:298

49868 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x697b879 " ~/.config/radare2/radare2rc") at cmd.c:375

49869 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x697b878 ". ~/.config/radare2/radare2rc") at cmd.c:166

49870 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x697b878 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49871 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x697b878 ". ~/.config/radare2/radare2rc", cmd@entry=0x697a828 ".

~/.config/radare2/radare2rc") at cmd.c:798

49872 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697a7c8 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49873 0x0488c1d8 in r_core_cmd_lines (lines=0x697a768 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49874 r_core_cmd_lines (core=0x10f120 , lines=0x697a768 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49875 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x6979458 "/home/xvilka//.config/radare2/radare2rc") at cmd.c:1437

49876 0x0010b5b9 in main (argc=0x2, argv=0xb7db1da4) at radare2.c:442

gdb$ q

radare commented 11 years ago

Infinite loading of the same file?

On 08 Nov 2013, at 01:59, Anton Kochkov notifications@github.com wrote:

Here is backtrace:

49832 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x6983928 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49833 0x0488c1d8 in r_core_cmd_lines (lines=0x69838c8 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49834 r_core_cmd_lines (core=0x10f120 , lines=0x69838c8 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49835 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x6982582 "~/.config/radare2/radare2rc") at cmd.c:1437

49836 0x0488cb0c in r_core_run_script (file=0x6982582 "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49837 r_core_run_script (core=0x10f120 , file=0x6982582 "~/.config/radare2/radare2rc") at cmd.c:298

49838 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x6982581 " ~/.config/radare2/radare2rc") at cmd.c:375

49839 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x6982580 ". ~/.config/radare2/radare2rc") at cmd.c:166

49840 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x6982580 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49841 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x6982580 ". ~/.config/radare2/radare2rc", cmd@entry=0x6981530 ".

~/.config/radare2/radare2rc") at cmd.c:798

49842 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x69814d0 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49843 0x0488c1d8 in r_core_cmd_lines (lines=0x6981470 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49844 r_core_cmd_lines (core=0x10f120 , lines=0x6981470 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49845 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x698012a "~/.config/radare2/radare2rc") at cmd.c:1437

49846 0x0488cb0c in r_core_run_script (file=0x698012a "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49847 r_core_run_script (core=0x10f120 , file=0x698012a "~/.config/radare2/radare2rc") at cmd.c:298

49848 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x6980129 " ~/.config/radare2/radare2rc") at cmd.c:375

49849 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x6980128 ". ~/.config/radare2/radare2rc") at cmd.c:166

49850 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x6980128 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49851 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x6980128 ". ~/.config/radare2/radare2rc", cmd@entry=0x697f0d8 ".

~/.config/radare2/radare2rc") at cmd.c:798

49852 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697f078 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49853 0x0488c1d8 in r_core_cmd_lines (lines=0x697f018 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49854 r_core_cmd_lines (core=0x10f120 , lines=0x697f018 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49855 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x697dcd2 "~/.config/radare2/radare2rc") at cmd.c:1437

49856 0x0488cb0c in r_core_run_script (file=0x697dcd2 "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49857 r_core_run_script (core=0x10f120 , file=0x697dcd2 "~/.config/radare2/radare2rc") at cmd.c:298

49858 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x697dcd1 " ~/.config/radare2/radare2rc") at cmd.c:375

49859 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x697dcd0 ". ~/.config/radare2/radare2rc") at cmd.c:166

49860 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x697dcd0 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49861 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x697dcd0 ". ~/.config/radare2/radare2rc", cmd@entry=0x697cc80 ".

~/.config/radare2/radare2rc") at cmd.c:798

49862 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697cc20 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49863 0x0488c1d8 in r_core_cmd_lines (lines=0x697cbc0 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49864 r_core_cmd_lines (core=0x10f120 , lines=0x697cbc0 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49865 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x697b87a "~/.config/radare2/radare2rc") at cmd.c:1437

49866 0x0488cb0c in r_core_run_script (file=0x697b87a "~/.config/radare2/radare2rc", core=0x10f120 ) at cmd.c:323

49867 r_core_run_script (core=0x10f120 , file=0x697b87a "~/.config/radare2/radare2rc") at cmd.c:298

49868 0x0488e9ff in cmd_interpret (data=0x10f120 , input=0x697b879 " ~/.config/radare2/radare2rc") at cmd.c:375

49869 0x04a4fd6f in r_cmd_call (cmd=0x4edd5d8, input=0x697b878 ". ~/.config/radare2/radare2rc") at cmd.c:166

49870 0x0488e230 in r_core_cmd_subst_i (core=core@entry=0x10f120 , cmd=cmd@entry=0x697b878 ". ~/.config/radare2/radare2rc") at cmd.c:1214

49871 0x0487ac7d in r_core_cmd_subst (core=core@entry=0x10f120 , cmd=0x697b878 ". ~/.config/radare2/radare2rc", cmd@entry=0x697a828 ".

~/.config/radare2/radare2rc") at cmd.c:798

49872 0x0487aec3 in r_core_cmd (core=core@entry=0x10f120 , cstr=cstr@entry=0x697a7c8 ". ~/.config/radare2/radare2rc", log=log@entry=0x0) at cmd.c:1383

49873 0x0488c1d8 in r_core_cmd_lines (lines=0x697a768 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n", core=0x10f120 ) at cmd.c:1409

49874 r_core_cmd_lines (core=0x10f120 , lines=0x697a768 ". ~/.config/radare2/radare2rc\ne scr.utf8=true\n") at cmd.c:1399

49875 0x0488c334 in r_core_cmd_file (core=0x10f120 , file=0x6979458 "/home/xvilka//.config/radare2/radare2rc") at cmd.c:1437

49876 0x0010b5b9 in main (argc=0x2, argv=0xb7db1da4) at radare2.c:442

gdb$ q

— Reply to this email directly or view it on GitHub.

XVilka commented 11 years ago

Yes.