From unknown Wed Jun 18 23:08:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55673 <55673@debbugs.gnu.org> To: bug#55673 <55673@debbugs.gnu.org> Subject: Status: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. Reply-To: bug#55673 <55673@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:08:23 +0000 retitle 55673 [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. reassign 55673 guix-patches submitter 55673 zimoun severity 55673 normal tag 55673 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 04:25:42 2022 Received: (at submit) by debbugs.gnu.org; 27 May 2022 08:25:42 +0000 Received: from localhost ([127.0.0.1]:60869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuVHy-0000OG-GM for submit@debbugs.gnu.org; Fri, 27 May 2022 04:25:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:51790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuVHu-0000O7-5G for submit@debbugs.gnu.org; Fri, 27 May 2022 04:25:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuVHt-0004BV-SH for guix-patches@gnu.org; Fri, 27 May 2022 04:25:37 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:40881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuVHs-0001e7-8I for guix-patches@gnu.org; Fri, 27 May 2022 04:25:37 -0400 Received: by mail-wm1-x334.google.com with SMTP id v4-20020a1cac04000000b00397001398c0so4129687wme.5 for ; Fri, 27 May 2022 01:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kwl/jxl6bTPVOGIUYZpAj/MGFQ5rdihSQNLywXdnc94=; b=WarJQPhQpznCan5Z020wEvswhpZBy2CQTZJMpQgDE2yeDcTt34JqlbQcsZS85ZAezj 8BfBuA6Avswb9H/4m6iX1WpX0ixUmp5vM6LL433x1efe4NTeytdQtRTuGn4Ozb9t9LrV 5qimGZ0NexDu/6nQgIpc/UnfHMHQTVftw05CRb+S0vIGarXNKHqJ4pvSVTRBgU6mCGkn PNFWGjDtpVWMsUMv9jRfZwIqHabLVGNEFHajKt1hGFNjDR1yTtjZeH83sZaKJxGEAi+h 3ZLjHOda7teJ7iII5zBXgvTihZYV0hu2rCD4e/rMrBYjYtyZHoV0uARuZE5huLOdC+LQ CwCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kwl/jxl6bTPVOGIUYZpAj/MGFQ5rdihSQNLywXdnc94=; b=qK9eUOs4ijeuHpGy/8WO0S/CDQWjNQPF943PkZVfEjtyU/uE4GTh2PVCYMiepPupjK nbfn3PS/vCquzWKi6KAll0sxFj2MmfmNu7TE53xxxw9Mz9xDkWLjqr0/fzCoKq6Rqte+ qHtjghdpABV9DQQPvlg2AD6IClSHTXK3FFzDd6TZoT0FpgpdnQfzDUzpKyEIbA7EEEBZ VOkFu9RhEtJMvupFhi0lzyt2QyiDJ9/X22c4AdTuTaTdonbVMulaEriVgKsMbtjVe8kN P3WNW00pjp2WYHXNkKqEw5mGAUjS+2a8zmY3UdHFYc8QKzD0ITky1wKfauROjm4yDkEA Mhig== X-Gm-Message-State: AOAM532OhMO/QcOdpqRcW68j8M0dbdqGkRzZc49yW4qhYCec1GxGjYcb Qu/jN+f1i+4ONVpSC88vmzsIURyA23U= X-Google-Smtp-Source: ABdhPJwpXW8AKFFFIbPXl6ciz9r+B6XCeUhtPeDZ01vJAPwB2joM0xNhA2AmahUfYLunWOlYKurpQw== X-Received: by 2002:a05:600c:3384:b0:397:6443:5343 with SMTP id o4-20020a05600c338400b0039764435343mr5662483wmp.124.1653639932722; Fri, 27 May 2022 01:25:32 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e12-20020a05600c4e4c00b003974d0d981dsm1424287wmq.35.2022.05.27.01.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 01:25:32 -0700 (PDT) From: zimoun To: guix-patches@gnu.org Subject: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. Date: Fri, 27 May 2022 10:25:19 +0200 Message-Id: <20220527082519.501697-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-Debbugs-CC: ludo@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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-Debbugs-Envelope-To: submit Cc: zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Fixes . * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Check if the date is a valid integer. --- guix/cache.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/cache.scm b/guix/cache.scm index 51009809bd..4a74c42afe 100644 --- a/guix/cache.scm +++ b/guix/cache.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès +;;; Copyright © 2022 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,7 +94,9 @@ (define expiry-file (define last-expiry-date (catch 'system-error (lambda () - (call-with-input-file expiry-file read)) + (match (call-with-input-file expiry-file read) + ((? integer? date) date) + (_ 0))) (const 0))) (when (obsolete? last-expiry-date now cleanup-period) base-commit: 38bf6c7d0cb588e8d4546db7d2e0bae2ec25183d -- 2.36.0 From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 05:54:20 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 09:54:20 +0000 Received: from localhost ([127.0.0.1]:60995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuWfj-0004uh-VU for submit@debbugs.gnu.org; Fri, 27 May 2022 05:54:20 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuWfh-0004uW-65 for 55673@debbugs.gnu.org; Fri, 27 May 2022 05:54:18 -0400 Received: from [172.20.10.5] ([188.188.253.34]) by baptiste.telenet-ops.be with bizsmtp id bluE2700Q0lHqdo01luFL4; Fri, 27 May 2022 11:54:15 +0200 Message-ID: <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun , 55673@debbugs.gnu.org Date: Fri, 27 May 2022 11:54:08 +0200 In-Reply-To: <20220527082519.501697-1-zimon.toutoune@gmail.com> References: <20220527082519.501697-1-zimon.toutoune@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-EtWzOHp64KEoovqfWoSG" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653645255; bh=D6rrqu53pDkHmLklfZaBvvgDUJBE63hoB8NHWjuXNCI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=b/5I+41Zs1BT3kcd83aPqKtc8oH2HuXgXqA89UPDK5ZwfxT3SQn1KIEIdKVhrmgSa /k7LFViqWv0RGhF+NEnmkostiRCn61I3nv1/47b9HxRt2stdQRojWUEeDXn1UdRlyV TduQoZEVTCo67tAhXu89jBCVdD8n9QA1lWb50OA9Bumouqhgn0XwedgOO8nPbQNzjf ht1IPf3Be52sPplzuKMS4skKbaeJ5WB6yYYmM3H12K6wlSPm+yAKqYUF0PjGVp0F7O zNLJvWmCz/BtX+0/FvUnB/I7uDJduj5rFqQ7dALFxTtKVTpvguB0IbcvmuLGY1J5YD XUY0iAuzL4hDA== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-EtWzOHp64KEoovqfWoSG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 10:25 [+0200]: > =C2=A0=C2=A0=C2=A0=C2=A0 (catch 'system-error > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda () > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (call-with-input-file expiry-= file read)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (match (call-with-input-file = expiry-file read) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? integer? date= ) date) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ 0))) It might be possible to end up wit hsomething more bogus on some file system, it's possible to end up with something even more boguse (e.g., "unterminated-string), which 'read' doesn't understand. I suggest using 'get-string-all' + 'number->string'. For completeness, a comment like ;; Handle the 'write' below being interrupted before the write ;; could complete (e.g. with C-c) and handle file system crashes ;; causing empty files or corrupted contents. and a regression test in tets/cache.scm would be nice. Also, I'd switch the catch and the (match ...) because 'read' and integer? shouldn't raise any 'system-error'. Greetings, Maxime. --=-EtWzOHp64KEoovqfWoSG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpCfwBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jJVAQCaikLYy+Q0fz7265EtiZpF0YnO jfA8iEbv9sQ37hbOiAD+ME5hYi9Wi481pHOf9HcNcP3/5qC9ozWIkkliKc/tgAI= =4B9U -----END PGP SIGNATURE----- --=-EtWzOHp64KEoovqfWoSG-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 06:28:53 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 10:28:54 +0000 Received: from localhost ([127.0.0.1]:32813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXDB-0005wD-LP for submit@debbugs.gnu.org; Fri, 27 May 2022 06:28:53 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:36815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXD8-0005vm-D9 for 55673@debbugs.gnu.org; Fri, 27 May 2022 06:28:50 -0400 Received: by mail-pf1-f175.google.com with SMTP id f21so3991360pfa.3 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 03:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xb9TrqF2yXM/kxS+Br2W66bOVe4fqdzjhpuXXN4isdY=; b=TMQ3Y3XYVo+F+BIUPnQBhQKxo3SHKQPvw24TooGc0WHiu7rcMI74F7A9xqfXE7PF+L AsYUDmFcm9ATRSC0p8FYqXgJuz9BAlD2oMVo8pAmr6PY/FlabPbT8rOQyV8ErhfDwmXy 7cgWG35AAK2+pgLqBMfhMHllakAmyQ35MigX48KY0+aAk6Gc8lxARYjOMp4SSvQN9kFD EkePgFkI5tnQx6HbKfmzfGrzPl2Z85raal6ZhiQvGAAH6rNjGIUvhVtQt4qN5LrMVeTs hpgXrBUy9yoSHUoqyxQ8T5PlPCMIBI+ocSgMgeeKH0+zorwSdnDnD5/nC22MbN+9aWZv lQ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xb9TrqF2yXM/kxS+Br2W66bOVe4fqdzjhpuXXN4isdY=; b=nDvah1E+YzpVmKRw8PtNVO5gijpcxZmjp3mrgU4XtSpR2dt/q/GlqJY0PXjh13HuE2 Z0+ndigUWbcrPBXDAGTvs88r+EkcrQ9gX/FN2WEix0EgLuCxJlp0jMrYsKkpFtZ6Fub1 P7ZzEP5NVLGFt/Ldy0c43sTrBqYxmj3UqTKW7hk/apb5RHlRW24UyZKMeQSbxPJO/g9W DA3vBQuse5UWtl+wE9C7qsAjkOQq0UUjnIx8MTCu/sHnd9nBJbDUFXQHBHrBHQcJhOM9 HiDHP3i+Ao+71KQDpoz+8l+AOpVstBeJr7IbCPfTOOaLTcY2gXxRBKgO4HVV3Rrst9LA BFxQ== X-Gm-Message-State: AOAM530QptADF/Zw8VaI1yAHLb3aGhTKwDsDFPx0XB/NGmeBN+fXL1+X XL7ye0D9QglGFCci74JM5M3GbPcqdZ0PqhZRCi4= X-Google-Smtp-Source: ABdhPJyProSZ0SXtt5NhBB5zwyrbXCwTXVVRxV/oU10lz65mCVDRoe8tkcntF2SLVkXB+j4ihnPwVod1P9J+ESS7u70= X-Received: by 2002:aa7:9e1e:0:b0:518:3ee0:57a7 with SMTP id y30-20020aa79e1e000000b005183ee057a7mr41997995pfq.42.1653647324501; Fri, 27 May 2022 03:28:44 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> In-Reply-To: <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> From: zimoun Date: Fri, 27 May 2022 12:28:33 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Fri, 27 May 2022 at 11:54, Maxime Devos wrote: > zimoun schreef op vr 27-05-2022 om 10:25 [+0200]: > > (catch 'system-error > > (lambda () > > - (call-with-input-file expiry-file read)) > > + (match (call-with-input-file expiry-file read) > > + ((? integer? date) date) > > + (_ 0))) > > It might be possible to end up wit hsomething more bogus on some file > system, it's possible to end up with something even more boguse (e.g., > "unterminated-string), which 'read' doesn't understand. I suggest > using 'get-string-all' + 'number->string'. I do not see how. The integer is written by Guile using 'write'. >From my understanding, 'read' understands 'write', and vice-versa. > Also, I'd switch the catch and the (match ...) because 'read' and > integer? shouldn't raise any 'system-error'. All the cases are covered, IMHO. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:12:53 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:12:53 +0000 Received: from localhost ([127.0.0.1]:32907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXtl-0000sT-7K for submit@debbugs.gnu.org; Fri, 27 May 2022 07:12:53 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:57734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXtj-0000sJ-Ag for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:12:52 -0400 Received: from [172.20.10.5] ([188.188.253.34]) by baptiste.telenet-ops.be with bizsmtp id bnCo2700N0lHqdo01nCoE9; Fri, 27 May 2022 13:12:49 +0200 Message-ID: <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 13:12:48 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-0wDSiBAWS2r3RBlQeURS" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653649969; bh=00z/H1zefrsDqTex5tQxKSi8x+tN4NRMcR+ntrbClps=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=JEhXYDNMIYFTYmRmzAZ5d92wIRzCjj059aoGamNTnFdXUJ1kspNiLmmDYNtHIy+L6 Mb8VQD/pyvyIyR831z+09WLi/Ce7zf6xre8jaSZFQVOgmtPw6WOiK2a/WK124de5Bd sqD50Sh1C2otx4jkRYPfBWpubdXoRnJYdG0j18xLXMDrKmBogdhIX42GS6YQAt6icD MRZNKxp/PozU5z1WORomXpYxPIPcsFXy8KzXNwUjooHruuWpno+/qE64B5RXN1YSy5 AFznuMYhGJnQw1MUJ0rzVCo7ECAB0D5PA05osMRmMpDwqgMGq5eFRJwVLbiBicOGxB y0JtMc+06j0XA== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-0wDSiBAWS2r3RBlQeURS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 12:28 [+0200]: > > It might be possible to end up wit hsomething more bogus on some > > file > > system, it's possible to end up with something even more boguse > > (e.g., > > "unterminated-string), which 'read' doesn't understand.=C2=A0 I suggest > > using 'get-string-all' + 'number->string'. >=20 > I do not see how.=C2=A0 The integer is written by Guile using 'write'. > From my understanding, 'read' understands 'write', and vice-versa. But what if the computer crashes while the file is being made, and due to file system details, when rebooted, you end up with a non-integer? E.g. "unterminated-string. Greetings, Maxime. --=-0wDSiBAWS2r3RBlQeURS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpCyMBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gT8AQD2twn1+E72CzCF9kLMvtQWTUFo yITl2m/GN9JUzvttrwD/UDUQcO+I2D/DRY4wySSsxMlAo3n7uXDN6xNo6nO1gwU= =iTSw -----END PGP SIGNATURE----- --=-0wDSiBAWS2r3RBlQeURS-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:17:22 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:17:22 +0000 Received: from localhost ([127.0.0.1]:32912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXy5-0002wg-Oi for submit@debbugs.gnu.org; Fri, 27 May 2022 07:17:22 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:35376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXy2-0002tB-2s for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:17:20 -0400 Received: from [172.20.10.5] ([188.188.253.34]) by baptiste.telenet-ops.be with bizsmtp id bnHG2700G0lHqdo01nHGCA; Fri, 27 May 2022 13:17:17 +0200 Message-ID: <22ddd5b3d9906b84b0f1ca79dc78964e59345a6d.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 13:17:16 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-iAXrXFrz0d4vEFvUfopi" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653650237; bh=/M4Inbifp/sFFCzaXkKJrV9o6S/NVvrpxP0p8KrOQxs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=dU99Z2L5prgGHeAKt4YLyRA80GqJn5jJQiGAjlgf8W/l8WywLNPTjqbYKv5SIqxGI qs/L7fpJQfQ9u/Gfquji6IoF/iwhxBqZPzafTkcexNlvi425qwNT3B48NV1AMrsDM6 Vt5qLvJdjtG6u7G1GRHYnh8N6m1xtQvB0NNNdbe2fkq2y2VR2rwiaeF6Tf8N4zKd3a YiPTZQh/U3XWPods2HiLxjgZMJycZBY7OHnX+XVLYpnO40SMTlUuA8fHsIRuTUoOBh zIrCiH1CtR7C08iiepevgZAcK0rj8lIg+ZlVmJuIsvz6QaAfUOkbyibkMFT4o4J0IB 692oMw8+zFsyg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-iAXrXFrz0d4vEFvUfopi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 12:28 [+0200]: > > Also, I'd switch the catch and the (match ...) because 'read' and > > integer? shouldn't raise any 'system-error'. >=20 > All the cases are covered, IMHO. Too many cases are covered. E.g., what if the file was a directory? scheme@(guile-user)> (call-with-input-file "." read) ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure fport_read: Is een map Greetings, Maxime. --=-iAXrXFrz0d4vEFvUfopi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpCzPBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qPoAQD7aCZXfdItRx4XPRgOOLW8IEZ1 jH20EGIIshZKl3pN+QEAsWJZzPSMkah+eh+hf8iMctpBmMXmMl0IUjn6e+hxyQc= =0Ksy -----END PGP SIGNATURE----- --=-iAXrXFrz0d4vEFvUfopi-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:24:24 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:24:24 +0000 Received: from localhost ([127.0.0.1]:32924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuY4u-0003Ko-2m for submit@debbugs.gnu.org; Fri, 27 May 2022 07:24:24 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:46061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuY4o-0003KY-Qg for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:24:22 -0400 Received: by mail-pg1-f173.google.com with SMTP id l184so1090370pge.12 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 04:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VPdDOz7yEOlS7uYmtLMebnjxZq2STyLefRvZZY3A8Ng=; b=DP8f5l4mih/bAx5rUonb7ecz4FwFkVKwTItZi2RERUPmnLwz4ztl9rTI7kjMs05xl5 M1A37JBxp92yHZP2C7BFbt/dd0pQ7umiwX7hX45/FFtn4SSZouBW+puW6aNNwGs4gs5f uEUOashmqBOEnOEBDtvrut6O0yNBdQM9AfkHC5AKUpowPzZQQ8tXZeo/1fBZvtRHjGPk NM3q0+f0Uo84r7MO9Kq9NS3LkrZlRLmm7ljfDpMePx4nUIoAsTr6SM7EVLTLEw1RNZol QlVLTp/cNTC1OlcKhhVM40UJuFGnGGfY3rPCA5uKGkasZc8EqJs0OpWlxo0yHsZ2uH2e yVuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VPdDOz7yEOlS7uYmtLMebnjxZq2STyLefRvZZY3A8Ng=; b=8FtL6xPl2wHffVqbcYedbsSL+KETnFAHDTAJQma264qfi335YzQvPD9JBYSArTm0qC BL9oIUjRoklTdmGlojKQaR0QQGuo5AQzDRtwbnhId35+yEWhakNoC71x4aBe1n0Tfagz Mdz+qP+tYKOaq1wqe6sn5ID0WUK+qmYGjbAf7/QFEtM3xora738D3litRkVzpYO6pohl moPy0569CWzX62coDSYPCD6MqpwzsfifssG3D+JCJzqtMM1UutqpMQMkdrDXns8p+TUB n1bvTZv8BwBpE0JTOLT3USeUn54t428tQbPKXixR9X2rHrO/QDPSpQ+tgLXSsUUNs8yP 39Qg== X-Gm-Message-State: AOAM533F/PhLNOTZIfCOWozmcGEnlBMPaORNPVvtwP2E4HUYvcbf1L1C veioB/5rxBz3vJUtXyloOVDVX4uBEEwPeDoHqRM= X-Google-Smtp-Source: ABdhPJybKwwUMvaINDekWzPNNywUyC5b5rEONA7wuezqinRxOv6vWWIvfjhnDaEmB8qce0oxqhFkjHxwrmgyron1Bmc= X-Received: by 2002:a05:6a00:b90:b0:518:f567:ffb6 with SMTP id g16-20020a056a000b9000b00518f567ffb6mr13739553pfj.80.1653650652982; Fri, 27 May 2022 04:24:12 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <22ddd5b3d9906b84b0f1ca79dc78964e59345a6d.camel@telenet.be> In-Reply-To: <22ddd5b3d9906b84b0f1ca79dc78964e59345a6d.camel@telenet.be> From: zimoun Date: Fri, 27 May 2022 13:24:01 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 27 May 2022 at 13:17, Maxime Devos wrote: > scheme@(guile-user)> (call-with-input-file "." read) > ice-9/boot-9.scm:1669:16: In procedure raise-exception: > In procedure fport_read: Is een map Euh, you are overengineering, no? We are talking about an internal file used by the Guix cache. Yes, if the user tweaks this cache, then bad things can happen. It is true for almost what lives in ~/.cache/guix. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:39:40 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:39:41 +0000 Received: from localhost ([127.0.0.1]:32939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYJg-0005tW-OL for submit@debbugs.gnu.org; Fri, 27 May 2022 07:39:40 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:36742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYJd-0005tH-2V for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:39:39 -0400 Received: by mail-pg1-f179.google.com with SMTP id h186so3729109pgc.3 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 04:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WKL43uHFFu5f60mylrYS59xTUeiBL51IhIssdyTVHvo=; b=O0ycgTrrIqL0nj7mU7Arb3C+7ckA7zWF4KPUNn3hbDmojybx2o/rYwLeREsJeO8KRh KeWsf37aIrc/YFQYQ8nLOiSv4FmXNbKlfQsGfSQvltZYcFMTRGMbxiyDBa/N0BDa/CHD TowfIzM1PIHul7/eOXw3GWwtmDC8lgQjmXY8i1yzvLosIGa2WUuKulfYyIX1/cs63C+9 C/XIkcrF3AMfFVr15ChnVEq/HrMn4e6ByGb7PvjYoAdyr7cWn8uqbEwzcOGu6KJnVYfI /4Kz9oli9fBSkhkHF8KwL4dZeDpAsB3hcpwAw5ImEgYNZpkuulBIQacQ+5wY+oorCI7O TKGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WKL43uHFFu5f60mylrYS59xTUeiBL51IhIssdyTVHvo=; b=XB99c3cvBkiDJmhNx6UOL1dowfrqIQ0/BE8egwPIarYVCG8p9JI27qgxd0nPNTjTec KP9zQ+J90FNUHrqFM7Bsk0NI14YRAF/JSlDg1Sb5F/0rGVJazkDLs9s3Pv4BYzqdP/OO gptwwesAvdPSFqFRrcJpiOBpSccED8hSi7MPeRcBvloF8LqPeqFG4zgu9p+deQtXynD6 vbccFqp03aW7Qilfy8sYSqAs4/a4UwhnCMp/rQ2qSsWeqreZZguSL4JcHDKE/FCYLOoV NVuw6zDLGNkjgewNXsoPbfJgR4QsymPnbd7ksXHB/iGxj5G0xauO8U2siq0GkRRl20KK BeWg== X-Gm-Message-State: AOAM5315xqUh9KDwINgho+9TaOPMxVtH5g13aHatkVCkjnxnr/BZe/8q 4djd5O1pJeXZCPiLPmRHkbjFsilL1Kdr+ltoUeM= X-Google-Smtp-Source: ABdhPJxx0U/ga7e7wixiiSTr5XZFEoImmsjbXrr37NCnDEPA51wIvUSN9V/BSgVV0Cf9R+B4sU9P/XeYcxu1xRDldJw= X-Received: by 2002:a65:5c48:0:b0:382:2c7:28e9 with SMTP id v8-20020a655c48000000b0038202c728e9mr37657107pgr.472.1653651571064; Fri, 27 May 2022 04:39:31 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> In-Reply-To: <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> From: zimoun Date: Fri, 27 May 2022 13:39:19 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 27 May 2022 at 13:12, Maxime Devos wrote: > But what if the computer crashes while the file is being made, and due > to file system details, when rebooted, you end up with a non-integer? > E.g. "unterminated-string. If the value returned by 'read' is a non-integer, then it is set to 0 by the 'match'. --8<---------------cut here---------------start------------->8--- $ echo -n -e \\x00\\x01\\x02\\x03 > ~/.cache/guix/inferiors/last-expiry-cleanup $ cat ~/.cache/guix/inferiors/last-expiry-cleanup \0 [env] $ ./pre-inst-env guix time-machine --commit=9d795fb -- help 1653651128[env] --8<---------------cut here---------------end--------------->8--- The only case is when 'read' fails. Personally, I do not see how it would be possible. If you have a concrete example, then we can examine. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:40:33 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:40:33 +0000 Received: from localhost ([127.0.0.1]:32944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYKX-0005vE-0g for submit@debbugs.gnu.org; Fri, 27 May 2022 07:40:33 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:36466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYKU-0005v4-Pg for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:40:31 -0400 Received: from [172.20.10.5] ([188.188.253.34]) by baptiste.telenet-ops.be with bizsmtp id bngU270040lHqdo01ngUvn; Fri, 27 May 2022 13:40:29 +0200 Message-ID: <0bafbbcf501fc13b9dab096bf03ce7e60afe1c4f.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 13:40:23 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <22ddd5b3d9906b84b0f1ca79dc78964e59345a6d.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-rE8zyxFy+1Jaj53eUyQR" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653651629; bh=KaVCoeNxMRG6cVrieEyU3q0K9f1qzJIYe+7tHpVbkfg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=K3DIfMkMbN2Doxz+CO89wS+JfdgNMXKnF2PCU8f5wL6DjwwrBpVzf2XDebDfRh7iu /q8C++QNjNbisJ7+JxAQx39ITdMMLhYhSkozTLk5lkqeopN4hHxDf7knjQaxRYNk8C +N7hcSv6bRJWjTMI/NsGSZMRSICu5+FwM9Wmcwpr9KQx8reLppwRnoHgsUKDMriOWe X/x0/lvVh697I3z40VGduT6NP65CFv3aH9WS5VjGxBfUrhGao3bj2XSCT9aWu/V11F T78iHw+GT6hGSUMhhjWdLzTi5hW6kxexRrx7xrR0ouH5B/Eas42Epql0n5pZaZPpFM koaDbiQagUJ9Q== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-rE8zyxFy+1Jaj53eUyQR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 13:24 [+0200]: > On Fri, 27 May 2022 at 13:17, Maxime Devos wrote= : >=20 > > scheme@(guile-user)> (call-with-input-file "." read) > > ice-9/boot-9.scm:1669:16: In procedure raise-exception: > > In procedure fport_read: Is een map >=20 > Euh, you are overengineering, no? We are talking about an internal > file used by the Guix cache. Yes, if the user tweaks this cache, then > bad things can happen. It is true for almost what lives in > ~/.cache/guix. Probably yes. Maybe it makes more sense when applied to get-string-all + string->number in a limited form: (or (string->number (catch 'system-error (lambda () (call-with-input-file [...] get-string-all)) (lambda arglist (if (=3D ENOENT (system-error-errno arglist)) "0" ; file does not exist (apply throw arglist))))) 0) Though even then there remain potential problems, try scheme@(guile-user)> (string->number "#e1e1000") ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure string->number: Value out of range: 1000 (seems unlikely to encounter such corruption in practice though). Greetings, MAxime. --=-rE8zyxFy+1Jaj53eUyQR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpC4pxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kjUAQCJLEmo38K+tLP+UCxxOjaUPHmK 7XpeSjxAW7yPCkl1PgEAq0BTdH3PVeTVIKJJul5JX4gUpCkmuHiv17TeSn0iegc= =pLaM -----END PGP SIGNATURE----- --=-rE8zyxFy+1Jaj53eUyQR-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 07:49:19 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 11:49:19 +0000 Received: from localhost ([127.0.0.1]:32973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYT1-0006Bw-9r for submit@debbugs.gnu.org; Fri, 27 May 2022 07:49:19 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:47218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuYSy-0006Bk-E8 for 55673@debbugs.gnu.org; Fri, 27 May 2022 07:49:18 -0400 Received: from [172.20.10.5] ([188.188.253.34]) by baptiste.telenet-ops.be with bizsmtp id bnpE270010lHqdo01npEF7; Fri, 27 May 2022 13:49:14 +0200 Message-ID: <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 13:49:08 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-+33rIk7edC1uwJlpKUCa" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653652154; bh=4P5dbjnaGULbIKPZG7djTVanZAmXv+6S80sSL+F+rk8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iGP17hiO64SueU/1xVZvfxt9OFxZAyszr+R1K0gtH0Yh0WLAT85gX2pGm19LGYIsp GfHU7DERUpB5xDlt576Wm9PCeW7oa2o88FzhqyJnTByoC1l9o4wl4PtkxRiOA4xhoG ZzTzHO8hGt88ePXGDSJMIk6EoAVWtp6z7TZu2YWzxvPCVP6kusr2GtCYWLluASJl/v jzndqvjnSiJsREeI08/w6M/tiJvJn3bM79DGrIqjmEpSiqZhWkGg3BZXf1KpcCnoO1 x2ECOC7jTQLKBg3R6MiFLvLBahXI5F9lhA83yW69wPJFQRFRNTs7ogOn7/KwJSXlz/ nZwFXSxENI8og== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-+33rIk7edC1uwJlpKUCa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 13:39 [+0200]: > The only case is when 'read' fails.=C2=A0 Personally, I do not see how it > would be possible.=C2=A0 If you have a concrete example, then we can > examine. I don't have a 100%-concrete example, but wasn't there some file system crash mode, where the contents of a new file has not yet been written to disk yet the length of the file is > 0, so effectively the file points to an arbitrary range on the disk? E.g., say Guix told the FS write 1234 to last-expiry-cleanup. Then the FS created last-expiry- cleanup, choose a range of 4 bytes to save it as, then crashes before writing the contents. After restarting, the file contains the _old_ 4 bytes. These old 4 bytes could be the ASCII representation of "foo . Then, when 'read' is run (after rebooting), it sees an incomplete string "foo, so it fails. Greetings, Maxime. --=-+33rIk7edC1uwJlpKUCa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpC6tBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qo5AP9PG6k+5mhppXv1EmyFZqN5Ei4c vRUZTQ4+luOGOMR4iwEAqw2kaJX02uPQfwDbDDOkWClCugIn9QGRISSnSEvFKAw= =ejKM -----END PGP SIGNATURE----- --=-+33rIk7edC1uwJlpKUCa-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 08:40:46 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 12:40:46 +0000 Received: from localhost ([127.0.0.1]:33065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZGn-0001EL-QB for submit@debbugs.gnu.org; Fri, 27 May 2022 08:40:45 -0400 Received: from mail-pg1-f169.google.com ([209.85.215.169]:43840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZGm-0001E9-Mu for 55673@debbugs.gnu.org; Fri, 27 May 2022 08:40:45 -0400 Received: by mail-pg1-f169.google.com with SMTP id s68so3823565pgs.10 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 05:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uwNk8mKy2kwCrfpBvpBZOg4ZyhZVP5A4Af0mTnmX734=; b=i6WXXURUkjgcZuAkJokqb33EtDvIbl3cDPjEpzUxlm9jqRncJGnAV2xCiXrK++Hvcx DCTqLuP8NxC4PHElV0SRqbhswzThO7B0+Tj5VRerI5s/s9c88rf/xx7rLXn+ERbmki0i uEo4H9rvNPW+poC9zTWBJ6H0ATa7lm5ETYjulZ1mfftpbuoognmGZ5VwhYUHXCgflj2L ItY/EEMPW/DZhgvb47AkJr+6e6cNculSUk5TbqkJrfmvc+vUj8/0ElGIbn0sV3Aw3iqs 39PR1NkYKS24vBpsMr27AlADjb9FNbi2GhXFZ8kWrl1xna50J1AweHZkKe/J6MrmVHSi qq0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uwNk8mKy2kwCrfpBvpBZOg4ZyhZVP5A4Af0mTnmX734=; b=ajKxtTVd/xowRs2kLDn1NgRLTihVQ0f1/MeBKlSE3YOcBQJwgoZ7o0Jpg5SiDQWxq9 jh/wGdRLGlFzu0FhRylrzIm4DcHz66DzVIodthdZZNNbWbN7qgHdhLl3vEFfmurlIODZ fidmBaeej6K7+5C+mxVioSglIbbG0+f0dEn84H/5O1kRwmFi7NqsASubZ3edbU1ilcrY dBX/ENQN1s2FpbAlbbyEGj2Jwm9oBA7PUO2u825GqztkTEo8g3I1Huvc43tTc9+3Zrn3 /BFuZLabSJ1VNR1jp4YrAdMUiCpdhfijMd9UWb9oKTEtPBOWW4IbYyAoorl9t1uNhMqy mZLg== X-Gm-Message-State: AOAM533RwF7mRQSXSu0gmwx1PqmlYXUWxRoBsCgE/OttMsHNuEt9dgJe OmFaNjHmDkWK21VV/WCTF/K6qh7br8oXpgL/qG0= X-Google-Smtp-Source: ABdhPJxjmBIBG3iL9x2qMhUSp9QXe8HukxCrXVAvUToGtJyW2HkD8+yVyKQ4gywFTfINGN1/03n0tOvpoFmr98sYUCU= X-Received: by 2002:a63:144c:0:b0:3fa:6f09:a3e4 with SMTP id 12-20020a63144c000000b003fa6f09a3e4mr19871396pgu.102.1653655238891; Fri, 27 May 2022 05:40:38 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> In-Reply-To: <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> From: zimoun Date: Fri, 27 May 2022 14:40:27 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Fri, 27 May 2022 at 13:49, Maxime Devos wrote: > These old 4 bytes could be the ASCII representation of > > "foo > > . Then, when 'read' is run (after rebooting), it sees an incomplete > string "foo, so it fails. The question is how would 'read' fail or what would 'read' return? For instance, the patch works for these cases: - empty file - non-integer Now, if you are able to generate an incomplete file (from an integer or whatever) against the patch fails, then we can examine. However, I miss what would be the difference between this incomplete file and, let say, this case: echo -n -e \\x12 > ~/.cache/guix/inferiors/last-expiry-cleanup handled by the patch. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 09:04:59 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 13:04:59 +0000 Received: from localhost ([127.0.0.1]:33102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZeE-0001t4-WB for submit@debbugs.gnu.org; Fri, 27 May 2022 09:04:59 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:43804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZeA-0001ss-GE for 55673@debbugs.gnu.org; Fri, 27 May 2022 09:04:58 -0400 Received: from [172.20.10.5] ([188.188.246.167]) by albert.telenet-ops.be with bizsmtp id bp4s270013dS87Q06p4sVk; Fri, 27 May 2022 15:04:53 +0200 Message-ID: <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 15:04:47 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-lt5QqNA0CMplr2EWDoC4" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653656693; bh=7n2dYR0qKlCCgCHeyLhs4Tnr4Z0UqkNTU7zeJVVVPqY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GG8oAKM3SqQ++VqJjpB1kUWa8Ydopj+ACbkYkdoxRnIw13MDbfAbf883/Vy3qyvKy aPTPpwnRaQ3qD84BkEOvj7Q0HIO3YFwf/fkd89Jv9OGmoiKquEjxCQz/j4uE8yvsWD 2aHPqSjTax1MDTw9yWwZAJ9JQwCfaaWcDse3fLfkE6ztKzTvdoxzLVTF8hs3hnhcwH 521ZLblHbtLxVbwnJRcTLGzQsShVCXqtCZ4aLAMHMZZ4KmhhU3FkAFzXPta5OAf5dO Ua35HhnZXaFCDTtv0TW5Q/sR9BX/kL48VgIc41uKbeetIp6yQf+h3aCaC+lhm8f0nR ub/BiPGz77GLg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-lt5QqNA0CMplr2EWDoC4 Content-Type: multipart/mixed; boundary="=-SfM7dMVCjZs/3NNglwL8" --=-SfM7dMVCjZs/3NNglwL8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 14:40 [+0200]: > > These old 4 bytes could be the ASCII representation of > >=20 > > =C2=A0=C2=A0 "foo > >=20 > > .=C2=A0 Then, when 'read' is run (after rebooting), it sees an > > incomplete > > string "foo, so it fails. >=20 > The question is how would 'read' fail or what would 'read' return? > For instance, the patch works for these cases: >=20 > =C2=A0- empty file > =C2=A0- non-integer >=20 > Now, if you are able to generate an incomplete file (from an integer > or whatever) against the patch fails, then we can examine.=C2=A0 However, > I > miss what would be the difference between this incomplete file and, > let say, this case: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 echo -n -e \\x12 > ~/.cache/guix/inferiors/last-= expiry-cleanup >=20 > handled by the patch. The incomplete file is: "foo as mentioned previously. Here's how it fails: scheme@(guile-user)> (call-with-input-file "a" read) ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure scm_lreadr: a:2:1: end of file in string constant The difference is that ^R is interpreted as a symbol, whereas "foo cannot be interpreted as anything at all by 'read'. Greetings, Maxime. --=-SfM7dMVCjZs/3NNglwL8 Content-Disposition: attachment; filename="a" Content-Type: text/plain; name="a"; charset="us-ascii" Content-Transfer-Encoding: quoted-printable "foo --=-SfM7dMVCjZs/3NNglwL8-- --=-lt5QqNA0CMplr2EWDoC4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpDMbxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uY/AP0YSCfNMQK5NfD6dmr2mNvFQ/1D TSSH+3utwWSQeKo6FQEA1QbRLfGgqk2X3jSsMyhG3FnjPVROqsl3RDX94wpzcAU= =rsM8 -----END PGP SIGNATURE----- --=-lt5QqNA0CMplr2EWDoC4-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 09:23:50 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 13:23:50 +0000 Received: from localhost ([127.0.0.1]:33154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZwT-0002NP-VY for submit@debbugs.gnu.org; Fri, 27 May 2022 09:23:50 -0400 Received: from mail-pl1-f178.google.com ([209.85.214.178]:38755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuZwS-0002NB-QO for 55673@debbugs.gnu.org; Fri, 27 May 2022 09:23:49 -0400 Received: by mail-pl1-f178.google.com with SMTP id n18so4137315plg.5 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 06:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vrHJ9SqbUMfXQLAh8Ir1Ac0VshvCxHRiToe++y31GD8=; b=PoIWBfYI8IuMkYaATorW3kim24aLLqy9f4f0b6wRO6YGrgnRlqE3RM90lHkRoG4S2L pIeuskx19Wfg+0MWlV0cOMH4MkERWhm/py/jfvnN2K3p3MY/OxTZ+MQO6oAZK3H/zRX+ 7tTrmSvCJnKsOOHhmojqIfjcTtRhgRspb6iirOLgxYOwf4uc98gQeQv+z0msU5CWcxHN Tnj5Ez+8/uUblYIGLwyKONQBy/R45fkHGMF+3WhfDy+jU/80SqF4vqmBWA6P+eqyJ0Pj xWKDvy7TGKTYqkM9iYjrwBZhXAXVihgqZDtjiZv5XgLtMcAZeK4IPwM9rumRUFu6YQYo GIEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vrHJ9SqbUMfXQLAh8Ir1Ac0VshvCxHRiToe++y31GD8=; b=v/gYFMuMhO6LJU65VveEGokO7+Iqm0E8VpbZn0NCJDuiMWbtBEIVVapCgfiphnZa3/ m4UWypSAlHjTN4zjYaOKFjL1ewwbDRPI1tEd50d149zeZXZb+wN8IQF9QTMvjqv0pA31 cg+UoO8ZPpMFEBLLKGIWDgHHwF3KsxxC12vFfYOMhy5sPWRZYigmX8093gEZTLVhS6ls f8O392jS8BYPlKzCdleb2cenej43PpN43VP4puH9FEKGXQ1WNuVxE+k04k9hhKork8Qy KyoFo2ZykEcdE1RTiz3mtel02RDfrOfkTfz4FmqCvGe+1nCdsaoAh+NE2IJgcCIgH8+W ThDQ== X-Gm-Message-State: AOAM530WjDCGYimGne2oS4NsgJD9VCXPJspFoR2sKcPeKB8WrppHtPZb +75uarQ+b0um8J0rjvHIEUwOYFREcym8jnLK5nQ= X-Google-Smtp-Source: ABdhPJzJ9/F1bcHKK/4y2lQ638UhiyH1FUCuE17I0yjcm2JuVRXSTT6w78wUCHO/vr9M0Yl7c2MfMTDjlglGaHcoBqc= X-Received: by 2002:a17:902:690b:b0:159:65c:9044 with SMTP id j11-20020a170902690b00b00159065c9044mr43986489plk.47.1653657823097; Fri, 27 May 2022 06:23:43 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> In-Reply-To: <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> From: zimoun Date: Fri, 27 May 2022 15:23:31 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Fri, 27 May 2022 at 15:04, Maxime Devos wrote: > scheme@(guile-user)> (call-with-input-file "a" read) > ice-9/boot-9.scm:1669:16: In procedure raise-exception: > In procedure scm_lreadr: a:2:1: end of file in string constant This is an ad-hoc example and not a real test case. --8<---------------cut here---------------start------------->8--- $ echo "foo" > ~/.cache/guix/inferiors/last-expiry-cleanup $ cat ~/.cache/guix/inferiors/last-expiry-cleanup foo $ ./pre-inst-env guix time-machine --commit=9d795fb -- help Usage: guix OPTION | COMMAND ARGS... Run COMMAND with ARGS, if given. --8<---------------cut here---------------end--------------->8--- As previously mentioned, the patch fixes: - empty file - non-integer I am not able to imagine an incomplete file worse than \\x00. > The difference is that ^R is interpreted as a symbol, whereas "foo > cannot be interpreted as anything at all by 'read'. I do not understand what you mean and I think you are overengineering. If you are able to produce a corrupted file which breaks "guix time-machine", then we can examine. Else let move on. :-) Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 09:31:05 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 13:31:05 +0000 Received: from localhost ([127.0.0.1]:33160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nua3U-0002YM-MC for submit@debbugs.gnu.org; Fri, 27 May 2022 09:31:04 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:43900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nua3S-0002Y1-NX for 55673@debbugs.gnu.org; Fri, 27 May 2022 09:31:03 -0400 Received: by mail-pj1-f41.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so4386308pjq.2 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 06:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HWxPTqky52mPxblg62MNxf4HOtkb5Q5VbYAixZXtQt0=; b=e+NLIwGuVUYcqXRbhg2dCYWDL4G6tzX+vhiQQjXgcbVL9/t+inKl2YeMMUqIsnfeFP S/yQBUgX8Ro/eiwQZI1neLWETXnPv5NABTkCcMqvxf7MjjE/cdARHr/rlWh4jlzDiUvM QqBybxjBmOXteSFVs0DID0PvdwBry4mWVaO3R5MQDOTEQv6yXba6Cs6kBBwZxTGWcP4Z Ezdnq2znS4OUDsngTkyzHzxMB45vNWHUHPZnsbpc3jNBMjJj6VwzloyCYBDaH8veJ7z4 LZzTCricuuHCa/Wy0onDjX+9lcue1V1Hs/Ynp56YUxhoPtEcLuqlVtQ9yok6nqntURWS i8yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HWxPTqky52mPxblg62MNxf4HOtkb5Q5VbYAixZXtQt0=; b=eJ5dNJZVZt1r/HvhkdSu4gW20dSM/Oc5q9z/zGfhBJvUgQMRJsKY0UezC2bhxQzzNX Sgl7sVFutyH3cPN7qRSalgh6yzGgV1J6KlojRboECtlrN83ILvuvhNbKlPSDJr46Bvfz UTj+3bT0S7tGuXWMWfWGbE7MjKh6FE1u7dsDTK42RDqp5zK8toEoHKeyu4W8REkFsx/x CuWo7W4gKmV3XK5lU5YS6As/wBXCSerUMgDMx2vvYh0TVun6Pe+APCxGgtropChgGpsc tXQqgqpNxUyrhkpENNFRklp1/AY6ww1RPDSu+zxgTX6rsHjx4/yU8k0d4roqFJTfJzYy ZxAA== X-Gm-Message-State: AOAM531Cx5uyvg/Ec0xzmpipqw9Xg4HG5PmAHdrO/UWh7Pri85yVMYR7 +0v85Zhn2BKlZrMP4tSCZfx3HmefjV4ZE2VlDnc= X-Google-Smtp-Source: ABdhPJx6NN81SKhK8vH76Na8AhlaBe9d8XivWWwYloq/meMu23XltOl9d90I5Ks57HGFyI7vkGegwFd2rhakbFQPgVY= X-Received: by 2002:a17:902:da8c:b0:162:33b5:6aa1 with SMTP id j12-20020a170902da8c00b0016233b56aa1mr21818361plx.75.1653658256777; Fri, 27 May 2022 06:30:56 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> In-Reply-To: From: zimoun Date: Fri, 27 May 2022 15:30:45 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 27 May 2022 at 15:23, zimoun wrote: > On Fri, 27 May 2022 at 15:04, Maxime Devos wrote: > > > scheme@(guile-user)> (call-with-input-file "a" read) > > ice-9/boot-9.scm:1669:16: In procedure raise-exception: > > In procedure scm_lreadr: a:2:1: end of file in string constant > > This is an ad-hoc example and not a real test case. [...] > I am not able to imagine an incomplete file worse than \\x00. Just to be sure, I mean: an incomplete integer. For sure, any incomplete (unbalanced) sexp is breaking 'read', as the example "foo or (1 or whatever else; as you are correctly pointing. But since the cache 'write' an integer, it means it would be an incomplete integer. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 10:02:46 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 14:02:46 +0000 Received: from localhost ([127.0.0.1]:35531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuaY9-0003zt-OS for submit@debbugs.gnu.org; Fri, 27 May 2022 10:02:45 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:55300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuaY7-0003zh-76 for 55673@debbugs.gnu.org; Fri, 27 May 2022 10:02:44 -0400 Received: from [172.20.10.5] ([188.188.246.167]) by michel.telenet-ops.be with bizsmtp id bq2g270023dS87Q06q2geG; Fri, 27 May 2022 16:02:41 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 16:02:29 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-fxBjGupYufBB3okcZz5B" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653660161; bh=9SXbu5+8idzcy6lvQoNSWInju/hjfU/2QmsdE/YYRVQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EZYHkq3z1Lt/SYu/kocZnJpxfPTph+jteRtYTeX1DN91jVPFnQGrMfj9QNBSo59ih +knw5S8XVeZQ4lC4I7kB03oN7utd0Vp1oQJ8jRkeKaNHOcJxKtsIouVUD9hEn9akjO mbZR3edBk/w9z/Ys/So6gr1OXVpxUaRWaAS4nYz3N1aEHF/L/G76dDuu2RmVOHmPba MZ/ctGjfVgUrNXNNT32ToMLV+oT+gYQVpk4stUjG1+rB6pAKh19A1BfdvqhsKTIRge Kr3QOcpl/SWMta/hhrBHOkvXJC1ZdpiQjxIaE6KXQFw++x7RW+fvmtIfXFuvmUOZAT dk0MLdGRMY6aw== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-fxBjGupYufBB3okcZz5B Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > The difference is that ^R is interpreted as a symbol, whereas "foo > > cannot be interpreted as anything at all by 'read'. > I do not understand what you mean ^R is interpreted as a symbol: (symbol? (call-with-input-string "\x12" read)). "foo" is interpreted as a string: (string? (call-with-input-string "\"foo\"" read)) "foo without a terminating string cannot be interpreted at all: (call-with-input-string "\"foo" read) > and I think you are overengineering. It's not any more overengineering than catching not-an-integer IMO. AFAICT, this does not find the definition of overengineering I found on Wikipedia. Also, I do not understand the resistance -- I have a simple proposal for generalising your patch to more failure modes, with a demonstration and test case (see the file "a") on when it is necessary and a proposed implementation. zimoun schreef op vr 27-05-2022 om 15:23 [+0200]: If you are able to produce a corrupted file which breaks "guix time-machine", then we can examine.=C2=A0 Else let move on. :-) I previously produced the corrupted file, see the file "a". I am not willing to deliberately corrupt my file system for this, especially when I can just give a synthetic example of corrupted file (see the file "a") and especially since making a synthetic example is much simpler and faster. Greetings, Maxime. --=-fxBjGupYufBB3okcZz5B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpDZ9RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7icOAPwPHcd5Z6PsdU6lw8lk7HcX1iFG kLtK37QV5tnJSMZYHwD+ObFnnfbUhNH1mxjxADTLaVFS/XZ6DoxyQHuB39vX6QI= =RLZx -----END PGP SIGNATURE----- --=-fxBjGupYufBB3okcZz5B-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 11:47:13 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 15:47:14 +0000 Received: from localhost ([127.0.0.1]:35644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nucBF-0006gv-KW for submit@debbugs.gnu.org; Fri, 27 May 2022 11:47:13 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:36800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nucBC-0006gh-OG for 55673@debbugs.gnu.org; Fri, 27 May 2022 11:47:12 -0400 Received: by mail-wr1-f41.google.com with SMTP id u3so6381914wrg.3 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 08:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/9MTsnm05Ku6jeO1qnRc6AdRgafy7KjBcCVWHGD8mS8=; b=S6Pgm/yRA500QS4V0mjL/ZTUkIwxZJKi22mFJDSTKxhWM4xMDB5Wsk0ufN8G9QtQFS CoFz0fISG7dJr8ENWtE9XTd6srGAEL4/cf/lEtQJ++o3xHmOZbQGVEFCgEBfCqvKNpul yCNs25HopMhZoOxSJxH2948AoZVP6Kps+JtPKyWXqzWO/0K8gQJBjbyHFGzCzy5B9dyS TK78to62UHUq3RDsV2aiDawIapmnqkHt/k0HxQimnIN9s/DF0e6nUWEKuzYZTrIxS/Kn zZR8OtJoWf+mxxUUpVKtOKJtbjjRZM8O0aX3v3B2ZYDrdfFSoeYXsVfLgZaznbhnAV6S BfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/9MTsnm05Ku6jeO1qnRc6AdRgafy7KjBcCVWHGD8mS8=; b=WNwKFlEFB1iQHckdtEgqAOCy1sJCn5WoWrB9rmjGPIooOA+cRat64IDWqpDWHI+tY8 W2K8rc1yho23N2w4Wiyi4clOFzkG3nTK4aTmxJcfKiKv/W3efobWJu2Ssq+Tlo9M1jB/ s5AKJj4wJCf6Dk3SRSNd4s9msVxlZTnD8sYmrUZtuP1jsusqij1ASFdVjG9NrybYmNpY Y3xitQPYo2VMnecUqufQUN4uiIsS9R2VTyEY+VKKQe7/8nL3Jj/W5+wnAd7kFnCcGCIx nLfrE7jEIfL+Nqtwewms2Y8iiNbkDVHmaTJ8xu0YiEXrkGVH/xIAf9XZbDgHqBBoacbK /pzQ== X-Gm-Message-State: AOAM533AyghmwRMsWOV2A3utdu6JM0v9PIdFE1tRrZvNQDsO/QI18zbf FGWLOp2Tgju0bdGP1yU8LsThdb6fIYg= X-Google-Smtp-Source: ABdhPJwI4fZflGnsTR+3rTM7oJQsyulxXWsDu/mf1k50/ZaTmseG/zf/VNiLcAP3NC79ULXC5a7NaA== X-Received: by 2002:a5d:588d:0:b0:20f:f290:ed83 with SMTP id n13-20020a5d588d000000b0020ff290ed83mr14866356wrf.588.1653666424488; Fri, 27 May 2022 08:47:04 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id y4-20020a056000168400b0020fd392df33sm2069044wrd.29.2022.05.27.08.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 08:47:04 -0700 (PDT) From: zimoun To: 55673@debbugs.gnu.org Subject: [PATCH v2] cache: Catch valid integer for 'last-expiry-cleanup'. Date: Fri, 27 May 2022 17:46:52 +0200 Message-Id: <20220527154652.700549-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Fixes . * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Check if the date is a valid integer. * tests/cache.scm: Test it. --- guix/cache.scm | 16 ++++++++++++---- tests/cache.scm | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/guix/cache.scm b/guix/cache.scm index 51009809bd..13f9e4a439 100644 --- a/guix/cache.scm +++ b/guix/cache.scm @@ -20,6 +20,7 @@ (define-module (guix cache) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:export (obsolete? delete-file* file-expiration-time @@ -91,10 +92,17 @@ (define expiry-file (string-append cache "/last-expiry-cleanup")) (define last-expiry-date - (catch 'system-error - (lambda () - (call-with-input-file expiry-file read)) - (const 0))) + (let ((value (catch 'system-error + (lambda () + (call-with-input-file expiry-file get-string-all)) + (const "0")))) + (catch #t ; Handle value out of range (e.g., 1234567890 -> 12E4567890) + (lambda () + ;; Handle empty or corrupted 'expiry-file' when 'write' below is + ;; interrupted before being complete (e.g., SIGINT with C-c) or when + ;; the filesystem crashes. + (or (string->number value) 0)) + (const 0)))) (when (obsolete? last-expiry-date now cleanup-period) (remove-expired-cache-entries (cache-entries cache) diff --git a/tests/cache.scm b/tests/cache.scm index 80b44d69aa..bd6fd64a22 100644 --- a/tests/cache.scm +++ b/tests/cache.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2020 Ludovic Courtès +;;; Copyright © 2022 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -74,6 +75,27 @@ (define-syntax-rule (test-cache-cleanup cache exp ...) (lambda (port) (display 0 port))))) +(test-equal "maybe-remove-expired-cache-entries, empty cache" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "" port))))) + +(test-equal "maybe-remove-expired-cache-entries, corrupted cache" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "1\"34657890" port))))) + +(test-equal "maybe-remove-expired-cache-entries, corrupted cache of out range" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "12E4567890" port))))) + (test-end "cache") ;;; Local Variables: base-commit: 38bf6c7d0cb588e8d4546db7d2e0bae2ec25183d -- 2.36.0 From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 12:20:15 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 16:20:15 +0000 Received: from localhost ([127.0.0.1]:35676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuchD-0007b0-F6 for submit@debbugs.gnu.org; Fri, 27 May 2022 12:20:15 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:42987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuchB-0007ag-L5 for 55673@debbugs.gnu.org; Fri, 27 May 2022 12:20:14 -0400 Received: by mail-pj1-f43.google.com with SMTP id cs3-20020a17090af50300b001e0808b5838so4783743pjb.1 for <55673@debbugs.gnu.org>; Fri, 27 May 2022 09:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=coB1NCuxcC85MbeMMPcUdyq7lT2/EV3iqJpW0372ZiE=; b=nprg6wrBYRG9V3h8i1fA/6NNgytFkgZgL0eATnj3ObeVTJj7XiX8TMV5ETkUO3INL9 pA2xpgAj1q/2RhnYhbkVxMaNEneP9EmgjzW0960Qv6jximeWZdYvB98Z9qLe+Q6FJaZX FexYatOk9icNWje4jaRVedTVYS+KISUOcBNwMHW13yVD6CtdMcO4yDq/mhefljebiAJO QftBpZRyIuQEo9+8K2+oj9fjihGKUS8jDHyrx1tnozCatW3IMp9x1Uh+JbwEDN7wIPoS tmxepfNLL/nk6PycM4h5ukTp7dip/RDyUiF+iCESE2JZQrbjCj1/hnyr1pIM2rMi/pYl dDDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=coB1NCuxcC85MbeMMPcUdyq7lT2/EV3iqJpW0372ZiE=; b=v7TIuCGeOq5lmi83P3RcwRmsY7hhN2ToiaZATra9jS6Bve6f/P6Fw9ctCy68PrmAPS 1OoyaSVPqPXV+RsiwerZ+NGXo59/SsTj98qtQfjBUyC8YFesk1rcoIhb9pF8tzGPlPvw gTgCrU62FU8GaKVme8v/+44tUc7CJHIRpK7gepVFj7mCjLHo2MAVQ8ttFbjnIFx3twJU 7vaUMIjqsTr4h9775VOTLPwAvS8ZGVpA+eFHv52+roSTacnEuQqlI00wbM6A2OxW8Ye2 IfuXD/UbbZ9oPtuVKvJDtlH5YVNeBB3xpezukxU+fSBph+NYCj6kEd32OSTSekayPKTn l8NQ== X-Gm-Message-State: AOAM533Pt3Q0WOTLzNqw6uw52dOJu59YAW3ZnDZNMLUc5eSLzeeXbFiI PWwVnN9StWGBFj3R0Y1t3qRxKWLl8Dca3QX3ACI= X-Google-Smtp-Source: ABdhPJw/tjQrUU/Bd/if9tZF6w1UvhsYraZgf4fymymubh4bkOsDtyy36BXVI/G5XH1B/ny7poUNyXSjn6YNKVLOiEs= X-Received: by 2002:a17:902:690b:b0:159:65c:9044 with SMTP id j11-20020a170902690b00b00159065c9044mr44715120plk.47.1653668407697; Fri, 27 May 2022 09:20:07 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> In-Reply-To: From: zimoun Date: Fri, 27 May 2022 18:19:55 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Fri, 27 May 2022 at 16:02, Maxime Devos wrote: > Also, I do not understand the resistance -- I have a simple proposal > for generalising your patch to more failure modes, with a demonstration > and test case (see the file "a") on when it is necessary and a > proposed implementation. I have sent a v2 using your proposal (which appears to me overcomplicated). It is not resistance but pragmatic: the only case of interest is the empty file, which happens -- all the others, I am still waiting at least one bug report about them i.e., a user runs "guix time-machine" and suddenly the file last-expiry-cleanup is corrupted and "guix time-machine" unusable. Pragmatic because, for instance, from 2 to " or from 8 to ( it is one bit-flip and thus 'read' would be easily broken. I miss why such lengthy discussion about these theoretical failures of last-expiry-cleanup when it is also true each time 'read' is used, see least-authority or ui.scm etc. But I have never read a word. Anyway. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 13:23:17 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 17:23:17 +0000 Received: from localhost ([127.0.0.1]:35725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nudgC-0002w8-O0 for submit@debbugs.gnu.org; Fri, 27 May 2022 13:23:16 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:57292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nudgB-0002w0-Er for 55673@debbugs.gnu.org; Fri, 27 May 2022 13:23:16 -0400 Received: from [172.20.10.9] ([188.189.228.36]) by laurent.telenet-ops.be with bizsmtp id btPC2700M0nlcFw01tPDPT; Fri, 27 May 2022 19:23:13 +0200 Message-ID: <2ed60126c5ea7d7cffcad77082feba74ddab7517.camel@telenet.be> Subject: Re: [bug#55673] [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun Date: Fri, 27 May 2022 19:23:05 +0200 In-Reply-To: References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <9432b1161007faacc0bd0e58da0bf839e2e8ec39.camel@telenet.be> <24883447c6f3d9b27bcc6e11e117ee974916e091.camel@telenet.be> <9483424cc3c89e5fa83ccc1e22b1f6cc7d04dd95.camel@telenet.be> <02f4e72bba800a2f59064a8bf628357b5a96f1d6.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-vk4RnnUo4QAY6dnT250b" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653672193; bh=rGruYoLHU2RKhRvbJEiamAUMVfd7xNL6aCtPaa1PnI8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Op+yNeSlnMXuXPjBLs/F+/i08ApW5SKivVPQ9njc2MA1RYncQwPfWC+SDnx93Q0HL YObl0mfljoP7RoTCiBZcx9mX5vX9Eoy/BfzJ3EVZoNWrRKaV75DuPsVSgLPvfv07Xw aakh6EY6EqFuaTl8Zs/ofdgQpucQi4OCPQbKo02gfsqLpybsF+U56JzBugjlaXCJ+k EiChDoLhr6oEIpM9AVpN4Hf33GmGumKx9X8IK5ggrrA99iH46ZqL2z9GFPZUEsA8RW C/co0Cpe0h/kxfoQSt2cRNU7tY/Po9ChLPjE+17ac0AUZrpGvZYMbNAH2XSMHQdyb9 qACNa5bdKb9dQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-vk4RnnUo4QAY6dnT250b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 18:19 [+0200]: > I miss why such lengthy discussion about these theoretical > failures of last-expiry-cleanup when it is also true each time 'read' > is used, see least-authority or ui.scm etc. (guix ui) cannot do anything about corruption except report the read failure, whereas (guix cache) has a=C2=A0very strict file format so it is feasible to detect whether it's corruption or just the user making a typo (because those files aren't directly written by a user) and additionally it can very easily handle the corruption. For (guix authority), there is already a corruption detection mechanism ("guix gc --verify=3Dcontents") -- there even already is a repair mechanism: "guix gc --verify=3Dcontents,repair". > It is not resistance but pragmatic: the only case of interest is > the empty file, which happens -- all the others, I am still waiting > at least one bug report about them i.e., a user runs "guix time- > machine" and suddenly the file last-expiry-cleanup is corrupted and > "guix time-machine" unusable. * The general issue of file system corruption in Guix is already known (the Guix daemon never calls fsync or sync except on the SQLite database), though I don't know if a formal bug report exists about that. There have been many bug reports on individual cases though. * This bug report already exists: . (You say the file system is not corrupted, but how would you know? Even if not, the symptoms are almost identical.) * I do not see the point of waiting for any known suffering users reporting the bug before fixing the bug. Seems negligent to me if the fix is easy and known, and not very pragmatic for those future (or maybe current and shy) users. Also has a risk of rebase conflicts, which does not seem pragmatic to me. Greetings, Maxime --=-vk4RnnUo4QAY6dnT250b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpEI+hccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7maLAP9BLkLrLMDf5+Uy5jugnE7WH/PX 8V9clB6T6gAePKwcjwEA0NUbqRToI/WCiqFiWs4AqzuIjUfZNUDwvOfp2tWZCgw= =MEW/ -----END PGP SIGNATURE----- --=-vk4RnnUo4QAY6dnT250b-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 13:33:09 2022 Received: (at 55673) by debbugs.gnu.org; 27 May 2022 17:33:09 +0000 Received: from localhost ([127.0.0.1]:35740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nudpl-0003EE-5s for submit@debbugs.gnu.org; Fri, 27 May 2022 13:33:09 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:37968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nudpi-0003E4-9G for 55673@debbugs.gnu.org; Fri, 27 May 2022 13:33:08 -0400 Received: from [172.20.10.5] ([213.251.121.143]) by laurent.telenet-ops.be with bizsmtp id btZ32700L35k8wt01tZ4pD; Fri, 27 May 2022 19:33:04 +0200 Message-ID: <239d8888536d1573ecd466b96c8ff6170316daa2.camel@telenet.be> Subject: Re: [bug#55673] [PATCH v2] cache: Catch valid integer for 'last-expiry-cleanup'. From: Maxime Devos To: zimoun , 55673@debbugs.gnu.org In-Reply-To: <20220527154652.700549-1-zimon.toutoune@gmail.com> References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <20220527154652.700549-1-zimon.toutoune@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-nc+SmN+Itx8qLC4pPZM+" Date: Fri, 27 May 2022 19:29:51 +0200 MIME-Version: 1.0 User-Agent: Evolution 3.38.3-1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653672784; bh=XegiYLUE1g3KuQr2FFltG/xVUphcpFhzyisFejGGslg=; h=Subject:From:To:In-Reply-To:References:Date; b=SdVryZracBHlgcwlRXVeWuGWfplFvrCHFoxFJX3cyjevxd6LLdWS9X/hcgma8SK0d IAgNbAcW5Erhhr2oBGhNk14+tFQ6O6JSjW1cVBtcpSlfXaWMruUD5TDY11mkw9mX2X 0waSxibhhEQkT4R5TrD5NljHeraoWxgW3zUOuHnEn5mRFFZj3czRq962zeXxNbt+wC 6hqYpGpmXKPnaHfm7kM6oqQNRNqS8HKp3fyBe24IdYlpp56yGHfIAgSWq+zftpN0Cj AI4EhPdicORyJZonw1LlMF1EcRSZCrTd7/WG4ZUkuzQOzdMsToMbPCgKIR19HenLJY pfQqDl94BLEQA== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-nc+SmN+Itx8qLC4pPZM+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op vr 27-05-2022 om 17:46 [+0200]: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (catch #t=C2=A0=C2=A0 ; Handle value out = of range (e.g., 1234567890 -> 12E4567890) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda () > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; Handle empty o= r corrupted 'expiry-file' when 'write' below is > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; interrupted be= fore being complete (e.g., SIGINT with C-c) or when > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; the filesystem= crashes. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (string->numb= er value) 0)) Why are 'stack-error' and 'out-of-memory' being caught? I recommend using one of the regexes from string->generations in (guix ui) instead to avoid catching too much. Greetings, Maxime. --=-nc+SmN+Itx8qLC4pPZM+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpEKixccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7j8zAQCzN+gPyiXMC1Hu9q8+zx2+RYnG Cx/GfCkKQL0JR0PCdgD7BTxq9fa3ss+0U6893B5F7VGx3ZAAbh2zN/rw4kZk4wc= =JaSK -----END PGP SIGNATURE----- --=-nc+SmN+Itx8qLC4pPZM+-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 30 09:07:35 2022 Received: (at 55673) by debbugs.gnu.org; 30 May 2022 13:07:35 +0000 Received: from localhost ([127.0.0.1]:43211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvf7O-0006kM-LU for submit@debbugs.gnu.org; Mon, 30 May 2022 09:07:34 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:40782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvf7M-0006k9-SS for 55673@debbugs.gnu.org; Mon, 30 May 2022 09:07:33 -0400 Received: by mail-wm1-f52.google.com with SMTP id v4-20020a1cac04000000b00397001398c0so8357412wme.5 for <55673@debbugs.gnu.org>; Mon, 30 May 2022 06:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3lccS2bliL+603pRG1316bCgFWmHFZ3xtbxlNgTUcVU=; b=JRfLo3cDS0qak3ImMzVThZBjXEVz/ZWRP0tAJeEuzcu60N6MOVWUCP1fHtC7TePSTI rq0g5oO5uZA/6QKTMRSOM33M9KYzwGG3D7LXrDMCA78QiziMvf+uPe/7XMu6XLs5WuKj iX9JHvwkAtUdu6f9SkgS35z8nyW4BNVaJSgaAqn2Y/kjPYrKFg5RwdhQX0/YpHf0VlBS +sOco0xQm6bd7rXt+NoBrJo9Uf9aibNPTt/lnvwgHujaF1JEXjwxhu4ANQpYD/AxZQX2 AAu7fCvsC/JUmMUK+PKweW/FxQEPQVgp4fudb/UeIzRIpBVUgYhOxA9vFKwPgq50uHjc dktQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3lccS2bliL+603pRG1316bCgFWmHFZ3xtbxlNgTUcVU=; b=UgeFuvyj5lQ1TGW9nmf20tpNNAemB8NLPNbYa5qr3zSL8WR5KpIPQfLs3fLkScT6Td OTSrEJh4RqBhcNPJQavCK6BssrULBRiis0or15I+z+hQxRrctgWqYyZFGf6331AoKzHl 5QbflvHew3AFxuCedy9Sp5L0VYbR75N58D0vJdDLpqQW0pxK+xcfJI6lOivt0sbqNDj3 1Z8aWHaKd0446QSOhJ3PkvJ0lknLc21PV61fjh4fqZnacSYwJvTuSTuHgnQOT2g4hn6W sYOxD6cgPFJj/qcGwooK+QytLGL7LTeyQCFedr4Vk1TneKymDl5hwih4Omw2UST18nn5 y5ug== X-Gm-Message-State: AOAM5335auHqbqd96+g0WrWy47w1lOR/ctvqqQAoSieTSHsR8YmK5qao I1qB0NwpEyBy3QDoRoal13OuzlRTVUA= X-Google-Smtp-Source: ABdhPJxI1rrXIkAci4F+2YgjvEbn2Y7xLnCk+b7D9EORHl3nJaLrohv7otAdVB402tYU0VK60dr4RQ== X-Received: by 2002:a05:600c:19cb:b0:397:51db:446f with SMTP id u11-20020a05600c19cb00b0039751db446fmr19086745wmq.182.1653916046922; Mon, 30 May 2022 06:07:26 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e15-20020a056000178f00b002102f2fac37sm4756531wrg.51.2022.05.30.06.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 06:07:26 -0700 (PDT) From: zimoun To: 55673@debbugs.gnu.org Subject: [PATCH v3] cache: Catch invalid 'last-expiry-cleanup'. Date: Mon, 30 May 2022 15:07:14 +0200 Message-Id: <20220530130714.2142519-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-Debbugs-CC: ludo@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Fixes . * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Check if the value is a valid integer. * tests/cache.scm: Test it. --- guix/cache.scm | 20 +++++++++++++++----- tests/cache.scm | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/guix/cache.scm b/guix/cache.scm index 51009809bd..9727a9eb58 100644 --- a/guix/cache.scm +++ b/guix/cache.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès +;;; Copyright © 2022 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,9 +18,11 @@ ;;; along with GNU Guix. If not, see . (define-module (guix cache) + #:use-module ((guix utils) #:select (with-atomic-file-output)) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:export (obsolete? delete-file* file-expiration-time @@ -91,10 +94,17 @@ (define expiry-file (string-append cache "/last-expiry-cleanup")) (define last-expiry-date - (catch 'system-error - (lambda () - (call-with-input-file expiry-file read)) - (const 0))) + (let ((str (catch 'system-error + (lambda () + (call-with-input-file expiry-file get-string-all)) + (const "0")))) + ;; Handle empty or corrupted 'expiry-file' when 'write' below is + ;; interrupted before being complete (e.g., SIGINT with C-c) or when + ;; the filesystem crashes. + (if (or (string-index str #\e) ; Handle value out of range + (string-index str #\E)) ; (e.g., 1234567890 -> 12E4567890) + 0 + (or (string->number str) 0)))) (when (obsolete? last-expiry-date now cleanup-period) (remove-expired-cache-entries (cache-entries cache) @@ -103,7 +113,7 @@ (define last-expiry-date #:delete-entry delete-entry) (catch 'system-error (lambda () - (call-with-output-file expiry-file + (with-atomic-file-output expiry-file (cute write (time-second now) <>))) (lambda args ;; ENOENT means CACHE does not exist. diff --git a/tests/cache.scm b/tests/cache.scm index 80b44d69aa..bd6fd64a22 100644 --- a/tests/cache.scm +++ b/tests/cache.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2020 Ludovic Courtès +;;; Copyright © 2022 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -74,6 +75,27 @@ (define-syntax-rule (test-cache-cleanup cache exp ...) (lambda (port) (display 0 port))))) +(test-equal "maybe-remove-expired-cache-entries, empty cache" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "" port))))) + +(test-equal "maybe-remove-expired-cache-entries, corrupted cache" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "1\"34657890" port))))) + +(test-equal "maybe-remove-expired-cache-entries, corrupted cache of out range" + '("a" "b" "c") + (test-cache-cleanup cache + (call-with-output-file (string-append cache "/last-expiry-cleanup") + (lambda (port) + (display "12E4567890" port))))) + (test-end "cache") ;;; Local Variables: base-commit: 38bf6c7d0cb588e8d4546db7d2e0bae2ec25183d -- 2.36.0 From debbugs-submit-bounces@debbugs.gnu.org Mon May 30 09:10:08 2022 Received: (at 55673) by debbugs.gnu.org; 30 May 2022 13:10:08 +0000 Received: from localhost ([127.0.0.1]:43232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvf9r-0006qp-Jt for submit@debbugs.gnu.org; Mon, 30 May 2022 09:10:07 -0400 Received: from mail-pf1-f179.google.com ([209.85.210.179]:45986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvf9o-0006pg-In for 55673@debbugs.gnu.org; Mon, 30 May 2022 09:10:05 -0400 Received: by mail-pf1-f179.google.com with SMTP id b135so10522759pfb.12 for <55673@debbugs.gnu.org>; Mon, 30 May 2022 06:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7ToDzmp+h4B5rl1XQRmIY86NWdFcEOq2o9ggZW7kryc=; b=eUmwRRJiLC4vmMVV8Cbc0jVwKNoRwD6IuVLpLmHC3o6HlkGqM4JbILxBPYNGBOj/M6 qZ9iDXGGXf8cGRqFf0p1A6g85wLGfPzVUqpDszaL7AMguPh1i+CwTSBWTB0rs4+k1DyU iia1XtRDS0TM/1wtnwUweBIzNxxYoZ/py8yhSfv6LTKmRYsKj/C1BZHtTD8BLiiZvXKB TQt2/oY4O4YxBpANQrjblfjUK4GLuW3xq9rV0yWmSudmqRjBCQRl537V1utWR+mR7jAh BFbidwB1xkUim5Y7N8J7cFkwxX2s2u7ouJKkeEElLCVPaZUPQJARv+L4m1ofcofQKIf/ vzRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7ToDzmp+h4B5rl1XQRmIY86NWdFcEOq2o9ggZW7kryc=; b=wzN2W5eSuXTG5TOzAUC36iB6iYBb7Tq5MYtkXUQagD3xMM2gaOCZHrvixhYrrB2wvG h/nQDeXEoxwR9FXND3vENZdH/FuQpyVI7+9LRzxdFeuS+OjAyYT+xsA+73Jax5AZ93rz Oif+GevoOga7X4qHyXwl3D1TzuhuDWX7LvZmOS4Iy+O0XepOQcEII4nOJdyHU6emM7lg v1QfD2Z8afivnJscVvziX/iTPWlJ/d29PNTH2TO4+CetRenw9nb+K6vatVZHnHELqwuM +IdPTYSDlaNgs/1iUs2Mtdtb0HuzIW+YdhAolix8aIOS7k62W0YwZ5SNrR+5dds2G4pn AuWg== X-Gm-Message-State: AOAM532/e571eSfkOvSCgZZ49RQ1ZgCDaGjpdHoRXnWpb9wDsakrUuH/ 5Xa/237GdW+XLYG8eszVEhqxm/AwupzHdvBo0/U= X-Google-Smtp-Source: ABdhPJyAxQPb28zHP8X2Y5KN2ue6pdXZPwCRFLvyJIKPr0NQL5jMFDHoqCH9s2SMo1Q3sCv5AEfJaD9AHsbP+X6crbg= X-Received: by 2002:a63:144c:0:b0:3fa:6f09:a3e4 with SMTP id 12-20020a63144c000000b003fa6f09a3e4mr31154132pgu.102.1653916198778; Mon, 30 May 2022 06:09:58 -0700 (PDT) MIME-Version: 1.0 References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <20220527154652.700549-1-zimon.toutoune@gmail.com> <239d8888536d1573ecd466b96c8ff6170316daa2.camel@telenet.be> In-Reply-To: <239d8888536d1573ecd466b96c8ff6170316daa2.camel@telenet.be> From: zimoun Date: Mon, 30 May 2022 15:09:47 +0200 Message-ID: Subject: Re: [bug#55673] [PATCH v2] cache: Catch valid integer for 'last-expiry-cleanup'. To: Maxime Devos Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55673 Cc: 55673@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 27 May 2022 at 19:33, Maxime Devos wrote: > Why are 'stack-error' and 'out-of-memory' being caught? > I recommend using one of the regexes from string->generations > in (guix ui) instead to avoid catching too much. Well, I have sent a v3. Note that that 'string->generations' does not catch the value out of range we are talking. --8<---------------cut here---------------start------------->8--- $ guix package --list-generations=3D12E4567890 Backtrace: 9 (primitive-load "/home/simon/.config/guix/current/bin/guix") In guix/ui.scm: 2230:7 8 (run-guix . _) 2193:10 7 (run-guix-command _ . _) In ice-9/boot-9.scm: 1752:10 6 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In guix/scripts/package.scm: 799:7 5 (_) In ice-9/boot-9.scm: 1747:15 4 (with-exception-handler # _ =E2=80=A6) In guix/scripts/package.scm: 810:16 3 (_) In guix/ui.scm: 1887:9 2 (matching-generations "12E4567890" "/var/guix/profiles/per-user/simon/guix-profile" =E2=80=A6) 1760:13 1 (string->generations _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure string->number: Value out of range: 4567890 --8<---------------cut here---------------end--------------->8--- Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 04 06:11:51 2022 Received: (at 55673-done) by debbugs.gnu.org; 4 Jun 2022 10:11:51 +0000 Received: from localhost ([127.0.0.1]:57685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxQl5-0001YX-C1 for submit@debbugs.gnu.org; Sat, 04 Jun 2022 06:11:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxQl3-0001YA-4m for 55673-done@debbugs.gnu.org; Sat, 04 Jun 2022 06:11:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxQkx-0008HE-Ut; Sat, 04 Jun 2022 06:11:43 -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=Yh/90v9sZOoYoMLbyAH2CA9f6rbDCQYbfPJAErpAwqg=; b=qzYSKhvwEorwiC5e8IhO y/hv6OSi6cjUcInJeymCapg3C+ePuP6n/vneezYXDHMYlrlqlA0NQlNDHp7JZtnlhMrXn+WUGXPp2 baRFOG6BNfub7sSIx2wZMBBt0sQffXS95/JEXf3hKNhf48Xciw2yJHXfudJZ5zds0kc4H1KpgkChJ of1fnax5xeyc8rR3hohUAhwqw2kivFFs6MRADQ159qbV/Az0jKqeb6rPZQK1btcX5rrYvhlngjp1P /g+GaIMaLJ40FV5sQbjWw4C5OYabA8lzZwv7LzGJ4ApIXBg3JR3q6zQZ9yILk95N5Wik+usRa6Wx1 Cb9u5tBl0hv4dQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58354 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxQkx-0003bw-IV; Sat, 04 Jun 2022 06:11:43 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#55673: [PATCH] cache: Catch valid integer for 'last-expiry-cleanup'. References: <20220527082519.501697-1-zimon.toutoune@gmail.com> <20220530130714.2142519-1-zimon.toutoune@gmail.com> Date: Sat, 04 Jun 2022 12:11:42 +0200 In-Reply-To: <20220530130714.2142519-1-zimon.toutoune@gmail.com> (zimoun's message of "Mon, 30 May 2022 15:07:14 +0200") Message-ID: <87k09wg2ld.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55673-done Cc: 55673-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, zimoun skribis: > Fixes . > > * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: = Check > if the value is a valid integer. > * tests/cache.scm: Test it. I simplified it a bit and pushed as 104b4e25ab7da5697f2f6f1ddfdd4955f05afece, thanks! Ludo=E2=80=99. From unknown Wed Jun 18 23:08:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 02 Jul 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator