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

0.9.8 release goodness. #1662

Closed
montekki opened this issue Nov 10, 2014 · 2 comments
Closed

0.9.8 release goodness. #1662

montekki opened this issue Nov 10, 2014 · 2 comments

Comments

@montekki
Copy link
Contributor

  1. Build is bokken, here is a patch to fix it:
diff --git a/libr/asm/p/asm_x86_udis.c b/libr/asm/p/asm_x86_udis.c
index 739a30a..d799161 100644
--- a/libr/asm/p/asm_x86_udis.c
+++ b/libr/asm/p/asm_x86_udis.c
@@ -66,7 +66,7 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
        return opsize;
 }

-RAsmPlugin r_asm_plugin_x86 = {
+RAsmPlugin r_asm_plugin_x86_udis = {
        .name = "x86.udis",
        .desc = "udis86 x86-16,32,64",
        .arch = "x86",
@@ -82,6 +82,6 @@ RAsmPlugin r_asm_plugin_x86 = {
 #ifndef CORELIB
 struct r_lib_struct_t radare_plugin = {
        .type = R_LIB_TYPE_ASM,
-       .data = &r_asm_plugin_x86
+       .data = &r_asm_plugin_x86_udis
 };
 #endif
diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h
index fe567c0..4c4bade 100644
--- a/libr/include/r_asm.h
+++ b/libr/include/r_asm.h
@@ -161,7 +161,7 @@ extern RAsmPlugin r_asm_plugin_bf;
 extern RAsmPlugin r_asm_plugin_java;
 extern RAsmPlugin r_asm_plugin_mips_gnu;
 extern RAsmPlugin r_asm_plugin_mips_cs;
-extern RAsmPlugin r_asm_plugin_x86;
+extern RAsmPlugin r_asm_plugin_x86_udis;
 extern RAsmPlugin r_asm_plugin_x86_as;
 extern RAsmPlugin r_asm_plugin_x86_nz;
 extern RAsmPlugin r_asm_plugin_x86_olly;

Secondly, capstone segfaults:

theodor@agamemnon:radare2$ gdb --args r2 /bin/ls
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from r2...done.
(gdb) r
Starting program: /home/theodor/myprefix/bin/r2 /bin/ls
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 -- Enable asm.trace to see the tracing information inside the disassembly
[0x00404890]> aa

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68d199e in translateInstruction (mcInst=0x7fffffffa160, insn=0x7fffffff94f0)
    at arch/X86/X86Disassembler.c:647
647                     if (insn->operands[index].encoding != ENCODING_NONE) {
(gdb) bt
#0  0x00007ffff68d199e in translateInstruction (mcInst=0x7fffffffa160, insn=0x7fffffff94f0)
    at arch/X86/X86Disassembler.c:647
#1  0x00007ffff68d1fdc in X86_getInstruction (ud=9797456, 
    code=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", code_len=4096, 
    instr=0x7fffffffa160, size=0x7fffffff9f3e, address=4212880, _info=0x0)
    at arch/X86/X86Disassembler.c:776
#2  0x00007ffff67e94ea in cs_disasm_iter (ud=9797456, code=0x7fffffffa4d0, size=0x7fffffffa510, 
    address=0x7fffffffa4d8, insn=0x959fe0) at cs.c:679
#3  0x00007ffff67bff3c in analop (a=0x6807f0, op=0x7fffffffa650, addr=4212880, 
    buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096)
    at /home/theodor/github/radare2/libr/..//libr/anal/p/anal_x86_cs.c:45
#4  0x00007ffff67cfe1f in r_anal_op (anal=0x6807f0, op=0x7fffffffa650, addr=4212880, 
    data=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096)
    at op.c:46
#5  0x00007ffff67d1e8e in fcn_recurse (anal=0x6807f0, fcn=0x95a4a0, addr=4212880, 
    buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096, depth=16)
    at fcn.c:254
#6  0x00007ffff67d2c1c in r_anal_fcn (anal=0x6807f0, fcn=0x95a4a0, addr=4212880, 
    buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096, 
    reftype=0) at fcn.c:498
#7  0x00007ffff7b8a921 in r_core_anal_fcn (core=0x607560 <r>, at=4212880, 
    from=18446744073709551615, reftype=0, depth=16) at anal.c:779
#8  0x00007ffff7b8d6f2 in r_core_anal_all (core=0x607560 <r>) at anal.c:1521
#9  0x00007ffff7b47024 in cmd_anal (data=0x607560 <r>, input=0x949601 "a") at cmd_anal.c:1852
#10 0x00007ffff7b8660d in r_cmd_call (cmd=0x6a97a0, input=0x949600 "aa") at cmd_api.c:179
#11 0x00007ffff7b64b1c in r_core_cmd_subst_i (core=0x607560 <r>, cmd=0x949600 "aa") at cmd.c:1366
#12 0x00007ffff7b62f7e in r_core_cmd_subst (core=0x607560 <r>, cmd=0x949600 "aa") at cmd.c:919
#13 0x00007ffff7b657e9 in r_core_cmd (core=0x607560 <r>, cstr=0x6d3910 "aa", log=1) at cmd.c:1572
#14 0x00007ffff7b2be7b in r_core_prompt_exec (r=0x607560 <r>) at core.c:949
#15 0x0000000000404fa1 in main (argc=2, argv=0x7fffffffdfc8, envp=0x7fffffffdfe0)
    at radare2.c:714
(gdb)
@montekki montekki added this to the 0.9.8 milestone Nov 10, 2014
@montekki montekki added the RAnal label Nov 10, 2014
@radare
Copy link
Collaborator

radare commented Nov 10, 2014

cant reproduce that crash. did you recomopiled with sys/install.sh?.
that crash looks like reading out of bounds. can you buid with asan and
show backtrace (or test valgrind=)?

On 11/10/2014 07:54 AM, Fedor Sakharov wrote:

  1. Build is bokken, here is a patch to fix it:

|diff --git a/libr/asm/p/asm_x86_udis.c b/libr/asm/p/asm_x86_udis.c
index 739a30a..d799161 100644
--- a/libr/asm/p/asm_x86_udis.c
+++ b/libr/asm/p/asm_x86_udis.c
@@ -66,7 +66,7 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
return opsize;
}

-RAsmPlugin r_asm_plugin_x86 = {
+RAsmPlugin r_asm_plugin_x86_udis = {
.name = "x86.udis",
.desc = "udis86 x86-16,32,64",
.arch = "x86",
@@ -82,6 +82,6 @@ RAsmPlugin r_asm_plugin_x86 = {
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,

  •   .data = &r_asm_plugin_x86
    
  •   .data = &r_asm_plugin_x86_udis
    
    };
    #endif
    diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h
    index fe567c0..4c4bade 100644
    --- a/libr/include/r_asm.h
    +++ b/libr/include/r_asm.h
    @@ -161,7 +161,7 @@ extern RAsmPlugin r_asm_plugin_bf;
    extern RAsmPlugin r_asm_plugin_java;
    extern RAsmPlugin r_asm_plugin_mips_gnu;
    extern RAsmPlugin r_asm_plugin_mips_cs;
    -extern RAsmPlugin r_asm_plugin_x86;
    +extern RAsmPlugin r_asm_plugin_x86_udis;
    extern RAsmPlugin r_asm_plugin_x86_as;
    extern RAsmPlugin r_asm_plugin_x86_nz;
    extern RAsmPlugin r_asm_plugin_x86_olly;
    |

Secondly, capstone segfaults:

|theodor@agamemnon:radare2$ gdb --args r2 /bin/ls
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from r2...done.
(gdb) r
Starting program: /home/theodor/myprefix/bin/r2 /bin/ls
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
-- Enable asm.trace to see the tracing information inside the disassembly
[0x00404890]> aa

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68d199e in translateInstruction (mcInst=0x7fffffffa160, insn=0x7fffffff94f0)
at arch/X86/X86Disassembler.c:647
647 if (insn->operands[index].encoding != ENCODING_NONE) {
(gdb) bt
#0 0x00007ffff68d199e in translateInstruction (mcInst=0x7fffffffa160, insn=0x7fffffff94f0)
at arch/X86/X86Disassembler.c:647
#1 0x00007ffff68d1fdc in X86_getInstruction (ud=9797456,
code=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", code_len=4096,
instr=0x7fffffffa160, size=0x7fffffff9f3e, address=4212880, _info=0x0)
at arch/X86/X86Disassembler.c:776
#2 0x00007ffff67e94ea in cs_disasm_iter (ud=9797456, code=0x7fffffffa4d0, size=0x7fffffffa510,
address=0x7fffffffa4d8, insn=0x959fe0) at cs.c:679
#3 0x00007ffff67bff3c in analop (a=0x6807f0, op=0x7fffffffa650, addr=4212880,
buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096)
at /home/theodor/github/radare2/libr/..//libr/anal/p/anal_x86_cs.c:45
#4 0x00007ffff67cfe1f in r_anal_op (anal=0x6807f0, op=0x7fffffffa650, addr=4212880,
data=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096)
at op.c:46
#5 0x00007ffff67d1e8e in fcn_recurse (anal=0x6807f0, fcn=0x95a4a0, addr=4212880,
buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096, depth=16)
at fcn.c:254
#6 0x00007ffff67d2c1c in r_anal_fcn (anal=0x6807f0, fcn=0x95a4a0, addr=4212880,
buf=0x956e20 "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\320\036A", len=4096,
reftype=0) at fcn.c:498
#7 0x00007ffff7b8a921 in r_core_anal_fcn (core=0x607560 , at=4212880,
from=18446744073709551615, reftype=0, depth=16) at anal.c:779
#8 0x00007ffff7b8d6f2 in r_core_anal_all (core=0x607560 ) at anal.c:1521
#9 0x00007ffff7b47024 in cmd_anal (data=0x607560 , input=0x949601 "a") at cmd_anal.c:1852
#10 0x00007ffff7b8660d in r_cmd_call (cmd=0x6a97a0, input=0x949600 "aa") at cmd_api.c:179
#11 0x00007ffff7b64b1c in r_core_cmd_subst_i (core=0x607560 , cmd=0x949600 "aa") at cmd.c:1366
#12 0x00007ffff7b62f7e in r_core_cmd_subst (core=0x607560 , cmd=0x949600 "aa") at cmd.c:919
#13 0x00007ffff7b657e9 in r_core_cmd (core=0x607560 , cstr=0x6d3910 "aa", log=1) at cmd.c:1572
#14 0x00007ffff7b2be7b in r_core_prompt_exec (r=0x607560 ) at core.c:949
#15 0x0000000000404fa1 in main (argc=2, argv=0x7fffffffdfc8, envp=0x7fffffffdfe0)
at radare2.c:714
(gdb)
|


Reply to this email directly or view it on GitHub
#1662.

@montekki
Copy link
Contributor Author

ok closed

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

No branches or pull requests

2 participants