Opened 47 years ago
Closed 4 years ago
#1 closed defect (fixed)
INSIGHT translating floating point instructions silently fails
Reported by: | awruef@… | Owned by: | fleury |
---|---|---|---|
Priority: | major | Version: | 0.1 |
Keywords: | floating, decoder | Cc: |
Description
consider the following:
$ cat float_c.c
#include <stdlib.h>
#include <stdio.h>
float k(float a, float b) {
return a+b;
}
int main(int argc, char *argv[]) {
}
$ gcc -m32 -o float_c float_c.c
$ objdump -d float_c
[many lines omitted]
08048424 <k>:
8048424: 55 push %ebp
8048425: 89 e5 mov %esp,%ebp
8048427: d9 45 08 flds 0x8(%ebp)
804842a: d8 45 0c fadds 0xc(%ebp)
804842d: 5d pop %ebp
804842e: c3 ret
$ ./tools/cfgrecovery/cfgrecovery -d recursive -e 0x08048424 lift_tests/float_c
[(0x8048424,0)] @{asm:=push %ebp}@ %esp{0;32} := (SUB %esp{0;32} 0x4{0;32}){0;32}
[(0x8048424,1)] StaticArrow? (0x8048424,1) [%esp{0;32}]{0;32} := %ebp{0;32} --> (0x8048425,0)
[(0x8048425,0)] @{asm:=mov %esp,%ebp}@ StaticArrow? (0x8048425,0) %ebp{0;32} := %esp{0;32} --> (0x8048427,0)
[(0x8048427,0)]
And there cfgrecovery stops. The disassembler / decoder doesn't throw an error, it just leaves quietly and gives back a seemingly-valid Microcode object.
is there something I'm missing, perhaps?
Attachments (0)
Change History (2)
comment:1 follow-up: ↓ 2 Changed 47 years ago by fleury
- Owner set to fleury
- Status changed from new to assigned
- Version set to 0.1
comment:2 in reply to: ↑ 1 Changed 4 years ago by point
- Resolution set to fixed
- Status changed from assigned to closed
Replying to fleury:
I confirm the bug.
Insight should throw an "UnknownInstruction?" exception (or maybe a "UnhandledInstruction?" exception).
And, on the tool-side (cfgrecovery), there must be a warning message telling the user that not all the instructions have been decoded successfully.
It wasn't actually a bug. Decoding error was displayed only in verbose mode i.e., with option -v. I fixed this behaviour. From now on cfgrecovery should display Decoder exceptions as errors.
I confirm the bug.
Insight should throw an "UnknownInstruction?" exception (or maybe a "UnhandledInstruction?" exception).
And, on the tool-side (cfgrecovery), there must be a warning message telling the user that not all the instructions have been decoded successfully.
I will try to fix this asap.
Thanks a lot for reporting.