summary refs log tree commit diff stats
path: root/gitlab/issues/target_missing/host_missing/accel_missing/2423.toml
blob: 9c5f241792ec29859cc80f070497c89789ae03eb (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
id = 2423
title = "`qemu -serial stdio` leaves stdout in non-blocking mode"
state = "closed"
created_at = "2024-07-03T17:46:16.532Z"
closed_at = "2024-07-04T18:14:29.508Z"
labels = []
url = "https://gitlab.com/qemu-project/qemu/-/issues/2423"
host-os = "Arch Linux"
host-arch = "x86_64"
qemu-version = "9.0.1"
guest-os = "n/a"
guest-arch = "n/a"
description = """When `-serial stdio` is used, qemu exits leaving stdout in non-blocking mode. Although it [attempts](https://gitlab.com/qemu-project/qemu/-/blob/1a2d52c7fcaeaaf4f2fe8d4d5183dccaeab67768/chardev/char-stdio.c#L52) to restore stdin to blocking mode, it misses that stdout also gets O_NONBLOCK by [qemu_chr_open_fd](https://gitlab.com/qemu-project/qemu/-/blob/1a2d52c7fcaeaaf4f2fe8d4d5183dccaeab67768/chardev/char-stdio.c#L116) ([here](https://gitlab.com/qemu-project/qemu/-/blob/1a2d52c7fcaeaaf4f2fe8d4d5183dccaeab67768/chardev/char-fd.c#L215)). It causes the next applications in the script misbehave because they get unexpected EAGAIN on write to stdout."""
reproduce = """Run the following script:

```
#!/usr/bin/env bash

qemu-system-x86_64 -nodefaults -display none -no-reboot -serial stdio &
PID="$!"
sleep 5
kill "$PID"
wait "$PID"
echo "EXITING $?"

sleep 5
seq 1 400000
```

The seq command will be interrupted prematurely:

```
...
5143
5144
5145⏎                                                                                                                                                                                                                wResource temporarily unavailable
write: Resource temporarily unavailable
write: Resource temporarily unavailable
```

When run from fish shell, it will also start misbehaving when running next commands (fish bug report: https://github.com/fish-shell/fish-shell/issues/10600)."""
additional = """Expect a patch from me soon."""