From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: Win64 testers? Date: Wed, 07 Aug 2024 19:50:49 +0000 Message-ID: <871q30t8mh.fsf@protonmail.com> References: <86h6bxq3p3.fsf@gnu.org> <86sevho61y.fsf@gnu.org> <86ed70o90k.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="615"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Quang Kien Nguyen , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 08 06:38:39 2024 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 1sbuv8-000AYJ-Vr for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Aug 2024 06:38:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbuua-0006WW-W6; Thu, 08 Aug 2024 00:38:05 -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 1sbmga-0004zr-UM for emacs-devel@gnu.org; Wed, 07 Aug 2024 15:51:05 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbmgZ-0001lF-6z for emacs-devel@gnu.org; Wed, 07 Aug 2024 15:51:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1723060254; x=1723319454; bh=ehZI5rZxXzHYZ1sRf+kcVMigjhVTGGQZMv6t1FTjKpY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=u1DBB0RqLYnRa1sD+7/HnNEhjrP1ho1qPhmFD15bscqO4gr9rKNsPT9mfkNEB2kxB KRAEtBBKXSLzFxSQHrgEywq0M5vXN93UIDd8VjHkJlBRfWiULVS0lfiFqiI7D7ABsV 0AEADl65WeuOp9s+G8vPANo2geNRBqFWB4gLVvqv891CnozbNBLL0YniR+SmGIfXOa OfGmMl6e+d4HbyOzujQh8ECrRjhmeX2MWhBldDZ+h6OUvLBB6S4BUAZGV985M425L0 KaTMvFlKrDIZCs6xs13b88FiJrdKkP74V0BdhSUXAiGFUOe9rfYsflYjpxTkvaK0A7 6m94a4IuAbEow== In-Reply-To: <86ed70o90k.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: a50dc72d527c77b48a6c1cf0fcb9239845e24521 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 08 Aug 2024 00:38:01 -0400 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322529 Archived-At: "Eli Zaretskii" writes: >> From: Quang Kien Nguyen >> Date: Tue, 6 Aug 2024 13:52:27 -0700 >> Cc: emacs-devel@gnu.org, pipcet@protonmail.com >> @@ -10480,60 +10480,73 @@ init_ntproc (int dumping) >> /* Initial preparation for subprocess support: replace our standard >> handles with non-inheritable versions. */ >> { >> - HANDLE parent; >> - HANDLE stdin_save =3D INVALID_HANDLE_VALUE; >> - HANDLE stdout_save =3D INVALID_HANDLE_VALUE; >> - HANDLE stderr_save =3D INVALID_HANDLE_VALUE; >> - >> - parent =3D GetCurrentProcess (); >> - >> - /* ignore errors when duplicating and closing; typically the >> - handles will be invalid when running as a gui program. */ >> - DuplicateHandle (parent, >> -=09=09 GetStdHandle (STD_INPUT_HANDLE), >> -=09=09 parent, >> -=09=09 &stdin_save, >> -=09=09 0, >> -=09=09 FALSE, >> -=09=09 DUPLICATE_SAME_ACCESS); >> - >> - DuplicateHandle (parent, >> -=09=09 GetStdHandle (STD_OUTPUT_HANDLE), >> -=09=09 parent, >> -=09=09 &stdout_save, >> -=09=09 0, >> -=09=09 FALSE, >> -=09=09 DUPLICATE_SAME_ACCESS); >> - >> - DuplicateHandle (parent, >> -=09=09 GetStdHandle (STD_ERROR_HANDLE), >> -=09=09 parent, >> -=09=09 &stderr_save, >> -=09=09 0, >> -=09=09 FALSE, >> -=09=09 DUPLICATE_SAME_ACCESS); >> - >> - fclose (stdin); >> - fclose (stdout); >> - fclose (stderr); >> - >> - if (stdin_save !=3D INVALID_HANDLE_VALUE) >> - _open_osfhandle ((intptr_t) stdin_save, O_TEXT); >> + /* For UCRT, the _fdopen will try to find free stream from >> + _IOB_ENTRIES (=3D 3), thus we can't reopen the standard handles >> + with it. Using SetHandleInformation to make the handle not >> + inheritable to child process is a better way. */ > > This is not what I think we need. First, there's no need to change > anything in the MSVCRT build, because AFAIK the current code "just Yes, there is. It makes assumptions about the API implementation that valid implementations of the Windows API do not satisfy. Wine until last week is one example; given that the bug wasn't reported in 20 years, we can assume that no other popular application relies on this particular detail, so relying on it even in MSVCRT builds is unsafe. IMHO, the only thing the first patch is missing is a comment reminding us to remove the old code if and when support for Windows 95/98 is dropped. Pip