GNU logs - #63024, boring messages


Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: "Timo Wilken" <guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Sat, 22 Apr 2023 20:00:01 +0000
Resent-Message-ID: <handler.63024.B.168219355823659 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: 63024 <at> debbugs.gnu.org
X-Debbugs-Original-To: <bug-guix@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.168219355823659
          (code B ref -1); Sat, 22 Apr 2023 20:00:01 +0000
Received: (at submit) by debbugs.gnu.org; 22 Apr 2023 19:59:18 +0000
Received: from localhost ([127.0.0.1]:44181 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pqJOA-00069X-Eg
	for submit <at> debbugs.gnu.org; Sat, 22 Apr 2023 15:59:18 -0400
Received: from lists.gnu.org ([209.51.188.17]:47630)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <timo@HIDDEN>) id 1pqJO8-00069M-8L
 for submit <at> debbugs.gnu.org; Sat, 22 Apr 2023 15:59:16 -0400
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 <timo@HIDDEN>) id 1pqJO6-0004VF-PB
 for bug-guix@HIDDEN; Sat, 22 Apr 2023 15:59:15 -0400
Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <timo@HIDDEN>) id 1pqJO4-0001fr-Mm
 for bug-guix@HIDDEN; Sat, 22 Apr 2023 15:59:14 -0400
Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <timo@HIDDEN>) id 1pqJO2-002wAp-OE
 for bug-guix@HIDDEN; Sat, 22 Apr 2023 20:59:11 +0100
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Sat, 22 Apr 2023 21:59:03 +0200
Message-Id: <CS3JUDMNK50H.14U373XKCHRIC@HIDDEN>
From: "Timo Wilken" <guix@HIDDEN>
X-Mailer: aerc 0.14.0
X-BlackCat-Spam-Score: 7
X-Spam-Status: No, score=0.7
Received-SPF: pass client-ip=2a00:1098:0:82:1000:0:2:1;
 envelope-from=timo@HIDDEN; helo=mx2.mythic-beasts.com
X-Spam_score_int: -41
X-Spam_score: -4.2
X-Spam_bar: ----
X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3,
 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-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

The `guix import pypi -r ...' command frequently crashes for me. When
it does, it always crashes on the third download, the one for the
first dependency's source distribution, like so:

--8<---------------cut here---------------start------------->8---
$ guix import pypi -r calcure

Starting download of /tmp/guix-file.7aaMby
From https://files.pythonhosted.org/packages/61/e3/c960430852d4322d42e02421=
690958f47fa2b42aaf4f3befb25c1c8baf21/calcure-2.8.6.tar.gz...
 =E2=80=A68.6.tar.gz  42KiB          2.1MiB/s 00:00 [##################] 10=
0.0%

Starting download of /tmp/guix-file.mPnbsd
From https://files.pythonhosted.org/packages/b5/a8/8ba240c952a13b3b2bee6435=
6dc1a1515c496100dc4c9edb6a6648927864/calcure-2.8.6-py3-none-any.whl...
 =E2=80=A6y3-none-any.whl  49KiB     1.9MiB/s 00:00 [##################] 10=
0.0%

Starting download of /tmp/guix-file.XzIPz0
From https://files.pythonhosted.org/packages/24/91/77edc7626400922d44019753=
c39e0fd911176ce3f77c3f85ac832d5d70b7/holidays-0.23.tar.gz...
In procedure connect*: Connection timed out

Starting download of /tmp/guix-file.XzIPz0
From https://web.archive.org/web/20230422212928/https://files.pythonhosted.=
org/packages/24/91/77edc7626400922d44019753c39e0fd911176ce3f77c3f85ac832d5d=
70b7/holidays-0.23.tar.gz...
In procedure connect*: Connection timed out
Trying to use Disarchive to assemble /tmp/guix-file.XzIPz0...
could not find its Disarchive specification
failed to download "/tmp/guix-file.XzIPz0" from "https://files.pythonhosted=
.org/packages/24/91/77edc7626400922d44019753c39e0fd911176ce3f77c3f85ac832d5=
d70b7/holidays-0.23.tar.gz"
Backtrace:
          10 (primitive-load "/home/timo/.config/guix/current/bin/gu=E2=80=
=A6")
In guix/ui.scm:
   2300:7  9 (run-guix . _)
  2263:10  8 (run-guix-command _ . _)
In guix/scripts/import.scm:
    89:11  7 (guix-import . _)
In ice-9/boot-9.scm:
  1752:10  6 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/import/pypi.scm:
    97:21  5 (_)
In guix/import/utils.scm:
    638:3  4 (recursive-import _ #:repo->guix-package _ #:guix-name . #)
   600:31  3 (topological-sort _ #<procedure 7f668bf7a8d0 at guix/i=E2=80=
=A6> =E2=80=A6)
In srfi/srfi-1.scm:
   586:17  2 (map1 (("holidays" #f) ("jdatetime" #f) ("ics" #f)))
In guix/import/utils.scm:
   630:33  1 (lookup-node "holidays" #f)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Wrong number of values returned to continuation (expected 2)
--8<---------------cut here---------------end--------------->8---

However, that URL is valid -- running a manual `guix download'
afterwards works fine:

--8<---------------cut here---------------start------------->8---
$ guix download 'https://files.pythonhosted.org/packages/24/91/77edc7626400=
922d44019753c39e0fd911176ce3f77c3f85ac832d5d70b7/holidays-0.23.tar.gz' =20

Starting download of /tmp/guix-file.vsuTGB
From https://files.pythonhosted.org/packages/24/91/77edc7626400922d44019753=
c39e0fd911176ce3f77c3f85ac832d5d70b7/holidays-0.23.tar.gz...
 =E2=80=A6.23.tar.gz  374KiB     2.5MiB/s 00:00 [##################] 100.0%
/gnu/store/jk0v685hhwirl16la349c7i5is640181-holidays-0.23.tar.gz
0yxs1lzbqykl25yf1hcrqjb7qqw69f2zgf7991slnkmk98p1bsxw
--8<---------------cut here---------------end--------------->8---




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: "Timo Wilken" <guix@HIDDEN>
Subject: bug#63024: Acknowledgement (Crash during `guix import pypi -r')
Message-ID: <handler.63024.B.168219355823659.ack <at> debbugs.gnu.org>
References: <CS3JUDMNK50H.14U373XKCHRIC@HIDDEN>
X-Gnu-PR-Message: ack 63024
X-Gnu-PR-Package: guix
Reply-To: 63024 <at> debbugs.gnu.org
Date: Sat, 22 Apr 2023 20:00:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-guix@HIDDEN

If you wish to submit further information on this problem, please
send it to 63024 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
63024: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63024
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Simon Tournier <zimon.toutoune@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Mon, 24 Apr 2023 08:54:02 +0000
Resent-Message-ID: <handler.63024.B63024.168232642319838 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Timo Wilken <guix@HIDDEN>, 63024 <at> debbugs.gnu.org
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168232642319838
          (code B ref 63024); Mon, 24 Apr 2023 08:54:02 +0000
Received: (at 63024) by debbugs.gnu.org; 24 Apr 2023 08:53:43 +0000
Received: from localhost ([127.0.0.1]:47486 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pqrx8-00059o-QK
	for submit <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:43 -0400
Received: from mail-wm1-f54.google.com ([209.85.128.54]:40986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1pqrx1-00058a-SD
 for 63024 <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:37 -0400
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-3f0968734f6so10288535e9.0
 for <63024 <at> debbugs.gnu.org>; Mon, 24 Apr 2023 01:53:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1682326410; x=1684918410;
 h=mime-version:message-id:date:references:in-reply-to:subject:to:from
 :from:to:cc:subject:date:message-id:reply-to;
 bh=X/v02LHTSaGAdUxfyNkL7jea0vkjsSEuN1+vjH/CC+4=;
 b=JLpwgoyuxX/EyGdT7gnbFjgG6dyeXnaaO5ertpm9titwqLNBhhSY6NHdLs38M3rRpF
 XABEYifkF5NO2iVPeL1rKJdYjyEwlbUqDqC2xkQBImyCSIc+MDyqjVyQpgX+UUH9GQu4
 f7u+dW6aRp+KjM/Jsu8nsTaAZ6bXcQazHfHlrneyqoKwX2gaOJgEcIwGorc5K6NDa5Ad
 rK/lvHh8ViIdcOJ29MQyCnwNHIbmT20fjonkk25abkIwBfAKa8eeOaHBG82RsxPpIQDI
 9+mcAjfWF0MmqXCDmth/tJUV8r5bTTrCmAX77n97qj9+eOLL95hczDuWJk/CdgKcWGyG
 f2KA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1682326410; x=1684918410;
 h=mime-version:message-id:date:references:in-reply-to:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=X/v02LHTSaGAdUxfyNkL7jea0vkjsSEuN1+vjH/CC+4=;
 b=ibi7Gv/KkAdlzDtkKoSWGRPKWVDEkafStwyGHi26GAmPjnQVaQTYIvovxqnEXIUozc
 +xZFyColPXHv60dgTrWmEwcPHR1D/2NGCiNLvNbT+nJZd2xr36vXwIDEI0Nllk94E/UW
 FOF/9RRxoaPctKlJbrgmWwOZfSak13lpvHnG8/59jTbyaSt1ST0IJyjNnz0sajGw84Hm
 MBLwsRqUrZjibgNciimtbjmb14ZnIuKlFt6PkGBcYVHkRb/YE/kPyQQDOFyrs3CcMAP6
 jgqmJB+Ph3b/y0E9XCRtureEZvmEAGOFZlb2eJuTRzpJjZuU+20t49tPliaGJk3BzzxK
 2fbg==
X-Gm-Message-State: AAQBX9daqN8b3n37Z7cw83PrZot3Jwti8TNJTjro+C/lXACRw9H2T1fs
 FWX8CucsKhG84InI251ypx1j5RI/twk=
X-Google-Smtp-Source: AKy350YsG1+8jKwlCUJwVYgv5R0GZ62tY6zJ47waO0b7brMTwIfgqIV00NDJbc8RXoJn0+WZV1Hsqg==
X-Received: by 2002:a05:600c:468a:b0:3f1:714d:c40b with SMTP id
 p10-20020a05600c468a00b003f1714dc40bmr9589257wmo.3.1682326410054; 
 Mon, 24 Apr 2023 01:53:30 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 p10-20020a1c544a000000b003f03d483966sm14951312wmi.44.2023.04.24.01.53.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Apr 2023 01:53:29 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
In-Reply-To: <CS3JUDMNK50H.14U373XKCHRIC@HIDDEN>
References: <CS3JUDMNK50H.14U373XKCHRIC@HIDDEN>
Date: Mon, 24 Apr 2023 10:33:49 +0200
Message-ID: <867cu1wufm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Sat, 22 Apr 2023 at 21:59, "Timo Wilken" <guix@HIDDEN> wrote:

> The `guix import pypi -r ...' command frequently crashes for me. When
> it does, it always crashes on the third download, the one for the
> first dependency's source distribution, like so:

Thanks for the report.  I am merging with #62334 [1].

1: http://issues.guix.gnu.org/issue/62334


Cheers,
simon




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 24 Apr 2023 08:53:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 24 04:53:41 2023
Received: from localhost ([127.0.0.1]:47482 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pqrx7-00059d-5l
	for submit <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:41 -0400
Received: from mail-wm1-f50.google.com ([209.85.128.50]:39004)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1pqrx0-00058W-QJ
 for control <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:35 -0400
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-3f16f792384so10675675e9.0
 for <control <at> debbugs.gnu.org>; Mon, 24 Apr 2023 01:53:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1682326409; x=1684918409;
 h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id
 :reply-to; bh=QZEw0oDkICey8ckenl3wlRIGCqvKQ/IDlkzc+j2fwYs=;
 b=M8ZrM4uguunwygEoQpLLg5sMp7Kb1yytp0PV6SqCkFPPphfWDx5mdgE1IpLahkmbhG
 s2rz8Z7LsEW1c+m8N2QGK4KTOUGgn0qBso4frY9xonWNoSz8933Divd0dMO3dHycNMUU
 A7hDVbeiu+G9nnP0cTCo8XS1tVMjYKp2VIKUJMOmwwNRYOywwDZP6+FNQjizizsWuk7x
 jxdbNh4wZBc18jXkYT80H4ASl+cDnyUskI29HjBr82Xv+k6NYlmSYRDxic3//B9GeTmh
 m+tmpf/0qbGV1celqM6SSWM4mEHRyQmdWmkaFcJjyLB/SdD4ImdX0ndw9R1PFShnnc5W
 x7dw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1682326409; x=1684918409;
 h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=QZEw0oDkICey8ckenl3wlRIGCqvKQ/IDlkzc+j2fwYs=;
 b=Fn96AcMur/U1BI2961Z0YzHP0fMbojJIaLhi7jwvsB8V1dSsnq0Ij4OHQVRAUiRVOD
 PsfrsCgmJJUa09NJzgg02Z4sq5jrNk1zfglZ0TaoBEOehUEivLQKg4Qd32YCnS+Q5F9z
 s3dbBPs/SWjJh3p64Ds8p4d6xnAgLyCDHBlz1ooOSenX8hCgpifuWKDSf6kSh3bVUGv5
 ial71fr60iricxESR8VpU7rxF6EkDtwQ0LyCoR6WY8wz6I6tGzGK3BYxSVCRbhTyc1Qa
 4Zap4j6h/oJGaxz0H09RDniQQTHMIEw7wfmMLDRTwInVIq/zLp7mEMEL6M/mwZa0gqli
 JyHg==
X-Gm-Message-State: AAQBX9cA1ayNE1doN1bgUck9MptDx9HUdlGgi2hl9ZItSE04gB7osnrD
 9ojrCZisvlEIOX/L/NZaXTqZz05w87U=
X-Google-Smtp-Source: AKy350aeenKyCaGjR8OqC3bUPkb+DvLkh0EHqyuE9R8yJpUe4qwGkXLI1da08MkNk11VNqOU+GzeOA==
X-Received: by 2002:adf:f9c7:0:b0:2f9:59a3:eb30 with SMTP id
 w7-20020adff9c7000000b002f959a3eb30mr7532523wrr.0.1682326409062; 
 Mon, 24 Apr 2023 01:53:29 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 c1-20020a5d4f01000000b002fc0de07930sm10293351wru.13.2023.04.24.01.53.28
 for <control <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Apr 2023 01:53:28 -0700 (PDT)
Date: Mon, 24 Apr 2023 10:28:12 +0200
Message-Id: <86bkjdwuoz.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: zimoun <zimon.toutoune@HIDDEN>
Subject: control message for bug #63024
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

merge 63024 62334
quit





Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 24 Apr 2023 08:53:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 24 04:53:42 2023
Received: from localhost ([127.0.0.1]:47484 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pqrx8-00059l-Jo
	for submit <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:42 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:41307)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1pqrx2-00058c-Ry
 for control <at> debbugs.gnu.org; Mon, 24 Apr 2023 04:53:37 -0400
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-2f94fe993edso355291f8f.1
 for <control <at> debbugs.gnu.org>; Mon, 24 Apr 2023 01:53:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1682326411; x=1684918411;
 h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id
 :reply-to; bh=9XgOhY5MX5H9f0YLwHAT3Ib/OOmmfvrBWnNZ4/NLq3c=;
 b=fr2YGG8Dj5J+Ve4ThB2tYTsbEjSkgw10Lj+cZ2KBge2HpDgBvAHsRF4mY400HnY1CV
 r9/A/VAbvofTUkCvpJcCmJ6g9gvCx0HUB4+6NbBROYJ9QUSWxYleOL6/YJyLAPhOxUZv
 t1/Bzt4hYPdSN1PCeaU8NVKTmFdlUT1V71Q85MjHowrfaicTVPcBydWxttLq2s62uPaC
 N3j202YMA6BXZYNDm/rd5PMlMILq/jWXHxLY3y08GdiVeN/U6ggDcgZnPxkhlXGayp8r
 Vp4TYpqCtbYZ4Keqlrsb8+O/+MFzksiLEJVbdV2jB4PSO/1KbwLw8yRkVrdWBPnoO1hs
 Lrfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1682326411; x=1684918411;
 h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=9XgOhY5MX5H9f0YLwHAT3Ib/OOmmfvrBWnNZ4/NLq3c=;
 b=dFv7fXS5mz4PqqZaD4fHvZ6R9dj9PPgoYhYsHAlR9hU90xYFKqrT3ocWW6m++3kLix
 9P20mH1DlEP4geEfp7JS9KnDdbdku27fPeaC5eherKazCzOdIEUg3L5s9ow2TcdXGxIZ
 57ZQ965GQOzRU1BrKGGidrdm4Rg5UCrynv4HTfTNYnpod+fBU21WA4FTwjSHgD7mEh2k
 3K7i8gt7kyz0Ryn3lsv8aBxEIyNfbqQfLA6mVmKoTa3PmRsuWCKPDTeJawcRO9QSm22E
 z81NM29+GBhYZeu76Y2TwMkbYnHwrxEPDFKp97uZVhCiUTnDqNpcjjBm410Wm7UcREom
 I8pw==
X-Gm-Message-State: AAQBX9dSAP55iQT+aPE0EmtN4ycMOfSBy7Yx0NkQKcyl/GyLzueFHlNw
 qgvF0zfhHnxMWIYDQj1JMhpJcW6akfM=
X-Google-Smtp-Source: AKy350Y4QcmjigFwornlY5GFFSV1esEORFJyl/JxoRKzo6BD4tk8DKSFk2235Y52rjUzEiVMPUtHsA==
X-Received: by 2002:a5d:4fcd:0:b0:2f8:dbb3:2d0c with SMTP id
 h13-20020a5d4fcd000000b002f8dbb32d0cmr7954368wrw.3.1682326411014; 
 Mon, 24 Apr 2023 01:53:31 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 m6-20020a5d6246000000b002feea065cc9sm10225841wrv.111.2023.04.24.01.53.30
 for <control <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Apr 2023 01:53:30 -0700 (PDT)
Date: Mon, 24 Apr 2023 10:36:06 +0200
Message-Id: <865y9lwubt.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: zimoun <zimon.toutoune@HIDDEN>
Subject: control message for bug #62765
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

merge 62765 62334
quit





Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Tue, 02 May 2023 21:48:02 +0000
Resent-Message-ID: <handler.63024.B63024.168306405718631 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Greg Hogan <code@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168306405718631
          (code B ref 63024); Tue, 02 May 2023 21:48:02 +0000
Received: (at 63024) by debbugs.gnu.org; 2 May 2023 21:47:37 +0000
Received: from localhost ([127.0.0.1]:45214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ptxqS-0004qM-6K
	for submit <at> debbugs.gnu.org; Tue, 02 May 2023 17:47:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1ptxqP-0004pp-QI; Tue, 02 May 2023 17:47:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ptxqK-0002rk-6Y; Tue, 02 May 2023 17:47:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=03mEDkqHutfu+ZEJiWGkHrV+Y0B1e8fzbCdUb8NoRJ4=; b=kQLpz1TX0LZ0/LVyh+ww
 DJaAM782OYzyPHEW50/QKiWnz+zcroxNd/+fkzdP4Lmmry4ugpax0pzAXPd0sWZ3sOBBXuIpHuM5G
 kwoWOy1fDmzeUEOhrxUh2qbJnHlU7ZP+wh/wXIa4QHo2x1nyLf3qcpl8cqZMNnHavYQLe++KtHPPr
 L2RRobKNM8mXlHljrQwbc/NgnXQE2sLxev0SQqRuPzDyRfCd009u22Cydn3f9JURLy57NZSkjiOKj
 BJn4UiKsLuDlReoIBNQUmy2XAiH3giECPQzeK9yoUSsp1XExbENBhVa9c+x+ePEoByG07aW0FWSv5
 eOOQ0jkWZ1Q/lA==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ptxqJ-0004Bs-Kx; Tue, 02 May 2023 17:47:27 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
Date: Tue, 02 May 2023 23:47:24 +0200
In-Reply-To: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 (Greg Hogan's message of "Tue, 21 Mar 2023 10:17:22 -0400")
Message-ID: <87jzxq5rtf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

Greg Hogan <code@HIDDEN> skribis:

> Starting download of /tmp/guix-file.xReGb4
>>From https://web.archive.org/web/20230321140958/https://files.pythonhoste=
d.org/packages/49/01/21337857631a97ab551bb2e3b5691ed6b1b9586011aa6a5355b969=
4a37fa/demon-2.0.6.tar.gz...
> In procedure connect*: Connection timed out

I can very much reproduce the bug with =E2=80=9Cguix import pypi -r cdlib=
=E2=80=9D on
39ba8a10971f15264966823e8696d63c2995df86 and thereabouts.  Turns out
it=E2=80=99s a fun story!  (Josselin, I=E2=80=99m sure you=E2=80=99ll love =
it.)

First, the person who wrote =E2=80=98connect*=E2=80=99 *cough* hadn=E2=80=
=99t carefully read the
Guile manual, which reads (info "(guile) Ports and File Descriptors"):

  Note that =E2=80=98select=E2=80=99 may return early for other reasons, fo=
r example due
  to pending interrupts.

Clearly, =E2=80=98select=E2=80=99 is returning early, so we should check th=
at and loop.
So far, so good.

Now, why is =E2=80=98select=E2=80=99 returning immediately?  Because the un=
derlying
select(2) call is passed an extra file descriptor, the =E2=80=9Csleep pipe=
=E2=80=9D, as
you can see in =E2=80=98scm_std_select=E2=80=99 in libguile, and it=E2=80=
=99s that file
descriptor, number 3, that=E2=80=99s active at each select(2) call:

--8<---------------cut here---------------start------------->8---
28825 23:06:04 pselect6(15, [3], [14], [14], {tv_sec=3D10, tv_nsec=3D0}, NU=
LL) =3D 1 (in [3], left {tv_sec=3D9, tv_nsec=3D999991063}) <0.000079>
28825 23:06:04 read(3, "A", 1)          =3D 1 <0.000044>
--8<---------------cut here---------------end--------------->8---

Why so much activity on that =E2=80=9Csleep pipe=E2=80=9D, you ask?  Well, =
once we=E2=80=99ve
filtered the read(3, =E2=80=A6) calls, a pattern appears:

--8<---------------cut here---------------start------------->8---
  14335:28825 23:06:04 read(3, "A", 1)          =3D 1 <0.000044>
  14344:28825 23:06:04 read(3, "r", 1)          =3D 1 <0.000121>
  14353:28825 23:06:04 read(3, "c", 1)          =3D 1 <0.000107>
  14362:28825 23:06:04 read(3, "h", 1)          =3D 1 <0.000040>
  14436:28825 23:06:04 read(3, "i", 1)          =3D 1 <0.000049>
  14445:28825 23:06:04 read(3, "v", 1)          =3D 1 <0.000029>
  14454:28825 23:06:04 read(3, "e", 1)          =3D 1 <0.000019>
  14463:28825 23:06:04 read(3, ":", 1)          =3D 1 <0.000017>
  14472:28825 23:06:04 read(3, " ", 1)          =3D 1 <0.000019>
  14481:28825 23:06:04 read(3, " ", 1)          =3D 1 <0.000020>
  14490:28825 23:06:04 read(3, "/", 1)          =3D 1 <0.000019>
  14499:28825 23:06:04 read(3, "t", 1)          =3D 1 <0.000015>
  14508:28825 23:06:04 read(3, "m", 1)          =3D 1 <0.000018>
  15001:28825 23:06:04 read(3, "p", 1)          =3D 1 <0.000015>
  15010:28825 23:06:04 read(3, "/", 1)          =3D 1 <0.000016>
  15019:28825 23:06:04 read(3, "g", 1)          =3D 1 <0.000016>
  15028:28825 23:06:04 read(3, "u", 1)          =3D 1 <0.000015>
  15037:28825 23:06:04 read(3, "i", 1)          =3D 1 <0.000015>
  15046:28825 23:06:04 read(3, "x", 1)          =3D 1 <0.000015>
  15055:28825 23:06:04 read(3, "-", 1)          =3D 1 <0.000015>
--8<---------------cut here---------------end--------------->8---

See?  Who=E2=80=99s chatting over our sleep pipe?

--8<---------------cut here---------------start------------->8---
   4806:28831 23:06:03 dup2(0, 3)               =3D 3 <0.000011>
   4807:28831 23:06:03 dup2(3, 0)               =3D 0 <0.000011>
   4808:28831 23:06:03 dup2(4, 1)               =3D 1 <0.000012>
   4809:28831 23:06:03 dup2(5, 2)               =3D 2 <0.000010>
   4810:28831 23:06:03 close(3)                 =3D 0 <0.000010>
   4811:28831 23:06:03 close(4)                 =3D 0 <0.000011>
   4812:28831 23:06:03 close(5)                 =3D 0 <0.000010>
   4813:28831 23:06:03 close(6)                 =3D 0 <0.000010>
   4814:28831 23:06:03 close(7)                 =3D 0 <0.000010>
   4815:28831 23:06:03 close(8)                 =3D 0 <0.000011>
   4816:28831 23:06:03 close(9)                 =3D 0 <0.000010>
   4817:28831 23:06:03 close(10)                =3D 0 <0.000010>
   4818:28831 23:06:03 close(11)                =3D 0 <0.000011>
   4819:28831 23:06:03 close(12)                =3D 0 <0.000010>
   4820:28831 23:06:03 close(13)                =3D 0 <0.000010>
   4821:28831 23:06:03 close(14)                =3D 0 <0.000011>
   4822:28831 23:06:03 close(15)                =3D -1 EBADF (Bad file desc=
riptor) <0.000011>
   4823:28831 23:06:03 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=3D1024, =
rlim_max=3D4*1024}) =3D 0 <0.000011>
   4824:28831 23:06:03 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) =3D 0 <0.00=
0010>
   4825:28831 23:06:03 execve("/home/ludo/src/guix/scripts/unzip", ["unzip"=
, "/tmp/guix-file.bmholm", "-d", "/tmp/guix-directory.Ok2DAA", "cdlib-0.2.6=
.dist-info/METADATA"], 0x18a7db0 /* 85 v
   [=E2=80=A6]
   4938:28831 23:06:03 write(1, "Archive:  /tmp/guix-file.bmholm\n", 32) =
=3D 32 <0.000018>
--8<---------------cut here---------------end--------------->8---

=E2=80=98unzip=E2=80=99!  And all its friends invoked from (guix import pyp=
i):

--8<---------------cut here---------------start------------->8---
        (call-with-temporary-directory
         (lambda (dir)
           (parameterize ((current-error-port (%make-void-port "rw+"))
                          (current-output-port (%make-void-port "rw+")))
             (if (string=3D? "zip" (file-extension source-url))
                 (invoke "unzip" archive "-d" dir)
                 (invoke "tar" "xf" archive "-C" dir)))
           =E2=80=A6))
--8<---------------cut here---------------end--------------->8---

Looks like we shoudn=E2=80=99t dup(4, 1) in the child process, because 4 is=
 the
other end of our sleep pipe.  :-)

The problem exists both in 3.0.9 and Guile =E2=80=98main=E2=80=99.  Looks r=
elated to the
file descriptor shuffling code in =E2=80=98do_spawn=E2=80=99.  WDYT, Jossel=
in?

Ludo=E2=80=99.




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Tue, 02 May 2023 21:49:03 +0000
Resent-Message-ID: <handler.63024.B63024.168306411719035 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Greg Hogan <code@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168306411719035
          (code B ref 63024); Tue, 02 May 2023 21:49:03 +0000
Received: (at 63024) by debbugs.gnu.org; 2 May 2023 21:48:37 +0000
Received: from localhost ([127.0.0.1]:45222 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ptxrQ-0004wv-JM
	for submit <at> debbugs.gnu.org; Tue, 02 May 2023 17:48:37 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1ptxrP-0004wV-5E; Tue, 02 May 2023 17:48:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ptxrJ-00035U-Tx; Tue, 02 May 2023 17:48:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=03mEDkqHutfu+ZEJiWGkHrV+Y0B1e8fzbCdUb8NoRJ4=; b=SAwPrgE2Ie5050JF5Z7v
 pYXCw7SPlYKABXhwJa2YlYr9g6CvmlNUkuQfZ/fdsW8gTmf4kd8s/z2g099enlr0OC5XO/DG/DjtQ
 rvba1xNi5dolyqd4bD2d1T7rR8V/9HH+xb8E2gody4x57nDGf8tFbyDstIrhBBmJ/LtFGPL1NTVSg
 DAf4NY9C6QlnKg+cYvkRcE6v9gmj+MZIYMU3nttjsIpprlXpYKQbSqKy7UdnJYK6r+x891YlyAPEs
 G8iuyFCx4HzDvipnjkZHi5xjzeToHspaNEIIAooIKXuyl3ybVDHBhIV7eoMkpnt7Fno6AwCrHPlcW
 LNAZprN892OQbA==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ptxrJ-0004Pg-4M; Tue, 02 May 2023 17:48:29 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
In-Reply-To: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 (Greg Hogan's message of "Tue, 21 Mar 2023 10:17:22 -0400")
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Date: Tue, 02 May 2023 23:48:26 +0200
Message-ID: <87fs8e5rrp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

Greg Hogan <code@HIDDEN> skribis:

> Starting download of /tmp/guix-file.xReGb4
>>From https://web.archive.org/web/20230321140958/https://files.pythonhoste=
d.org/packages/49/01/21337857631a97ab551bb2e3b5691ed6b1b9586011aa6a5355b969=
4a37fa/demon-2.0.6.tar.gz...
> In procedure connect*: Connection timed out

I can very much reproduce the bug with =E2=80=9Cguix import pypi -r cdlib=
=E2=80=9D on
39ba8a10971f15264966823e8696d63c2995df86 and thereabouts.  Turns out
it=E2=80=99s a fun story!  (Josselin, I=E2=80=99m sure you=E2=80=99ll love =
it.)

First, the person who wrote =E2=80=98connect*=E2=80=99 *cough* hadn=E2=80=
=99t carefully read the
Guile manual, which reads (info "(guile) Ports and File Descriptors"):

  Note that =E2=80=98select=E2=80=99 may return early for other reasons, fo=
r example due
  to pending interrupts.

Clearly, =E2=80=98select=E2=80=99 is returning early, so we should check th=
at and loop.
So far, so good.

Now, why is =E2=80=98select=E2=80=99 returning immediately?  Because the un=
derlying
select(2) call is passed an extra file descriptor, the =E2=80=9Csleep pipe=
=E2=80=9D, as
you can see in =E2=80=98scm_std_select=E2=80=99 in libguile, and it=E2=80=
=99s that file
descriptor, number 3, that=E2=80=99s active at each select(2) call:

--8<---------------cut here---------------start------------->8---
28825 23:06:04 pselect6(15, [3], [14], [14], {tv_sec=3D10, tv_nsec=3D0}, NU=
LL) =3D 1 (in [3], left {tv_sec=3D9, tv_nsec=3D999991063}) <0.000079>
28825 23:06:04 read(3, "A", 1)          =3D 1 <0.000044>
--8<---------------cut here---------------end--------------->8---

Why so much activity on that =E2=80=9Csleep pipe=E2=80=9D, you ask?  Well, =
once we=E2=80=99ve
filtered the read(3, =E2=80=A6) calls, a pattern appears:

--8<---------------cut here---------------start------------->8---
  14335:28825 23:06:04 read(3, "A", 1)          =3D 1 <0.000044>
  14344:28825 23:06:04 read(3, "r", 1)          =3D 1 <0.000121>
  14353:28825 23:06:04 read(3, "c", 1)          =3D 1 <0.000107>
  14362:28825 23:06:04 read(3, "h", 1)          =3D 1 <0.000040>
  14436:28825 23:06:04 read(3, "i", 1)          =3D 1 <0.000049>
  14445:28825 23:06:04 read(3, "v", 1)          =3D 1 <0.000029>
  14454:28825 23:06:04 read(3, "e", 1)          =3D 1 <0.000019>
  14463:28825 23:06:04 read(3, ":", 1)          =3D 1 <0.000017>
  14472:28825 23:06:04 read(3, " ", 1)          =3D 1 <0.000019>
  14481:28825 23:06:04 read(3, " ", 1)          =3D 1 <0.000020>
  14490:28825 23:06:04 read(3, "/", 1)          =3D 1 <0.000019>
  14499:28825 23:06:04 read(3, "t", 1)          =3D 1 <0.000015>
  14508:28825 23:06:04 read(3, "m", 1)          =3D 1 <0.000018>
  15001:28825 23:06:04 read(3, "p", 1)          =3D 1 <0.000015>
  15010:28825 23:06:04 read(3, "/", 1)          =3D 1 <0.000016>
  15019:28825 23:06:04 read(3, "g", 1)          =3D 1 <0.000016>
  15028:28825 23:06:04 read(3, "u", 1)          =3D 1 <0.000015>
  15037:28825 23:06:04 read(3, "i", 1)          =3D 1 <0.000015>
  15046:28825 23:06:04 read(3, "x", 1)          =3D 1 <0.000015>
  15055:28825 23:06:04 read(3, "-", 1)          =3D 1 <0.000015>
--8<---------------cut here---------------end--------------->8---

See?  Who=E2=80=99s chatting over our sleep pipe?

--8<---------------cut here---------------start------------->8---
   4806:28831 23:06:03 dup2(0, 3)               =3D 3 <0.000011>
   4807:28831 23:06:03 dup2(3, 0)               =3D 0 <0.000011>
   4808:28831 23:06:03 dup2(4, 1)               =3D 1 <0.000012>
   4809:28831 23:06:03 dup2(5, 2)               =3D 2 <0.000010>
   4810:28831 23:06:03 close(3)                 =3D 0 <0.000010>
   4811:28831 23:06:03 close(4)                 =3D 0 <0.000011>
   4812:28831 23:06:03 close(5)                 =3D 0 <0.000010>
   4813:28831 23:06:03 close(6)                 =3D 0 <0.000010>
   4814:28831 23:06:03 close(7)                 =3D 0 <0.000010>
   4815:28831 23:06:03 close(8)                 =3D 0 <0.000011>
   4816:28831 23:06:03 close(9)                 =3D 0 <0.000010>
   4817:28831 23:06:03 close(10)                =3D 0 <0.000010>
   4818:28831 23:06:03 close(11)                =3D 0 <0.000011>
   4819:28831 23:06:03 close(12)                =3D 0 <0.000010>
   4820:28831 23:06:03 close(13)                =3D 0 <0.000010>
   4821:28831 23:06:03 close(14)                =3D 0 <0.000011>
   4822:28831 23:06:03 close(15)                =3D -1 EBADF (Bad file desc=
riptor) <0.000011>
   4823:28831 23:06:03 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=3D1024, =
rlim_max=3D4*1024}) =3D 0 <0.000011>
   4824:28831 23:06:03 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) =3D 0 <0.00=
0010>
   4825:28831 23:06:03 execve("/home/ludo/src/guix/scripts/unzip", ["unzip"=
, "/tmp/guix-file.bmholm", "-d", "/tmp/guix-directory.Ok2DAA", "cdlib-0.2.6=
.dist-info/METADATA"], 0x18a7db0 /* 85 v
   [=E2=80=A6]
   4938:28831 23:06:03 write(1, "Archive:  /tmp/guix-file.bmholm\n", 32) =
=3D 32 <0.000018>
--8<---------------cut here---------------end--------------->8---

=E2=80=98unzip=E2=80=99!  And all its friends invoked from (guix import pyp=
i):

--8<---------------cut here---------------start------------->8---
        (call-with-temporary-directory
         (lambda (dir)
           (parameterize ((current-error-port (%make-void-port "rw+"))
                          (current-output-port (%make-void-port "rw+")))
             (if (string=3D? "zip" (file-extension source-url))
                 (invoke "unzip" archive "-d" dir)
                 (invoke "tar" "xf" archive "-C" dir)))
           =E2=80=A6))
--8<---------------cut here---------------end--------------->8---

Looks like we shoudn=E2=80=99t dup(4, 1) in the child process, because 4 is=
 the
other end of our sleep pipe.  :-)

The problem exists both in 3.0.9 and Guile =E2=80=98main=E2=80=99.  Looks r=
elated to the
file descriptor shuffling code in =E2=80=98do_spawn=E2=80=99.  WDYT, Jossel=
in?

Ludo=E2=80=99.




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 2 May 2023 21:49:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 02 17:49:34 2023
Received: from localhost ([127.0.0.1]:45230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ptxsL-0004yx-Uj
	for submit <at> debbugs.gnu.org; Tue, 02 May 2023 17:49:34 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37780)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ptxsK-0004yk-BO
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:49:32 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1ptxsF-0003Sh-3f
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:49:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to:
 references; bh=U84a4GFDdDdueknj70fR50glVeG9xEaF75ZyUo6eKtU=; b=pdqSLw9jgEWZo2
 caJ5U7VB9e/qIJ3mJ+5+UUKkkOKNs9y6+UOuewEX07UU13czvitBLwg9xxhRtRZbzpnIIFDY5QaIj
 v/WC9Q0aSRsLpyKKldycLdCbAWbzBN5oBaWImbJ8zCpodcavJBO0o1oPesrwp+TIruhQlqGEE5lEZ
 ePQJgN/11EJKEld/QlduLKlDLaqpVeazLcDCYCw3zx7S7UGwAs/B3mLmN/5gEu0MVXQ8SExArRUkk
 jZvJvQwElC2rWArZvtrFW0P4hbzFP8xHXZZnUcLY7Jrk8NPhbuMEhw0uE0eV9WF6iEHpmOD2Erh4F
 AYIRHpBCrIqJsMoJ4nTw==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1ptxsD-0004Ur-9s
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:49:26 -0400
Date: Tue, 02 May 2023 23:49:23 +0200
Message-Id: <87a5ym5rq4.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Subject: control message for bug #63024
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

severity 63024 important
quit





Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 2 May 2023 21:50:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 02 17:50:16 2023
Received: from localhost ([127.0.0.1]:45235 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ptxt2-00050j-8T
	for submit <at> debbugs.gnu.org; Tue, 02 May 2023 17:50:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34956)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ptxt0-00050W-NA
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:50:15 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1ptxsv-0004ew-GQ
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:50:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to:
 references; bh=89UGaDvEzRuvoNgrv8O/bn+UYEdCUwQ4l2Zi5ddYe5Y=; b=Z05kJ/CxKuSJb+
 Q+Xd8KF5mNErlOY1R4K76AWWy4Ez8fkFQ8iwl2x55Farv8kPkv2O1KJwFdk8d6CGJZky0NLvnlbZU
 6XaplJkQUSfHH4tXU00+MmWBac4SvkXYDCxx+/LE7rMU0yOcLw4i3QdWYHyRJ44qHoaloZ0nNv//k
 WDOBJRHwULiAuSRbGxx3/DZQde32abPlcMm+PARa0RL81RCOqHu+YeVAp/Fbon6MJWqHt/rxXTF7k
 KUrcsMufQCqqgaHE0oXKiU2U7TfbKMlnXrH0BRKdlCRPmCPRy6I3lJgVW7eXBq1W3USA2aBtCi9Wb
 HIHXr3D1SuXI3VDlmxrg==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1ptxsv-0004Yi-2t
 for control <at> debbugs.gnu.org; Tue, 02 May 2023 17:50:09 -0400
Date: Tue, 02 May 2023 23:50:07 +0200
Message-Id: <878re65row.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Subject: control message for bug #63024
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

retitle 63024 Guile's "sleep pipe" can leak into processes created by 'spawn'
quit





Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Wed, 03 May 2023 09:05:02 +0000
Resent-Message-ID: <handler.63024.B63024.16831046695681 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.16831046695681
          (code B ref 63024); Wed, 03 May 2023 09:05:02 +0000
Received: (at 63024) by debbugs.gnu.org; 3 May 2023 09:04:29 +0000
Received: from localhost ([127.0.0.1]:45555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pu8PS-0001TS-W8
	for submit <at> debbugs.gnu.org; Wed, 03 May 2023 05:04:28 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51932)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1pu8PO-0001T5-Hr; Wed, 03 May 2023 05:04:25 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1pu8PI-0001GK-Pb; Wed, 03 May 2023 05:04:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=S3fzsM5rryV3xMI2hyrP/SLarwudO9iP67Zcjq8M5uQ=; b=FxGskAtMIJWahnwnuQJw
 X/EDpWWhmSEUjZVSwiyn/nAZi819KUKTxsytoDm7WHwMyDZtl+LKpwH1+lHA/ZLdDtCEIXrAxCxDW
 2mpCsXFBfMD8Hz83DnaQshH2lciMbPt4KyL7IVYEJ3sEV13rl2L1WfW585gNo+vUv0YfRHs8Yj5B/
 CGxxoBE8rNQgrNlSQ+h/+jq/ibHoTN2/mFev3QpRp+c2BUVMBK6ajM/D/gkFSYxL3TFBHcw6juANf
 m00PbktW375QlKtwGkzV4GyjncgZK3dnFMI64owaO9snCyz3s3OSzOc+V0sLEsRZrMD/Lh3pOmWyz
 e2FwpMi6Kz+t+A==;
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1pu8PI-0001sY-5u; Wed, 03 May 2023 05:04:16 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 <87fs8e5rrp.fsf@HIDDEN>
Date: Wed, 03 May 2023 11:04:14 +0200
In-Reply-To: <87fs8e5rrp.fsf@HIDDEN> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 02 May 2023 23:48:26 +0200")
Message-ID: <87mt2l4whd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hey,

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> Looks like we shoudn=E2=80=99t dup(4, 1) in the child process, because 4 =
is the
> other end of our sleep pipe.  :-)

How about this patch, Josselin?

Ludo=E2=80=99.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

diff --git a/libguile/posix.c b/libguile/posix.c
index 3adc743c4..2d55d985c 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1388,11 +1388,27 @@ do_spawn (char *exec_file, char **exec_argv, char **exec_env,
     }
 
   /* Move the fds out of the way, so that duplicate fds or fds equal
-     to 0, 1, 2 don't trample each other */
+     to 0, 1, 2 don't trample each other.  Since 'system*' might give
+     us -1 for IN, OUT, or ERR, open /dev/null when that's the case.  */
+
+  if (in < 0)
+    posix_spawn_file_actions_addopen (&actions, fd_slot[0],
+                                      "/dev/null", O_RDONLY | O_CLOEXEC, 0);
+  else
+    posix_spawn_file_actions_adddup2 (&actions, in, fd_slot[0]);
+
+  if (out < 0)
+    posix_spawn_file_actions_addopen (&actions, fd_slot[1],
+                                      "/dev/null", O_WRONLY | O_CLOEXEC, 0);
+  else
+    posix_spawn_file_actions_adddup2 (&actions, out, fd_slot[1]);
+
+  if (err < 0)
+    posix_spawn_file_actions_addopen (&actions, fd_slot[2],
+                                      "/dev/null", O_WRONLY | O_CLOEXEC, 0);
+  else
+    posix_spawn_file_actions_adddup2 (&actions, err, fd_slot[2]);
 
-  posix_spawn_file_actions_adddup2 (&actions, in, fd_slot[0]);
-  posix_spawn_file_actions_adddup2 (&actions, out, fd_slot[1]);
-  posix_spawn_file_actions_adddup2 (&actions, err, fd_slot[2]);
   posix_spawn_file_actions_adddup2 (&actions, fd_slot[0], 0);
   posix_spawn_file_actions_adddup2 (&actions, fd_slot[1], 1);
   posix_spawn_file_actions_adddup2 (&actions, fd_slot[2], 2);
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index d5cf47cda..18dad8902 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -374,7 +374,17 @@
                     (system* "sh" "-c" "echo bong >&2"))))))))
 
       (and (zero? (status:exit-val status))
-           (call-with-input-file file get-string-all)))))
+           (call-with-input-file file get-string-all))))
+
+  (pass-if-equal "https://bugs.gnu.org/63024"
+      0
+    (if (file-exists? "/proc/self/fd/0")          ;on GNU/Linux?
+        (parameterize ((current-output-port (%make-void-port "w0")))
+          (system* "guile" "-c"
+                   (object->string
+                    '(exit (string=? "/dev/null"
+                                     (readlink "/proc/self/fd/1"))))))
+        (throw 'unresolved))))
 
 ;;
 ;; spawn

--=-=-=--




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: bug#62334: bug#63024: Crash during `guix import pypi -r'
Resent-From: Simon Tournier <zimon.toutoune@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Wed, 03 May 2023 17:25:03 +0000
Resent-Message-ID: <handler.63024.B63024.168313465510758 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168313465510758
          (code B ref 63024); Wed, 03 May 2023 17:25:03 +0000
Received: (at 63024) by debbugs.gnu.org; 3 May 2023 17:24:15 +0000
Received: from localhost ([127.0.0.1]:47631 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puGD9-0002nK-9Z
	for submit <at> debbugs.gnu.org; Wed, 03 May 2023 13:24:15 -0400
Received: from mail-wm1-f44.google.com ([209.85.128.44]:39179)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>)
 id 1puGD1-0002mE-Sk; Wed, 03 May 2023 13:24:11 -0400
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-3f17b5552e9so12650305e9.1; 
 Wed, 03 May 2023 10:24:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1683134642; x=1685726642;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=VJcop06UJpJhiYXR9hA9Pa5woaDOZkvoZZz+bv58azs=;
 b=sKf9NZ+84ihjcDJKp+g8Q9PwOSOVy8YnB3JH6lY2gDAIaQyfF33sGZjNiawqzaEj2/
 4X3P9ASiVJEikgTXnFkt7V8ugSQSUEYcICW6GHwd64SXE/8V7lGXu88c5p9GIMWVXTet
 Ms14dr7qTyXqsKTGBgK+h1YFP9ZbRCtsLjfM3pwawp0t+jz4sjv4/kGrNGay7fNEis1H
 nnXiUlWJJlIl+oxWrOt3RvxaH81UkTUNlXc8jPmQDsQ9eCtRi+IOBCASQ8Sibo0+HOJn
 oK7uCVE3xrV3mfze4Y+CNCL2CePixSwp57Ra6vS0lVhRfCBHuTKxT8WUrJhaoyIU7Ucu
 JENg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1683134642; x=1685726642;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=VJcop06UJpJhiYXR9hA9Pa5woaDOZkvoZZz+bv58azs=;
 b=dQeRXNhYUAnNgZdNMgyzIqYhvc7MsKhIYV1ChkrdiK8x+lFcVg53HLVQi2AilNq+Lm
 ftSyByPnJp9nUeYL6Qb84eqdcOoIT6KHhKSwbVVXgYoyOMLm6S7UIxSRRWD67hXVbawp
 +MCF1iioQgySLXE8OULGsHwo07ltDpLTHKqG2l3z3Ar34hTAI6tkoxB8QlCygd+unN5k
 arQ/XlemoxT/jGiLUPb3qywg2ssMqBEscxe/sZ9lTzEF9pOR5L4fRYh+YmyK7Nk75dVn
 Q77v9DRz3rxMTWqz0MGMPUc+jOCThl1f1lWKgDTciDZnrywUvSBmEybzr4QWx8iESAuc
 uIqA==
X-Gm-Message-State: AC+VfDyrbyM3X7FRT7nxg2KnU00ilZrczJQ51vfx2j1w6KqUu/CvCfoA
 YHwI09EMTbYnNomTJXSr3+Y=
X-Google-Smtp-Source: ACHHUZ7ZzVG5xzvTHruZdjQhca7ODyTsUkaRs8TeU8CLXvsfInVg+bEufRRG0blPLK0MOb6BEHVPKQ==
X-Received: by 2002:a1c:750c:0:b0:3f1:727f:1967 with SMTP id
 o12-20020a1c750c000000b003f1727f1967mr5092522wmc.4.1683134641767; 
 Wed, 03 May 2023 10:24:01 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 l9-20020a1c7909000000b003f193d7c6b7sm2418378wme.41.2023.05.03.10.24.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 03 May 2023 10:24:01 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
In-Reply-To: <87mt2l4whd.fsf@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 <87fs8e5rrp.fsf@HIDDEN> <87mt2l4whd.fsf@HIDDEN>
Date: Wed, 03 May 2023 12:08:01 +0200
Message-ID: <86354d20e6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi Ludo, On Wed, 03 May 2023 at 11:04, Ludovic =?UTF-8?Q?Court=C3=A8s?= wrote:
    > diff --git a/libguile/posix.c b/libguile/posix.c > index 3adc743c4..2d55d985c
    100644 > --- a/libguile/posix.c > +++ b/libguile/posix.c 
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (zimon.toutoune[at]gmail.com)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
  1.1 DATE_IN_PAST_06_12     Date: is 6 to 12 hours before Received: date
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.128.44 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.128.44 listed in list.dnswl.org]
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.1 (/)

Hi Ludo,

On Wed, 03 May 2023 at 11:04, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

> diff --git a/libguile/posix.c b/libguile/posix.c
> index 3adc743c4..2d55d985c 100644
> --- a/libguile/posix.c
> +++ b/libguile/posix.c

Does it mean patch the current Guile or a new release of Guile?


Cheers,
simon




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Thu, 04 May 2023 11:11:02 +0000
Resent-Message-ID: <handler.63024.B63024.168319864922349 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Simon Tournier <zimon.toutoune@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, 63024 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, 62334 <at> debbugs.gnu.org
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168319864922349
          (code B ref 63024); Thu, 04 May 2023 11:11:02 +0000
Received: (at 63024) by debbugs.gnu.org; 4 May 2023 11:10:49 +0000
Received: from localhost ([127.0.0.1]:48686 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puWrJ-0005oJ-6E
	for submit <at> debbugs.gnu.org; Thu, 04 May 2023 07:10:49 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53720)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1puWrD-0005nn-Du; Thu, 04 May 2023 07:10:47 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1puWr7-0006DP-Pj; Thu, 04 May 2023 07:10:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=PVup17f5T4GqerAy3BfhvPUnrpxyfzbkEAX8uG3E3YM=; b=nFPvT2M/L22jYzXiU+vm
 lSpB7VPbebNtoz7OSeDiDM03YyGBrSauJIfl3qtqNZ+0sc8X5joTjZmZIuBSNFaeivXaoClUoNji9
 iFqWh8LkdgfJx4GnpXBlNWgC2ckKax1gcJNz76dp39KGYWFDGC2/1jD7umSyyWPKeKa5o0ZukMyba
 k55Utem4O3YydL/V+MbmXva4884FxW4VFjptD58RRw2Hc032ONz3LpmsukMvPvhj14q6jYzWrWPl4
 rZ7xzKmeGv22MlhCk2QmMrnVwLaEaUaE/IutAmFzlaP6OWka49bKKAI2sXqgLtJf0Kvqfi0KsBtIw
 p8F9I/vRaSjVBg==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1puWr7-0002Qy-Bq; Thu, 04 May 2023 07:10:37 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 <87fs8e5rrp.fsf@HIDDEN> <87mt2l4whd.fsf@HIDDEN>
 <86354d20e6.fsf@HIDDEN>
Date: Thu, 04 May 2023 13:10:34 +0200
In-Reply-To: <86354d20e6.fsf@HIDDEN> (Simon Tournier's message of "Wed, 03
 May 2023 12:08:01 +0200")
Message-ID: <877ctotkr9.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Simon Tournier <zimon.toutoune@HIDDEN> skribis:

> On Wed, 03 May 2023 at 11:04, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
>
>> diff --git a/libguile/posix.c b/libguile/posix.c
>> index 3adc743c4..2d55d985c 100644
>> --- a/libguile/posix.c
>> +++ b/libguile/posix.c
>
> Does it mean patch the current Guile or a new release of Guile?

It=E2=80=99s a patch against Guile =E2=80=98main=E2=80=99.  That gives an i=
ncentive to push a
new Guile release.

Ludo=E2=80=99.




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Thu, 04 May 2023 11:14:02 +0000
Resent-Message-ID: <handler.63024.B63024.168319880222682 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Greg Hogan <code@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168319880222682
          (code B ref 63024); Thu, 04 May 2023 11:14:02 +0000
Received: (at 63024) by debbugs.gnu.org; 4 May 2023 11:13:22 +0000
Received: from localhost ([127.0.0.1]:48711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puWtm-0005tm-1D
	for submit <at> debbugs.gnu.org; Thu, 04 May 2023 07:13:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1puWti-0005tJ-W3; Thu, 04 May 2023 07:13:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1puWtd-0007ff-PG; Thu, 04 May 2023 07:13:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=8rZf9nwuOSWXMWcdd/5tBSuSjqjxKRvVXpL1x5fTwcA=; b=bJAJdHePcelJYQ6QNt1i
 JQxkbyk1cTTvWdGJT8hyuatR2A1K7tYLnL3HVwMCG2fU68+DsfNKaXGAwMzVwm7+4HxvW8OeQgGjT
 M1GfuNMpvsAWXZ4wEjX9gyZVzpDel3jkxrdsPjMZ6RivwVVIECymJKYfiMSbwzyYCKF7f+fiq1FeE
 GirW2wNUzXyCmONmfvhOhKVpAGOYvVzRvQDJSFG7O5bqn7KTQTil+agK3KHSQQbJMa+uwpYcmrX/z
 NnTlxCrBoulabUuWPNc06m6lnIIm1Tyjhfbl+h0ru1mHugL++eBC2nuxqFgGRHzzj6t5ln9bbD/6C
 8Mo02Uw22We2tQ==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1puWtd-0002vh-CW; Thu, 04 May 2023 07:13:13 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 <87fs8e5rrp.fsf@HIDDEN>
Date: Thu, 04 May 2023 13:13:11 +0200
In-Reply-To: <87fs8e5rrp.fsf@HIDDEN> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 02 May 2023 23:48:26 +0200")
Message-ID: <87mt2ks62g.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> First, the person who wrote =E2=80=98connect*=E2=80=99 *cough* hadn=E2=80=
=99t carefully read the
> Guile manual, which reads (info "(guile) Ports and File Descriptors"):
>
>   Note that =E2=80=98select=E2=80=99 may return early for other reasons, =
for example due
>   to pending interrupts.
>
> Clearly, =E2=80=98select=E2=80=99 is returning early, so we should check =
that and loop.

Pushed a fix for that in fc6c96c88a0e4ad0b9e48272e5f97ffaa6eec36e.

Ludo=E2=80=99.




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Crash during `guix import pypi -r'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Fri, 05 May 2023 08:55:03 +0000
Resent-Message-ID: <handler.63024.B63024.168327686525814 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Greg Hogan <code@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, 57391 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168327686525814
          (code B ref 63024); Fri, 05 May 2023 08:55:03 +0000
Received: (at 63024) by debbugs.gnu.org; 5 May 2023 08:54:25 +0000
Received: from localhost ([127.0.0.1]:53129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1purCq-0006iC-Vl
	for submit <at> debbugs.gnu.org; Fri, 05 May 2023 04:54:25 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37304)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1purCo-0006hh-8g; Fri, 05 May 2023 04:54:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1purCi-00032t-E5; Fri, 05 May 2023 04:54:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=Gz9p9CWX6zDZD3BYl637sgmTcZzSgZ+RzQ41al2lj70=; b=HZIPyyTNZSSyNqIXJVwK
 H/sU0j8MknXFY1MmrbfR3sMSzS8YWp8oBKYkx4oqaw1T6e5eYcovUQ0Ik3Y7KByhfJUh6FPqp7fT+
 Uc0+GS3etPuBflteMZ0vOFJAfYJs0yernpU7vz58ptdQoh7Euamxy11o4fOPAGHPLs7x1aGIIDwgD
 MgPo230xWSZ0lTfGoCpJKizL1U5KRXbjsOJO7qVJ7fmc0m3Xq1jQoiDNJL7laErcBxZlyvjctjOg+
 50vfkFnBtTKtH40UUITik8O3/1VM3buEVCUO1mn90wLXPyDIkM0sAPALqs0UIsxgghlRCTXziGCvt
 wXXNORXAOuYCdQ==;
Received: from [193.50.110.84] (helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1purCi-0005RN-0u; Fri, 05 May 2023 04:54:16 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <CA+3U0ZmV+B3mqut5QVU55Bv_Y8q-dBf8fFekNZAYKra+vFT5GA@HIDDEN>
 <87fs8e5rrp.fsf@HIDDEN> <87mt2ks62g.fsf_-_@HIDDEN>
Date: Fri, 05 May 2023 10:54:13 +0200
In-Reply-To: <87mt2ks62g.fsf_-_@HIDDEN> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 04 May 2023 13:13:11 +0200")
Message-ID: <87h6srnop6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:
>
>> First, the person who wrote =E2=80=98connect*=E2=80=99 *cough* hadn=E2=
=80=99t carefully read the
>> Guile manual, which reads (info "(guile) Ports and File Descriptors"):
>>
>>   Note that =E2=80=98select=E2=80=99 may return early for other reasons,=
 for example due
>>   to pending interrupts.
>>
>> Clearly, =E2=80=98select=E2=80=99 is returning early, so we should check=
 that and loop.
>
> Pushed a fix for that in fc6c96c88a0e4ad0b9e48272e5f97ffaa6eec36e.

=E2=80=A6 and updated the =E2=80=98guix=E2=80=99 package in
3c91f4ca490a7ac56dc0aebbca9c4bf4df201877, which should address
=E2=80=98connect*=E2=80=99 timeout issues that were coming from =E2=80=98gu=
ix substitute=E2=80=99.

Ludo=E2=80=99.




Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: [PATCH 2/3] Use /dev/null in piped-process if port is not backed by a fdes
Resent-From: Josselin Poiret <dev@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Fri, 05 May 2023 13:40:03 +0000
Resent-Message-ID: <handler.63024.B63024.168329397022304 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168329397022304
          (code B ref 63024); Fri, 05 May 2023 13:40:03 +0000
Received: (at 63024) by debbugs.gnu.org; 5 May 2023 13:39:30 +0000
Received: from localhost ([127.0.0.1]:53440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puvek-0005nX-An
	for submit <at> debbugs.gnu.org; Fri, 05 May 2023 09:39:30 -0400
Received: from jpoiret.xyz ([206.189.101.64]:53666)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dev@HIDDEN>)
 id 1puveh-0005n5-QJ; Fri, 05 May 2023 09:39:28 -0400
Received: from authenticated-user (jpoiret.xyz [206.189.101.64])
 by jpoiret.xyz (Postfix) with ESMTPA id 58568185317;
 Fri,  5 May 2023 13:39:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim;
 t=1683293967;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=KkAM1YWQOOqvOGUFC0lPa0IxcuKTRj08RPUOkWCxRCY=;
 b=eateAvRXfy+6YEgFEYX7c4yLBBrmc/EDTfsYFpmPlxm1lw1Sg7rW55iY7o8pbyXVaB0MJk
 4OMx2kAdg79KbzY4WjVGIX0r/C8Jg01GIAo24w99K7aK8/nw+pAF72WGpjMBCt9lnkPG8d
 dg/lIKruBMXQxtf7gnyawrT98F6sWFEEgVrh7Ung5xEXggRjm3+ZO8FSUMAOISst51kxPa
 MYv1OMTuvmgndiooRD0s7P9NA0isNcc4tqxnJ7S8V58DkIHGb8aefrgHQId1NQLk9UByuc
 2kow8gAr8pkko+bFC3ZEWGkFe7dRGGVMpg92MH+FgN8KHOA7F67SANkPa8Ya9A==
From: Josselin Poiret <dev@HIDDEN>
Date: Fri,  5 May 2023 15:39:23 +0200
Message-Id: <269750b29a104e35a6bbd92e267130cfcf35c33e.1683293896.git.dev@HIDDEN>
In-Reply-To: <87mt2l4whd.fsf@HIDDEN>
References: <87mt2l4whd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: ++++++
Authentication-Results: jpoiret.xyz;
 auth=pass smtp.auth=jpoiret@HIDDEN smtp.mailfrom=dev@HIDDEN
X-Spam-Level: ******
X-Spam: Yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Josselin Poiret <dev@HIDDEN>

* libguile/posix.c (piped_process): Open /dev/null to use as in/out/err
if the corresponding port is not backed by a file descriptor.
---
 libguile/posix.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/libguile/posix.c b/libguile/posix.c
index 2969f1f24..f41a99efe 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1558,10 +1558,22 @@ piped_process (pid_t *pid, SCM prog, SCM args, SCM from, SCM to)
 
     if (SCM_OPOUTFPORTP ((port = scm_current_error_port ())))
       err = SCM_FPORT_FDES (port);
-    if (out == -1 && SCM_OPOUTFPORTP ((port = scm_current_output_port ())))
-      out = SCM_FPORT_FDES (port);
-    if (in == -1 && SCM_OPINFPORTP ((port = scm_current_input_port ())))
-      in = SCM_FPORT_FDES (port);
+    else
+      err = open ("/dev/null", O_WRONLY | O_CLOEXEC);
+    if (out == -1)
+      {
+        if (SCM_OPOUTFPORTP ((port = scm_current_output_port ())))
+          out = SCM_FPORT_FDES (port);
+        else
+          out = open ("/dev/null", O_WRONLY | O_CLOEXEC);
+      }
+    if (in == -1)
+      {
+        if (SCM_OPINFPORTP ((port = scm_current_input_port ())))
+          in = SCM_FPORT_FDES (port);
+        else
+          in = open ("/dev/null", O_RDONLY | O_CLOEXEC);
+      }
   }
 
   *pid = do_spawn (exec_file, exec_argv, exec_env, in, out, err, 1);
-- 
2.39.2





Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: [PATCH 3/3] tests: Test that system* works if stdin/out/err isn't backed by fdes
Resent-From: Josselin Poiret <dev@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Fri, 05 May 2023 13:40:03 +0000
Resent-Message-ID: <handler.63024.B63024.168329397422338 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168329397422338
          (code B ref 63024); Fri, 05 May 2023 13:40:03 +0000
Received: (at 63024) by debbugs.gnu.org; 5 May 2023 13:39:34 +0000
Received: from localhost ([127.0.0.1]:53444 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puveo-0005o8-8l
	for submit <at> debbugs.gnu.org; Fri, 05 May 2023 09:39:34 -0400
Received: from jpoiret.xyz ([206.189.101.64]:53820)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dev@HIDDEN>)
 id 1puvej-0005nI-Fa; Fri, 05 May 2023 09:39:29 -0400
Received: from authenticated-user (jpoiret.xyz [206.189.101.64])
 by jpoiret.xyz (Postfix) with ESMTPA id BD1B018531A;
 Fri,  5 May 2023 13:39:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim;
 t=1683293968;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=zcCymRxAZIMJp6WjBBI7ypmG8495TsJ6cpuRd3n5p14=;
 b=ewTAs0vhw4kCgQDQnOj9ndYs3vzjIpqMusxlYox5J0T+AJHvFSKh6Zv2OV1L0sebfaRPzt
 fr+/CEzk0UTgjqVziFC4BXx3qXV8A8GhXds5O6wKpMm2BAF9edftyS+/jB8x9TlzUiDDQ2
 IUXabyW2E4I9r38srhJe1uqh4ksDbDCPIJ0Hgi+La406zbFxWz3Oi45dxiWQXbvdVjud+J
 0QTlU/weCUqQZVhxAIhSLPA1KpVQsyINJy3snX9IXBX7TYLdlow/2wT9eIwFQD7IMD4DFi
 VwcDTN5bKHjiPfuQvpkSiS6rLp9flrcNH4Nb9mVog3F3nrINwIHwkg0CtCq/pA==
From: Josselin Poiret <dev@HIDDEN>
Date: Fri,  5 May 2023 15:39:24 +0200
Message-Id: <19baf4a40b5ce28624a7bcb3f9381fce0f318cf3.1683293896.git.dev@HIDDEN>
In-Reply-To: <87mt2l4whd.fsf@HIDDEN>
References: <87mt2l4whd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: ++
Authentication-Results: jpoiret.xyz;
 auth=pass smtp.auth=jpoiret@HIDDEN smtp.mailfrom=dev@HIDDEN
X-Spam-Level: **
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Ludovic Courtès <ludo@HIDDEN>

* test-suite/tests/posix.test: New test for https://bugs.gnu.org/63024.
---
 test-suite/tests/posix.test | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index d5cf47cda..18dad8902 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -374,7 +374,17 @@
                     (system* "sh" "-c" "echo bong >&2"))))))))
 
       (and (zero? (status:exit-val status))
-           (call-with-input-file file get-string-all)))))
+           (call-with-input-file file get-string-all))))
+
+  (pass-if-equal "https://bugs.gnu.org/63024"
+      0
+    (if (file-exists? "/proc/self/fd/0")          ;on GNU/Linux?
+        (parameterize ((current-output-port (%make-void-port "w0")))
+          (system* "guile" "-c"
+                   (object->string
+                    '(exit (string=? "/dev/null"
+                                     (readlink "/proc/self/fd/1"))))))
+        (throw 'unresolved))))
 
 ;;
 ;; spawn
-- 
2.39.2





Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: [PATCH 1/3] Add error handling for spawn's posix_spawn_file_actions_adddup2
Resent-From: Josselin Poiret <dev@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Fri, 05 May 2023 13:40:04 +0000
Resent-Message-ID: <handler.63024.B63024.168329397522352 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168329397522352
          (code B ref 63024); Fri, 05 May 2023 13:40:04 +0000
Received: (at 63024) by debbugs.gnu.org; 5 May 2023 13:39:35 +0000
Received: from localhost ([127.0.0.1]:53448 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1puveo-0005oM-UA
	for submit <at> debbugs.gnu.org; Fri, 05 May 2023 09:39:35 -0400
Received: from jpoiret.xyz ([206.189.101.64]:53524)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dev@HIDDEN>)
 id 1puveg-0005n0-OD; Fri, 05 May 2023 09:39:31 -0400
Received: from authenticated-user (jpoiret.xyz [206.189.101.64])
 by jpoiret.xyz (Postfix) with ESMTPA id BC7721851DD;
 Fri,  5 May 2023 13:39:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim;
 t=1683293965;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=m7U8nFMR82QpcxjD/8xowHP0U5YYMieJYXnhRA4KGu0=;
 b=GzOorNFotxJPi3dRKkZFlHZe3/B8vZojK0YLD6NoGs7BLU5t5LJEQGQj8MzqkkQglUuM73
 JryD9YMWiR1zwKMkgvmAqT6PnmG0KNj372OMxher2mdmqnNpVqDfpBsXU6vcp2oJnKZsyV
 UU1bjJ1uI4iNrZ9QMhrzd2+X8BaVQFqNKqfHwJt2cqcOnoDFz+JZ1b79jSTcndcUDNPzML
 bQs5tibOJKgABiRODAyasrhG6izv3xni8MKbqa3UFiKpgFPeVf+jBFY67yh6bZ0Bz5omZ5
 ZM20WWWmhaAsthy9nSpCE7oSGJXSRbav5i/pnbhB1d+CIALC2hj5QR8wWUdABQ==
From: Josselin Poiret <dev@HIDDEN>
Date: Fri,  5 May 2023 15:39:22 +0200
Message-Id: <f7db538ea324545f2e297b6a6cdcd937f889ef63.1683293896.git.dev@HIDDEN>
In-Reply-To: <87mt2l4whd.fsf@HIDDEN>
References: <87mt2l4whd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: ++++++
Authentication-Results: jpoiret.xyz;
 auth=pass smtp.auth=jpoiret@HIDDEN smtp.mailfrom=dev@HIDDEN
X-Spam-Level: ******
X-Spam: Yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Josselin Poiret <dev@HIDDEN>

* libguile/posix.c (do_spawn): Add error handling if
posix_spawn_file_actions_adddup2 fails.
---
Hi Ludo,

Sorry for not noticing this thread sooner!  Here's my take on it, a minor
variation but that's what I'd prefer tbh.

LMKWYT,
Josselin

 libguile/posix.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libguile/posix.c b/libguile/posix.c
index 3adc743c4..2969f1f24 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1390,12 +1390,15 @@ do_spawn (char *exec_file, char **exec_argv, char **exec_env,
   /* Move the fds out of the way, so that duplicate fds or fds equal
      to 0, 1, 2 don't trample each other */
 
-  posix_spawn_file_actions_adddup2 (&actions, in, fd_slot[0]);
-  posix_spawn_file_actions_adddup2 (&actions, out, fd_slot[1]);
-  posix_spawn_file_actions_adddup2 (&actions, err, fd_slot[2]);
-  posix_spawn_file_actions_adddup2 (&actions, fd_slot[0], 0);
-  posix_spawn_file_actions_adddup2 (&actions, fd_slot[1], 1);
-  posix_spawn_file_actions_adddup2 (&actions, fd_slot[2], 2);
+  int dup2_action_from[] = {in, out, err,
+                            fd_slot[0], fd_slot[1], fd_slot[2]};
+  int dup2_action_to  [] = {fd_slot[0], fd_slot[1], fd_slot[2],
+                            0, 1, 2};
+
+  errno = 0;
+  for (int i = 0;i < sizeof (dup2_action_from) / sizeof (int);i++)
+    if ((errno = posix_spawn_file_actions_adddup2 (&actions, dup2_action_from[i], dup2_action_to[i])))
+        return -1;
 
 #ifdef HAVE_ADDCLOSEFROM
   /* This function appears in glibc 2.34.  It's both free from race

base-commit: fe6cc6d04ab094ea802907bdc4f728416c0e97ba
-- 
2.39.2





Message sent to bug-guix@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#63024: Guile's "sleep pipe" can leak into processes created by 'spawn'
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guix@HIDDEN
Resent-Date: Mon, 08 May 2023 14:09:03 +0000
Resent-Message-ID: <handler.63024.B63024.168355493726000 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 63024
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Josselin Poiret <dev@HIDDEN>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org, Greg Hogan <code@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>
Received: via spool by 63024-submit <at> debbugs.gnu.org id=B63024.168355493726000
          (code B ref 63024); Mon, 08 May 2023 14:09:03 +0000
Received: (at 63024) by debbugs.gnu.org; 8 May 2023 14:08:57 +0000
Received: from localhost ([127.0.0.1]:41256 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pw1Xt-0006lE-Fj
	for submit <at> debbugs.gnu.org; Mon, 08 May 2023 10:08:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38050)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>)
 id 1pw1Xr-0006kj-6w; Mon, 08 May 2023 10:08:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1pw1Xl-0008V0-9T; Mon, 08 May 2023 10:08:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=esKE/S8VGW0auwtHlYAcJHEZY6gEZqnG962tefhjwbs=; b=CBBGqaqZ3hXuRhlTfaCC
 ODrikCFyWgsDQL6qqDyahAViGru/uqdWmeYtKI+s1ZRsnqIpxYin1fJMs2XWyR6L5VdlUFPd6WSWY
 tqKhGhreFGjp5DNawtwJ14uzjPvPAJDuYIlAk08Bf72Uxsansx7TMPWhAxiRE2TtvHdy9Fu5Qfqx0
 QPOMVq/TpkSfPZX6SeEWscM7t04PCdo1DBBLLmK2SXlwQg7t6y9gcOZpqVP5UAsLpZfc+VWUYSESd
 AXoM2phuNYK1JGvW+UCdRRbkiFjCxngMiRj+9A7zbdH17tFYwd4aN9exnH6Fm1Yp+Bp2sWKDirz7P
 bXZ5M221GJrE2A==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1pw1Xj-0000Jh-Je; Mon, 08 May 2023 10:08:48 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <87mt2l4whd.fsf@HIDDEN>
 <f7db538ea324545f2e297b6a6cdcd937f889ef63.1683293896.git.dev@HIDDEN>
Date: Mon, 08 May 2023 16:08:44 +0200
In-Reply-To: <f7db538ea324545f2e297b6a6cdcd937f889ef63.1683293896.git.dev@HIDDEN>
 (Josselin Poiret's message of "Fri, 5 May 2023 15:39:22 +0200")
Message-ID: <87mt2edifn.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Josselin,

Josselin Poiret <dev@HIDDEN> skribis:

> Sorry for not noticing this thread sooner!  Here's my take on it, a minor
> variation but that's what I'd prefer tbh.

Even nicer!  Pushed to =E2=80=98main=E2=80=99 as two patches (I folded the =
test along
with the fix, for clarity) and with cosmetic changes to match GNU coding
style for C.

  36fd2b492 main origin/main Use /dev/null in 'piped-process' if port is no=
t backed by a fdes.
  ccd7400fd Add error handling for spawn's posix_spawn_file_actions_adddup2.

Thanks!

Ludo=E2=80=99.





Last modified: Mon, 8 May 2023 14:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.