From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IXVXJsGAt1+VcgAA0tVLHw (envelope-from ) for ; Fri, 20 Nov 2020 08:39:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qLWjIcGAt1+ZYwAAbx9fmQ (envelope-from ) for ; Fri, 20 Nov 2020 08:39:29 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 094209402DD for ; Fri, 20 Nov 2020 08:39:28 +0000 (UTC) Received: from localhost ([::1]:43058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg1x0-0007SR-UY for larch@yhetil.org; Fri, 20 Nov 2020 03:39:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg1wc-0007SA-09 for bug-guix@gnu.org; Fri, 20 Nov 2020 03:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kg1wb-0004KX-Od for bug-guix@gnu.org; Fri, 20 Nov 2020 03:39:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kg1wb-0002Q7-Lf for bug-guix@gnu.org; Fri, 20 Nov 2020 03:39:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#43565: cuirass: Fibers scheduling blocked. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 20 Nov 2020 08:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43565 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Mathieu Othacehe Received: via spool by 43565-submit@debbugs.gnu.org id=B43565.16058614889236 (code B ref 43565); Fri, 20 Nov 2020 08:39:01 +0000 Received: (at 43565) by debbugs.gnu.org; 20 Nov 2020 08:38:08 +0000 Received: from localhost ([127.0.0.1]:41884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg1vk-0002Ou-5f for submit@debbugs.gnu.org; Fri, 20 Nov 2020 03:38:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kg1vh-0002OP-Vz for 43565@debbugs.gnu.org; Fri, 20 Nov 2020 03:38:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43559) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg1va-0003x6-9q for 43565@debbugs.gnu.org; Fri, 20 Nov 2020 03:37:59 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38528 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kg1vY-0004qs-Es; Fri, 20 Nov 2020 03:37:56 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87eemtzr1q.fsf@gnu.org> <87r1qc27mo.fsf@gnu.org> <874kmmzd92.fsf@gnu.org> <871rhpqgjy.fsf@gnu.org> <87v9excbj8.fsf@gnu.org> <87tuuh9cxe.fsf@gnu.org> <87k0v4ax42.fsf@gnu.org> <87ima1pqc7.fsf@gnu.org> Date: Fri, 20 Nov 2020 09:37:54 +0100 In-Reply-To: <87ima1pqc7.fsf@gnu.org> (Mathieu Othacehe's message of "Thu, 19 Nov 2020 11:56:40 +0100") Message-ID: <87wnygfmot.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43565@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: 8pVj4H2WXUTr --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Mathieu Othacehe skribis: >> In cuirass/utils.scm: >> 320:22 1 (_) >> In unknown file: >> 0 (make-stack #t) >> ERROR: In procedure make-stack: >> In procedure struct-vtable: Wrong type argument in position 1 (expecting= struct): #f > > I think this error is caused by setting: > > ;; STORE's socket is O_NONBLOCK but since we're > ;; not in a fiber, disable Fiber's handlers. > (current-read-waiter #f) > (current-write-waiter #f) > > > where it should be: > > ;; STORE's socket is O_NONBLOCK but since we're > ;; not in a fiber, disable Fiber's handlers. > (current-read-waiter > (lambda (port) > (port-poll port "r"))) > (current-write-waiter > (lambda (port) > (port-poll port "w"))) Ooh, good catch. > then this should also be done in "fetch-inputs" that is using non > blocking ports outside of Fibers. > > However, I still have the following error: > > In ice-9/boot-9.scm: > 1731:15 17 (with-exception-handler # =E2=80=A6) > 1736:10 16 (with-exception-handler _ _ #:unwind? _ # _) > In ice-9/eval.scm: > 619:8 15 (_ #(#(#(#(#)) = =E2=80=A6) =E2=80=A6)) > In unknown file: > 14 (_ # =E2= =80=A6) > 13 (partition # =E2=80=A6) > In guix/store.scm: > 1008:0 12 (valid-path? # "/=E2= =80=A6") > 2020-11-19T11:47:23 Failed to compute metric average-eval-build-start-tim= e (1). > 717:11 11 (process-stderr # _) > In guix/serialization.scm: > 76:12 10 (read-int #) > In ice-9/suspendable-ports.scm: > 307:17 9 (get-bytevector-n # 8) > 2020-11-19T11:47:23 Failed to compute metric average-eval-build-complete-= time (1). > 2020-11-19T11:47:23 Failed to compute metric evaluation-completion-speed = (1). > 284:18 8 (get-bytevector-n! # #vu8(0 =E2=80= =A6) =E2=80=A6) > 67:33 7 (read-bytes # #vu8(0 0 0 0 0 =E2=80= =A6) =E2=80=A6) > In fibers/internal.scm: > 402:6 6 (suspend-current-fiber _) > In ice-9/boot-9.scm: > 1669:16 5 (raise-exception _ #:continuable? _) > 1764:13 4 (_ #<&compound-exception components: (#<&error> #<&orig=E2= =80=A6>) > In cuirass/utils.scm: > 319:8 3 (_ _ . _) > In ice-9/boot-9.scm: > 1731:15 2 (with-exception-handler # =E2=80=A6) > In cuirass/utils.scm: > 320:22 1 (_) > In unknown file: > 0 (make-stack #t) > ERROR: In procedure make-stack: > Attempt to suspend fiber within continuation barrier > > that originates from "valid-path?" in "restart-builds", not sure how to > fix it yet. I think that=E2=80=99s because of the =E2=80=98partition=E2=80=99 call: =E2= =80=98partition=E2=80=99 is currently implemented in C and the stack cannot be captured if it contains C calls in the middle. The simplest fix is probably to have a Scheme implementation: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index 5a0c826..99a17fa 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -632,6 +632,21 @@ This procedure is meant to be called at startup." db "UPDATE Builds SET status = 4 WHERE status = -2 AND timestamp < " (- (time-second (current-time time-utc)) age) ";"))) +(define (partition pred lst) + ;; Scheme implementation of SRFI-1 'partition' so stack activations can be + ;; captured via 'abort-to-prompt'. + (let loop ((lst lst) + (pass '()) + (fail '())) + (match lst + (() + (values (reverse pass) (reverse fail))) + ((head . tail) + (let ((pass? (pred head))) + (loop tail + (if pass? (cons head pass) pass) + (if pass? fail (cons head fail)))))))) + (define (restart-builds) "Restart builds whose status in the database is \"pending\" (scheduled or started)." --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It=E2=80=99s a bummer that one has to be aware of all these implementation details when using Fibers. The vision I think is that asymptotically these issues would vanish as more things move from C to Scheme. Thanks, Ludo=E2=80=99. --=-=-=--