From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Henrik Ahlgren 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 14:34:09 +0300 Message-ID: <87wn8mhl8u.fsf@seestieto.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29961"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 43226@debbugs.gnu.org, Michael Albinus To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 26 16:31:21 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 1onhR8-0007cu-Ij for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Oct 2022 16:31:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onhP3-0004T4-BF; Wed, 26 Oct 2022 10:29:09 -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 1onhOx-0003xz-2k for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 10:29:03 -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 1onhOw-0002PA-OL for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 10:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onhOw-0002aC-IV for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 10:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Henrik Ahlgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2022 14:29: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.16667945049844 (code B ref 43226); Wed, 26 Oct 2022 14:29:02 +0000 Original-Received: (at 43226) by debbugs.gnu.org; 26 Oct 2022 14:28:24 +0000 Original-Received: from localhost ([127.0.0.1]:55027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onhOJ-0002Yg-Nf for submit@debbugs.gnu.org; Wed, 26 Oct 2022 10:28:24 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:58249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onefq-00044L-SI for 43226@debbugs.gnu.org; Wed, 26 Oct 2022 07:34:20 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B4029320095F; Wed, 26 Oct 2022 07:34:12 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 26 Oct 2022 07:34:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seestieto.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1666784052; x= 1666870452; bh=fM6dj6e1JAGAjeoTlQL8boXBl+tIk7OTwIoDPAKHlr4=; b=c QzMVDwBxE+r6EBUu7/K6GfpLrX87eqLKDRoTZBe3TME38CgwkG/iH5N8z0kE4Hn3 CzjlBMSyrWbvw2jXltdkVQTRwBOyrTXehwF4xAlGRSKpDb3U/zXUqSvuCM1h9k0N sC2koXVOAd/t80pzDwRrw9kayKN9DpD+5z4lmbfebfDXVFMKUcx07dLZqikSgKMp BIYPY2oxhHbwumKKeJyXAGZeKJxu+sVvwnrzm+1qqHqr0Ak7YpB3wKpIOuhVoT4l TssW51mGE5a4+qE0RLh0/AmZe/E1EQfJGU0sIYykZ2ieOmQVuFOWsrq3gSw5PHay laeCru91C21x/jepJMYxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666784052; x= 1666870452; bh=fM6dj6e1JAGAjeoTlQL8boXBl+tIk7OTwIoDPAKHlr4=; b=c tqSlaCfb1y9l562q6uzfs81ywW/WNUYj+hiayRtfq6+HAtB5uG7Ep7LjxpDAfV46 g/2l6RBNQ+COQzCokrmz41lmfRAfem4qc2iyeNLXGFrMYLAhnPZIRQhIwCYzm+Ge G41zmseP9vrlFLhpzIbUaRp9Fk2YwB3QQVECdhaVgpgW7GSlo6DVcf+in8XJRg0G OJyA80WhxGTeLYlViBDL1HIAxcSePVzvkEu7hRwy7cNny056q+yc/6JvZbvLirDH C1C3IAJ5Gizkv4kVI51AqxxLjv0DfYn+Kk02dVTuzX57X+Ty7Uf90ZV6LRnutOt7 j+pIqXVH2JtlglKGmk20Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtddvgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufhfffgjkfgfgggtgfesthhqredttderjeenucfhrhhomhepjfgvnhhr ihhkucethhhlghhrvghnuceophgrsghlohesshgvvghsthhivghtohdrtghomheqnecugg ftrfgrthhtvghrnhephfdvkedutedvkeeludegieegieehgeegfeehjeetkedtieejleek tdfggeffffffnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehprggslhhosehsvggvshhtihgv thhordgtohhm X-ME-Proxy: Feedback-ID: i8ea641e4:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Oct 2022 07:34:11 -0400 (EDT) In-Reply-To: <83lep3ogpt.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 Oct 2022 22:17:50 +0300") X-Mailman-Approved-At: Wed, 26 Oct 2022 10:28:22 -0400 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:246237 Archived-At: Eli Zaretskii writes: > Maybe Michael (CC'ed) can explain how this is supposed to work, > because I don't think I understand. The actual process run by Emacs > is ssh, not cat, so how is EOF supposed to get to the remote "cat"? Not exactly sure, but clearly there is some difference between POSIX platforms and Windows on how process-send-eof works in certain situations when dealing with Tramp remote connections, and this breaks some functionality of Magit, not just Tramp's own tests.=20 In my test I just used cat to emulate "git apply -" to trace what it receives from the standard input. 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 =E2=80=98process-send-eof=E2=80=99 = in this scenario, as mentioned at the end of =E2=80=98tramp-tests.el=E2=80=99. I= have contacted the Tramp maintainer about this. For now this unfortunately means that it just doesn=E2=80=99t work and we cannot do anything about it. If you = have more information, then please comment on . 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? OTOH, this function seems to work when running ssh directly from start-file-process which apparently doesn't use cmdproxy.exe. Anyway, I have no means of compiling Emacs on Windows to debug the C source to see if pty_flag is set on the non-cmdproxy.exe case.