From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote Date: Wed, 26 Oct 2022 15:01:12 +0300 Message-ID: <83bkpyoktz.fsf@gnu.org> References: <83363wp4ak.fsf@gnu.org> <87mu24t57t.fsf@gmx.de> <87imcst4om.fsf_-_@gmx.de> <83v9gsnhzj.fsf@gnu.org> <87eenfthlc.fsf@gmx.de> <83h7sbndi4.fsf@gnu.org> <87lfhmzyr8.fsf@gmx.de> <83d02yopm1.fsf@gnu.org> <87k04oi6n4.fsf@seestieto.com> <838rl4p2ik.fsf@gnu.org> <871qqwhuqy.fsf@seestieto.com> <83lep3ogpt.fsf@gnu.org> <87wn8mhl8u.fsf@seestieto.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43226@debbugs.gnu.org, michael.albinus@gmx.de To: Henrik Ahlgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 26 14:03:40 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onf8F-00089O-1N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Oct 2022 14:03:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onf71-0005ZT-Se; Wed, 26 Oct 2022 08:02:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onf6g-0005At-VQ for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 08:02:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onf6g-00075v-GJ for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 08:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onf6g-0004nT-2L for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 08:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2022 12:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43226 X-GNU-PR-Package: emacs Original-Received: via spool by 43226-submit@debbugs.gnu.org id=B43226.166678571018407 (code B ref 43226); Wed, 26 Oct 2022 12:02:02 +0000 Original-Received: (at 43226) by debbugs.gnu.org; 26 Oct 2022 12:01:50 +0000 Original-Received: from localhost ([127.0.0.1]:53533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onf6T-0004mp-Va for submit@debbugs.gnu.org; Wed, 26 Oct 2022 08:01:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onf6Q-0004mY-V7 for 43226@debbugs.gnu.org; Wed, 26 Oct 2022 08:01:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onf6F-00072q-KD; Wed, 26 Oct 2022 08:01:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=1e71ogopPsvcv959nAJ/DPq/sW5l8Y13I9WsU0tpzvk=; b=PAICTAWD5bRMENwVvMLt lh/k+eh+0FfyDDIQfcYu026PcrK8Hy+L/Sm+ns1JluOUHP4E6TF7p1GhJm4T1g4fgG1RaRt83uFtB IRSwz6D1QQNaufgSR8clsrwh5xDceAiXxRe/VGX1hGoM1cpm75/kWwsGaZAxTrVdcXLgpCJ/xLE33 0fsmjj34QKUKJCrvg0b5RRgzTNTnMnZEyMs8vC1ew8dSrZf1352cXjtr783cNj0PvXwrRaFCikmyY BhA7XYbGRtP8qYxuszcfdre6NMq7+EV7FPaZV8Tosqco2nJ+MBU/BjpcoBje5OAx2oP7C5TYMmSRF qLVMInsdoAN0dw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onf62-0001v8-9d; Wed, 26 Oct 2022 08:01:30 -0400 In-Reply-To: <87wn8mhl8u.fsf@seestieto.com> (message from Henrik Ahlgren on Wed, 26 Oct 2022 14:34:09 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246218 Archived-At: > From: Henrik Ahlgren > Cc: Michael Albinus , 43226@debbugs.gnu.org > Date: Wed, 26 Oct 2022 14:34:09 +0300 > > This issue is documented on the FAQ section of the Magit manual: > > A.2.13 I am unable to stage when using Tramp from MS Windows > ------------------------------------------------------------ > > Magit may be unable to stage (or otherwise apply) individual hunks when > you are connected to remote machine using Tramp and the local machine > uses MS Windows. > > There appears to be a problem with ‘process-send-eof’ in this > scenario, as mentioned at the end of ‘tramp-tests.el’. I have contacted > the Tramp maintainer about this. For now this unfortunately means that > it just doesn’t work and we cannot do anything about it. If you have > more information, then please comment on > . This doesn't really add any useful information. > After some debugging I figured out that by simply adding > (process-send-string process "\004") in magic-process.el before (maybe > even instead?) of process-send-eof, it works perfectly well. Maybe it's > a valid workaround, or even the proper fix, but clearly there is some > point of having a separate function for sending EOF. > > In the C implementation of process-send-eof (Emacs 27.1), it seems to only > send EOF if the process has pty_flag set: > > if (XPROCESS (proc)->pty_flag) > send_process (proc, "\004", 1, Qnil); > > I think this could be the reason: after all I believe PTYs are a fairly > recent feature in Windows and Emacs does not support it yet? Emacs doesn't (and probably will not) support the Windows Pseudo-Console because it falls short of what Emacs needs: it doesn't allow to send stuff in arbitrary encoding via this channel. I filed a bug report with the developers many moons ago, but their response was that it will probably never fixed. So you can only talk to a program that uses the current system codepage, which is useless for Emacs. 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).