Subject: bug#22344: 25.0.50 (and 24.5.1, 24.4); Sending 4097 bytes to a subprocess hangs Emacs on Windows 8 and 10

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Jan 2016 21:33:55 +0200

> Cc: [email-masked]
> From: Clément Pit--Claudel <[email-masked]>
> Date: Mon, 11 Jan 2016 13:02:47 -0500
> 
> > Thanks.  Are all the affected programs written in JavaScript?  Do they
> > all set stdin encoding to UTF-8?  If so, does the problem go away if
> > you remove the line that sets the encoding?
> 
> No, the following javascript implementation of cat also reproduces the issue:
> 
> function blackhole() {
>     process.stdin.resume();
>     process.stdin.setEncoding("ascii");
>     process.stdin.on('data', function (chunk) { process.stdout.write(chunk); });
> }
> blackhole();

Could it be that the script exits as soon as it processed the first 4K
chunk, without waiting for the next one, or without waiting long
enough?