blob: edf1cd42c50d64c9e9ef064439793004dff05cf5 (
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
|
id = 1963
title = "EOF is not detected, when semihosting is reading from stdin"
state = "opened"
created_at = "2023-10-27T08:32:16.590Z"
closed_at = "n/a"
labels = ["Semihosting", "workflow::Needs Info"]
url = "https://gitlab.com/qemu-project/qemu/-/issues/1963"
host-os = "Ubuntu 22.04.3 LTS"
host-arch = "x86_64"
qemu-version = "8.1.50 (v8.1.0-2161-ga95260486a)"
guest-os = "bare metal"
guest-arch = "arm"
description = """QEMU hangs."""
reproduce = """1. Run the program with stdin from a pipe."""
additional = """The code is compiled from this source:
```
#include <stdio.h>
int main(int argc, char** argv) {
int i = -1;
int result = scanf("%d", &i);
printf("result = %d, i = %d\\n", result, i);
return 0;
}
```
compiled with GCC and picolibc:
```
arm-none-eabi-gcc --specs=picolibc.specs -march=armv7-m ~/sources/picolibc/git/test-stdin.c -o test-stdin -lc -lsemihost --crt0=hosted -O0 -g
```
[test-stdin](/uploads/dbd2650c8e0aaca353fd7630ac9c8440/test-stdin)
The execution hangs at semihosting SYS_READC(0x7) call:
```
\tmovs r0, #7
(...)
\tbkpt #0xab
```"""
|