Subject: bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote

From: Henrik Ahlgren <[email-masked]>
Date: Tue, 25 Oct 2022 16:56:37 +0300

Eli Zaretskii <[email-masked]> writes:

> I don't know.  If this is about remote Git processes, then
> process-send-eof sends EOF via the network connection, doesn't it?  If
> so, the network-connection implementation of process-send-eof works on
> MS-Windows like it works on any other system: we call 'shutdown'.

Indeed – when you work with remote git working trees over Tramp and want
to stage individual hunks from the Magit interface, it will run "git
apply -" (with a bunch of extra parameters) and attempts to send the
patches over to standard in. This, unlike staging a whole file (which
simply does "git add <file>"), hangs your whole Emacs session until you
hit C-g.

Consider this example that seems to work fine (no cmdproxy involved):

(let ((start-file-process "eoftest" (get-buffer-create "*eoftest*")
			  "ssh" "<hostname>" "cat"))
  (sit-for 10)
  (process-send-string sshz "foo")
  (sit-for 5)
  (process-send-eof sshz))

vs this that hangs, leaving cat running forever:

(let ((default-directory "/sshx:<hostname>:/home/my/git/dir")
      (sshz start-file-process "eoftest" (get-buffer-create "*eoftest*")
			  "cat"))
  (sit-for 10)
  (process-send-string sshz "foo")
  (sit-for 5)
  (process-send-eof sshz))

The cat process does not even seem to receive any input ("foo") I trace
it in the remote machine.

ps. I wonder why my emails are not appearing in debbugs?