unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: HA <pablo@seestieto.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael.albinus@gmx.de, 43226@debbugs.gnu.org
Subject: bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote
Date: Wed, 26 Oct 2022 17:15:34 +0300	[thread overview]
Message-ID: <87sfjahdrt.fsf@seestieto.com> (raw)
In-Reply-To: <83bkpyoktz.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 26 Oct 2022 15:01:12 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> So the ->pty_flag case is not for Windows.  And even if we did try
> using it, it wouldn't have worked for local processes, because Ctrl-D
> is NOT the EOF character on Windows; it's Ctrl-Z, and then only if the
> sub-process does text-mode reads (in binary mode, there's no way to
> send EOF to a subprocess, only kill it).

You're right – when trying the test case with just ssh in Emacs 28 on
Windows, process-send-eof successfully terminates the remote cat
process, it just never receives the actual Ctrl-D. (Verified this by
stracing the remote cat process.)

The test case where I call start-file-process with default-directory
pointing to a remote directory ("/sshx:...") and run simply "cat"
behaves differently in that it runs cmdproxy.exe instead of ssh.exe
directly, uses the -t option twice to force creation of PTYs on the
remote end, and uses -o RemoteCommand="/bin/sh -i" for interactive
shell. It does not seem to receive any input from Emacs, and stays
running.

Same things also happens if I run the test with "ssh -t -t" so
apparently somehow pseudo terminals on the remote end causes issues
here.

The normal "ssh" method (without -x) does not seem to be able to connect
at all on my Windows system for whatever reason, so I can't comment if
works any better.

Interestingly, similar test on Emacs 27.1 on GNU/Linux
receives the input but the cat process also stays running there, so
not sure if process-send-eof does the right thing even here.

(let* ((default-directory "/sshx:happy:/tmp")
      (sshz (start-file-process "eoftest" (get-buffer-create "*eoftest*") "cat")))
  (list-processes)
  (sit-for 10) ; Run strace -p $(pgrep cat) on remote
  (process-send-string sshz "foo")
  (process-send-eof sshz))

strace: Process 18005 attached
read(0, "foo", 131072)                  = 3
write(1, "foo", 3)                      = 3
read(0, 





  reply	other threads:[~2022-10-26 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 16:38 bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote Eli Zaretskii
2020-09-05 19:04 ` bug#43226: Fwd: bug#26911: 25.2; eshell "cd .." doesn't work correctly with TRAMP Michael Albinus
2020-09-05 19:04 ` Michael Albinus
2020-09-05 19:16   ` bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote Michael Albinus
2020-09-05 19:25     ` Eli Zaretskii
2020-09-06  8:49       ` Michael Albinus
2020-09-06 15:14         ` Eli Zaretskii
2020-09-06 15:54           ` Michael Albinus
2020-09-06 16:07             ` Eli Zaretskii
2022-10-25  9:39               ` Henrik Ahlgren
2022-10-25 11:26                 ` Eli Zaretskii
2022-10-25 13:56                   ` Henrik Ahlgren
2022-10-25 16:49                     ` Michael Albinus
2022-10-25 19:17                     ` Eli Zaretskii
2022-10-26 11:34                       ` Henrik Ahlgren
2022-10-26 12:01                         ` Eli Zaretskii
2022-10-26 14:15                           ` HA [this message]
2022-10-29 14:48                             ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfjahdrt.fsf@seestieto.com \
    --to=pablo@seestieto.com \
    --cc=43226@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).