From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Timothy Sample Newsgroups: gmane.lisp.guile.bugs Subject: bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly Date: Tue, 28 Dec 2021 10:40:02 -0500 Message-ID: <8735mcu4a5.fsf@ngyro.com> References: 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="6756"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: dev@jpoiret.xyz To: 52835@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Dec 28 16:41:12 2021 Return-path: Envelope-to: guile-bugs@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 1n2Eb9-0001bi-PR for guile-bugs@m.gmane-mx.org; Tue, 28 Dec 2021 16:41:11 +0100 Original-Received: from localhost ([::1]:59364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Eb8-000505-CD for guile-bugs@m.gmane-mx.org; Tue, 28 Dec 2021 10:41:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Eb0-0004xm-EO for bug-guile@gnu.org; Tue, 28 Dec 2021 10:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Eb0-00041O-0o for bug-guile@gnu.org; Tue, 28 Dec 2021 10:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2Eaz-000137-RD for bug-guile@gnu.org; Tue, 28 Dec 2021 10:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 28 Dec 2021 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52835 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Josselin Poiret via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" X-Debbugs-Original-Cc: 52835@debbugs.gnu.org, Josselin Poiret Original-Received: via spool by submit@debbugs.gnu.org id=B.16407060093938 (code B ref -1); Tue, 28 Dec 2021 15:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2021 15:40:09 +0000 Original-Received: from localhost ([127.0.0.1]:47231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Ea9-00011S-0e for submit@debbugs.gnu.org; Tue, 28 Dec 2021 10:40:09 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:60140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2Ea7-00011K-P3 for submit@debbugs.gnu.org; Tue, 28 Dec 2021 10:40:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Ea7-0004IE-Df for bug-guile@gnu.org; Tue, 28 Dec 2021 10:40:07 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Ea5-0003r7-JC for bug-guile@gnu.org; Tue, 28 Dec 2021 10:40:07 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8266A5C00CD; Tue, 28 Dec 2021 10:40:04 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 28 Dec 2021 10:40:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=lIF3z0naPvDBZ9w4r7sWK8ciDzQrONkqpl6lfHuZi vE=; b=F1NR5BDe7s8V2lHXFc90lxCqZqTv3mUZRxYFhnpNEVi3/DqURqCA702IN 7ljHfMhtBldX/3y49xnIHIC8jLeLsYHfQNcbWvShKazbwoDtJ2YSsa1xpQHHIY33 dFUO0fL8inFZi9eFDt5lpbl+5Cb8FJ5uZHTRYE2gSJNaZRtVy5WEdXM+tMGU0hPR 7uX6hlpz8OaZIbVQDmywSfdpNn/UtghuaTX9Rxm4qU1Dv4rXIW1OCRJTbRm0QVFW 9MXAyEl1c4e3LlnO1K70u31gxVq9uulgmcqygszrn6iFmIXQ1/7imRnM6FatCoVN WmQezyecWuxgULCC+5/awKKPGXgfg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudduledgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtgfesthhqredttderjeenucfhrhhomhepvfhimhho thhhhicuufgrmhhplhgvuceoshgrmhhplhgvthesnhhghihrohdrtghomheqnecuggftrf grthhtvghrnhepffdtveefgefhhfevhffhhfegfefffeegtdekfeekgeejveffvdehhedv gfettdfgnecuffhomhgrihhnpehophgvnhhgrhhouhhprdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhplhgvthesnhhghihr ohdrtghomh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Dec 2021 10:40:03 -0500 (EST) In-Reply-To: (Josselin Poiret via's message of "Mon, 27 Dec 2021 22:25:56 +0100") Received-SPF: pass client-ip=66.111.4.27; envelope-from=samplet@ngyro.com; helo=out3-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10232 Archived-At: Hey Josselin, Thanks for finding this bug! I have one concern about your patches: Josselin Poiret writes: > The second patch removes renumber_file_descriptor, as it is no longer > used. One thing that =E2=80=98renumber_file_descriptor=E2=80=99 does that we seem= to be losing here is error checking. To my eye, the old code will try and warn the user if they run out of file descriptors, but the new code will not. The other thing that I like is how =E2=80=98renumber_file_descriptor=E2=80= =99 checks the return value of =E2=80=98dup=E2=80=99 in addition to checking =E2=80=98errn= o=E2=80=99. (I realize that the old code skips that check for =E2=80=98dup2=E2=80=99 =E2=80=93 I=E2=80= =99m kinda just stating a preference here.) A quick check of POSIX turns up the following: =E2=80=9C= the value of =E2=80=98errno=E2=80=99 should only be examined when it is indicat= ed to be valid by a function=E2=80=99s return value=E2=80=9D [1]. -- Tim [1] https://pubs.opengroup.org/onlinepubs/9699919799/