Why does the GNU C Preprocessor cpp freeze my MSYS2 bash (mintty.exe) when writing to stdout, even post SIGINT?

0

Using the MINGW64 Bash from MSYS2 on Windows 7 64 Bit I'm getting a weird behavior for the following command sequence:

echo "Hello World" > foo
cpp foo -

It outputs the following (correctly):

# 1 "foo"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "foo"
Hello World

Then it enters a state as if it were waiting for user input (no prompt, just a blinking cursor on an empty line). If I [Ctrl]+[C] it, it appears to terminate; I get a prompt with a blinking cursor, but the terminal does not accept any keyboard input. After clicking on the window the cursor freezes and the application goes to non-reactive state (window is grayed out and Windows tells me it wouldn't react). I have to terminate the process via the OS to kill it.

I wonder if this behavior would also appear on a proper UNIX platform and whether it is my fault or if there is a bug somewhere.

Version Information

$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ echo $BASH_VERSION
4.4.23(1)-release

$ cpp --version
cpp.exe (Rev3, Built by MSYS2 project) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

References

Neonit

Posted 2019-11-27T09:47:13.963

Reputation: 183

No answers