summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/108/other/650
blob: 8ac73b5c905cd6b1b109904a2f571012b4162aa0 (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
device: 0.828
performance: 0.733
graphic: 0.706
PID: 0.636
socket: 0.629
network: 0.580
vnc: 0.529
permissions: 0.459
semantic: 0.444
debug: 0.365
other: 0.363
files: 0.318
boot: 0.308
KVM: 0.221

Monitor device_add triggers deadlock when calling drain_call_rcu on QEMU >= 6.0.0
Description of problem:
It hangs
Steps to reproduce:
1. Run the QEMU:
   ```
   ./qemu-system-mips64 -nographic
   ```
2. Enter into the QEMU monitor: press ctrl-a c
3. Execute command `device_add` without arguments:
```
(qemu) device_add
```
4. It hangs so bad that only `kill -9` helps
Additional information:
I didn't test versions between 4.2.0 and 6.0.0, but I can confirm that 6.0.0, 6.1.0 and the latest master pull have this bug, while version 4.2.0 doesn't have it.

I've tracked the problem and found this.

1. Command `device_add` calls function `drain_call_rcu`. `drain_call_rcu` waits indefinitely for drain_complete_event.
2. Function `cpu_exec` in accel/tcg/cpu-exec.c calls `rcu_read_lock` but does not call `rcu_read_unlock()`. `cpu_exec` just spins in its inner loop.
3. Function `call_rcu_thread` hanged in calling the `synchronize_rcu` which calls `wait_for_readers`.

If I execute `stop` command in QEMU monitor before calling `device_add` command, no hang happen.