summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/none/1274
blob: 42fb7cc59410a784ebe9a7ac67f3f125fcbb7be3 (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
52
53
54
55
56
57
58
59
60
61
62
graphic: 0.769
debug: 0.743
device: 0.622
performance: 0.508
ppc: 0.494
PID: 0.470
boot: 0.426
x86: 0.412
mistranslation: 0.367
semantic: 0.353
architecture: 0.332
permissions: 0.316
assembly: 0.307
vnc: 0.288
kernel: 0.261
socket: 0.253
i386: 0.249
register: 0.219
hypervisor: 0.216
risc-v: 0.204
KVM: 0.184
network: 0.180
files: 0.153
VMM: 0.150
user-level: 0.137
TCG: 0.118
virtual: 0.118
peripherals: 0.115
arm: 0.108

Cannot debug init using "qemu -s -S" if init is compiled dynamically or if kvm is enabled
Description of problem:
I'm trying to connect from host to init process running in guest. I'm using this guide: https://qemu-project.gitlab.io/qemu/system/gdb.html . Everything works well, but there is two problems:
1. Debugging stops to work if I add "-enable-kvm"
2. Debugging stops to work if I remove "-static" when compiling init
Steps to reproduce:
I have absolutely fresh Debian sid system (as of 2022-10-22). I create the following file on it:
```c
#include <stdio.h>

int
main ()
{
  printf ("a\n");
  printf ("b\n");
  for (;;);
}
```

Then I compile it so: `gcc -static -g a.c`. Result is saved as `/root/a.out`. Then I run `sync; echo 3 > /proc/sys/vm/drop_caches; sync` to make sure this `/root/a.out` actually got to disk.

Then I start the host system inside of qemu using well-known `-snapshot /dev/sda` trick. Exact command is here:

```bash
qemu-system-x86_64 -daemonize -m 300M -s -S -kernel /vmlinuz -initrd /initrd.img -snapshot -append "root=/dev/sda init=/root/a.out" -drive file=/dev/sda,format=raw
```

(As you guessed, my disk has no partitions, it directly stores ext4 filesystem.)

Then I type on host `gdb ./a.out`. And then inside of gdb I type `target remote localhost:1234`, then `br 7` (line 7 is `printf ("b\n")`, then `c`. Then guest OS boots and reaches init (i. e. `/root/a.out`). And then gdb actually pauses on line 7. I. e. everything works!

But if I add `-enable-kvm` to qemu command line OR remove `-static` from gcc command line, then breakpoint doesn't work, i. e. gdb doesn't pause on breakpoint, the execution continues and the execution fails to infinite loop.