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#56002: src/process.c; make-process fails to clean up stderr process on early exit Date: Mon, 08 Aug 2022 14:57:30 +0300 Message-ID: <831qtrvtg5.fsf@gnu.org> References: <83pmj9qjgk.fsf@gnu.org> <8735e70xwl.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4500"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tgbugs@gmail.com, 56002@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 08 14:04: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 1oL1Uu-0000xl-55 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Aug 2022 14:04:40 +0200 Original-Received: from localhost ([::1]:58662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oL1Us-0000fm-SG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Aug 2022 08:04:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oL1OV-0005W9-Gu for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2022 07:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oL1OU-0008Co-Fx for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2022 07:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oL1OU-0005jW-BW for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2022 07:58: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: Mon, 08 Aug 2022 11:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56002 X-GNU-PR-Package: emacs Original-Received: via spool by 56002-submit@debbugs.gnu.org id=B56002.165995987622025 (code B ref 56002); Mon, 08 Aug 2022 11:58:02 +0000 Original-Received: (at 56002) by debbugs.gnu.org; 8 Aug 2022 11:57:56 +0000 Original-Received: from localhost ([127.0.0.1]:39388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oL1OO-0005jB-3r for submit@debbugs.gnu.org; Mon, 08 Aug 2022 07:57:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oL1OJ-0005iv-NG for 56002@debbugs.gnu.org; Mon, 08 Aug 2022 07:57:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oL1OE-000855-Cb; Mon, 08 Aug 2022 07:57:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Co23mkXUQwijPVVm7mpHo443ijYsEVlseD2KEJgeJQk=; b=iUWoQG3xAwIb SCZcYeaq4oiL3L5zWoSn89u/UePldxIj9YncWFpeVR4fiLH9K63+7I3W3MMFev4DOmm2CPUdapNFc n7PKP27j9BmeB/54IisOSdD9Uk5Ilnfsm1EmAA7vLBS6PF5rbFXXHbO5Hf7akPJJ5Wiug5KXe4SEL 2AWg1xngI14kmUlyLow8NAIZrQfIvv4VZUxSpao31lrk65JLzbHG5Bj/AHpssTHTFgnbGUWbRoFaU F1wqlOL3gJBgTadVDzZ8w92+fIQRrkbWoC2jcd1J9FygMIH89pN0OrRp6DHbaAf2zgJBBVLH6oeqs yP+j0fm5xX0zoGs56dWIBA==; Original-Received: from [87.69.77.57] (port=2917 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 1oL1OB-0001t7-QI; Mon, 08 Aug 2022 07:57:46 -0400 In-Reply-To: <8735e70xwl.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 08 Aug 2022 13:36:58 +0200) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239109 Archived-At: > From: Lars Ingebrigtsen > Cc: Eli Zaretskii , 56002@debbugs.gnu.org > Date: Mon, 08 Aug 2022 13:36:58 +0200 > > Tom Gillespie writes: > > > * src/process.c (Fmake_process): Move the call to create the stderr > > process as late as possible to avoid having to clean up stderrproc in > > the event of an error prior to the call to create_process. This change > > is needed to ensure that when called with :query-stderr t (aka the > > default behavior prior to the addition of :query-stderr) make-process > > will not leak the stderr process if a call to make-process fails. > > Also adds a new keyword argument :query-stderr to control whether to > > query on exit the stderr process (if one is created). (bug#56002) > > I think this makes sense... Eli, any comments? TBH, I don't understand the rationale well enough. What does it mean we "leak stderr process"? isn't the stderr process recycled if make-process fails? Is it just a matter of some simple change in the control flow, to make sure we always go through the cleanup code before we return? In general, I'd prefer not to change timing of what we do in make-process unless it's really unavoidable. There's a lot of system-dependent stuff there, and who knows what will that cause on some platform?