summary refs log tree commit diff stats
path: root/results/classifier/semantic-bugs/2175
blob: 874c3bcded4a4193b490384708dec89f9e2ce5f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
instruction: 0.883
device: 0.776
graphic: 0.745
assembly: 0.701
network: 0.686
vnc: 0.644
other: 0.619
socket: 0.611
mistranslation: 0.593
KVM: 0.567
semantic: 0.514
boot: 0.511

Intel BLSI CF computation bug
Description of problem:
CF flag computation of BLSI instruction is wrong. It seems #1370 was not completely fixed.
Steps to reproduce:
1. Compile `example.c` using this command: `gcc -o example.bin example.c`. My gcc version is 12.3.0, but other versions may work.
```
int main() {
  __asm__ (
    "movq $0x1, %r8\n"
    "mov $0xedbf530a, %r9\n"
    "push $0x1\n"
    "popf\n"
    "blsi %r9d, %r8d\n"
    "pushf\n"
    "pop %rax\n"
    "pop %rbp\n"
    "ret\n"
  );

  return 0;
}
```
2. Run `./example.bin`. Then check the return code using `echo $?`. It should be 3.
```
$ ./example.bin
$ echo $?
3
```
3. Run `./qemu-x86_64 ./example.bin`. Then check the return code using `echo $?`. It should be 2.
```
$ ./qemu-x86_64 ./example.bin
$ echo $?
2
```

The return code of `./example.bin` contains the value of the `RFLAGS` register after executing the `BLSI` instruction.
Additional information: