Bug: qemu not properly flushing error messages related to bad arguments
Bug: https://gitlab.com/qemu/qemu/blob/master/linux-user/main.c#L763-L764 ## Simple reproduction/explanation of why this is an issue Consider the following C program on Linux: ```c #include <unistd.h> #include <stdio.h> int main() { printf("Hello world\n"); _exit(0); } ``` Depending on how you run it, you might not see the message printed to stdout: ``` cc main.c -o main # This will print Hello world ./main # This prints nothing echo "$(./main)" ``` This is because newlines only causes flushing when run in a terminal (not when stdout is being redirected), and _exit bypasses any flushing at the end of the program. In particular, I faced this problem here: https://gitlab.com/qemu/qemu/blob/master/linux-user/main.c#L763-L764 As a fix, I suggest either switching from `_exit(EXIT_FAILURE)` to `exit(EXIT_FAILURE)`, or calling `fflush(stdout)` before _exit, to ensure the error message is printed when qemu stdout is being redirected.
issue