arm: 0.905 graphic: 0.900 architecture: 0.863 performance: 0.850 device: 0.834 files: 0.713 permissions: 0.616 debug: 0.600 semantic: 0.599 vnc: 0.531 network: 0.513 ppc: 0.502 socket: 0.452 PID: 0.357 TCG: 0.352 mistranslation: 0.340 risc-v: 0.330 kernel: 0.324 boot: 0.319 peripherals: 0.314 VMM: 0.305 x86: 0.281 user-level: 0.278 i386: 0.276 virtual: 0.211 hypervisor: 0.194 register: 0.185 KVM: 0.093 assembly: 0.073 -------------------- arm: 0.978 debug: 0.592 register: 0.498 assembly: 0.484 virtual: 0.258 TCG: 0.071 files: 0.068 semantic: 0.039 user-level: 0.023 performance: 0.020 PID: 0.012 kernel: 0.009 network: 0.008 device: 0.006 hypervisor: 0.004 graphic: 0.004 peripherals: 0.003 architecture: 0.003 boot: 0.003 socket: 0.002 permissions: 0.001 VMM: 0.001 risc-v: 0.001 ppc: 0.001 mistranslation: 0.001 x86: 0.001 vnc: 0.001 i386: 0.000 KVM: 0.000 EOF is not detected, when semihosting is reading from stdin Description of problem: QEMU hangs. Steps to reproduce: 1. Run the program with stdin from a pipe. Additional information: The code is compiled from this source: ``` #include 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: ``` movs r0, #7 (...) bkpt #0xab ```