From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Saulius Menkevicius Newsgroups: gmane.emacs.devel Subject: Re: master 2c79a8f 2/2: Use posix_spawn if possible. Date: Tue, 8 Feb 2022 23:09:20 +0200 Message-ID: References: <87czk5brgr.fsf@gmail.com> <7BD6026F-D756-42C3-9FCC-724D9A6B2378@fastmail.com> <187BA387-6D96-457A-A157-388AD9379D85@fastmail.com> <83tud9wo9e.fsf@gnu.org> <87leyl5rr7.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_BF64EFC1-4341-4B16-99F2-014FFCBBB2B5" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2731"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , Emacs developers , p.stephani2@gmail.com, Matt Armstrong , Eli Zaretskii , mituharu@math.s.chiba-u.ac.jp To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 09 04:23:24 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nHdZj-0000UE-4n for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Feb 2022 04:23:24 +0100 Original-Received: from localhost ([::1]:57576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHdZh-0005fo-QU for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Feb 2022 22:23:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHXkA-0008A4-6o for emacs-devel@gnu.org; Tue, 08 Feb 2022 16:09:46 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:37533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHXk2-0007Qt-1n; Tue, 08 Feb 2022 16:09:42 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 79443320221C; Tue, 8 Feb 2022 16:09:24 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 08 Feb 2022 16:09:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc: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=fm2; bh=Ze9bX9CeJmbcFyPldTnAFm+YFtipbFbDZyRPyl QgRVA=; b=EMEAq0GZAGZvwWiWiHEyc4Sxvl+/0O5UTIC7JWI5W8PyyxBXlE36Rv d/+uZY/DTBuCdtrXK0TEjUasqG3uZL9G86QSM58dy7dQeDOnKZMww9D0iGInef7g NFePoA4ozkdxSFs+llzhvmFCR44lbHlbEHfNXnUJfGSpM8+8KLNUB7LwmVZNkCKa Ku5uf2nxmuvF1lU8C8sBnc0jkIGd+3aW+s6KtG8V/RYA0ETsQtUvDOLMtsHVzG/N cy7eRmf7vm68eNUGswQB5XfFwIh4VYxDB6lSYBfLFp15MWA1SQ/VHUnMf6gxKwYH x+P+rMszeIB/uHGA6nwhUOCQOmlZV/wA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date: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=fm2; bh=Ze9bX9CeJmbcFyPld TnAFm+YFtipbFbDZyRPylQgRVA=; b=YjrIpEQtNrN7MW9ph7GJchyzyn19VJPVs DeA3v/2O4OqKJTuvl718EMwSEHCBWHoH14ISsh6xfXgHibaoDLF8284fNMbp9Kr5 fDqDNcDA50ceL+p7RNC57+c9ODiP7eWDs92rZMDy57eZvGKs/WoX7OY59CHr2Bd/ wMWlhWHwORflmmzjc/0txnNkK4BE90SiICDuwcXmFxybCT4dYvfwGt61dERKTnBB L1bYAjMrv+J5vckrRiWzHMLiG02/LXPvoftQqCpe9XgUzomhI1I8m8xXMjGMZ3ZR hfUAiU4ATaCQpghI/0vyk8n8834fFKR7KjE7mzQLmKSCWIua2NT5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrheejgddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffktgggufffjgfvfhfosegrtdhmrehhtdejnecuhfhrohhmpefurghulhhi uhhsucfovghnkhgvvhhitghiuhhsuceoshgruhhlihhushhmvghnkhgvvhhitghiuhhsse hfrghsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepteduledtieelhedvieek teetheeufffggfdtjeeiteeuhfdvfeeiueevudfhhfdtnecuffhomhgrihhnpehgihhthh husgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehsrghulhhiuhhsmhgvnhhkvghvihgtihhushesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Feb 2022 16:09:22 -0500 (EST) In-Reply-To: <87leyl5rr7.fsf@gmail.com> X-Mailer: Apple Mail (2.3693.60.0.1.1) Received-SPF: pass client-ip=64.147.123.24; envelope-from=sauliusmenkevicius@fastmail.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 08 Feb 2022 22:22:28 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286082 Archived-At: --Apple-Mail=_BF64EFC1-4341-4B16-99F2-014FFCBBB2B5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Robert you are correct about ``:connection-type''. In particular = lsp-mode specifies ``:connection-type pty'' here: - https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L6932 = As a workaround fsharp/csharp language servers can use shell wrapper for = launching the server binaries, as "#!/bin/bash" will apparently = normalize signal mask before launching sub-subprocess and things work = alright from thereon. This is not as nice as having things just working before this change to = `make-process`, but at least we have some way to work around this = issue.. -Saulius > Am 2022-02-08 um 16:59 schrieb Robert Pluim : >=20 >>>>>> On Tue, 8 Feb 2022 14:18:43 +0200, Saulius Menkevicius = said: >=20 > Saulius> I believe this is not a problem related to C#/dotnet but = generally > Saulius> with how signals are blocked on child processes launched = with > Saulius> posix_spawn in the current implementation. >=20 > (I could argue that if dotnet wants to ensure it receives SIGCHLD, it > should unblock it itself, but that=CA=BCs a different discussion, we > definitely have an Emacs bug) >=20 > And come to think of it, the posix_spawn code path is only exercised > when not asking for a pseudo tty. Since the default value for > `process-connection-type' is t =3D> pty, I=CA=BCm assuming that the = elisp > code in question is binding that to nil, or using the :connection-type > argument to `make-process'. >=20 > Would it be possible to test using ptys? If that works that=CA=BCs a > workaround that requires no changes to emacs-28. >=20 > Thanks >=20 > Robert > --=20 --Apple-Mail=_BF64EFC1-4341-4B16-99F2-014FFCBBB2B5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Robert you are correct about ``:connection-type''. In = particular lsp-mode specifies ``:connection-type pty'' here:


As= a workaround fsharp/csharp language servers can use shell wrapper for = launching the server binaries, as "#!/bin/bash" will apparently = normalize signal mask before launching sub-subprocess and things work = alright from thereon.

This is not as = nice as having things just working before this change to `make-process`, = but at least we have some way to work around this issue..

-Saulius

Am 2022-02-08 um 16:59 schrieb = Robert Pluim <rpluim@gmail.com>:

On Tue, 8 Feb 2022 = 14:18:43 +0200, Saulius Menkevicius <sauliusmenkevicius@fastmail.com> said:

   Saulius> I believe this is not a = problem related to C#/dotnet but generally
=    Saulius> with how signals are blocked on child = processes launched with
   Saulius> = posix_spawn in the current implementation.

(I= could argue that if dotnet wants to ensure it receives SIGCHLD, it
should unblock it itself, but that=CA=BCs a different = discussion, we
definitely have an Emacs bug)

And come to think of it, the posix_spawn code = path is only exercised
when not asking for a pseudo tty. = Since the default value for
`process-connection-type' is t = =3D> pty, I=CA=BCm assuming that the elisp
code in = question is binding that to nil, or using the :connection-type
argument to `make-process'.

Would = it be possible to test using ptys? If that works that=CA=BCs a
workaround that requires no changes to emacs-28.

Thanks

Robert
--

= --Apple-Mail=_BF64EFC1-4341-4B16-99F2-014FFCBBB2B5--