Received: (at 62243) by debbugs.gnu.org; 20 Mar 2023 11:50:11 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 20 07:50:10 2023 Received: from localhost ([127.0.0.1]:53839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1peE1i-0003fa-KB for submit <at> debbugs.gnu.org; Mon, 20 Mar 2023 07:50:10 -0400 Received: from mira.cbaines.net ([212.71.252.8]:42406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1peE1h-0003fS-Eu for 62243 <at> debbugs.gnu.org; Mon, 20 Mar 2023 07:50:09 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id 40BCD16EC7; Mon, 20 Mar 2023 11:50:08 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 5cb511b8; Mon, 20 Mar 2023 11:50:07 +0000 (UTC) References: <20230317145828.20404-1-mail@HIDDEN> <87edpjq03o.fsf@HIDDEN> User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines <mail@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#62243: [PATCH] gnu: guile-3.0-latest: Add patch for invalid unicode handling. Date: Mon, 20 Mar 2023 11:49:24 +0000 In-reply-to: <87edpjq03o.fsf@HIDDEN> Message-ID: <87v8iv4p77.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62243 Cc: 62243 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >> +* module/ice-9/suspendable-ports.scm (decode-utf8, bad-utf8-len): Flip a >> +couple of inequalities. >> +* test-suite/tests/ports.test ("string ports"): Add additional invalid >> +UTF-8 test case. > > Good catch! Could you please submit it to bug-guile@HIDDEN first, > perhaps with a higher-level example based on what you have in > <https://issues.guix.gnu.org/62240> showing how to reproduce the issue? Sure, I've created a bug against Guile now https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62290 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQYSGxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfngQ/6A6fDhZG1yElo4Ol/DVRDmxFMe2Rv+Msr X03pL54cabAXsMHUdxOCbaRMFqMAn+7QI74rSnnskk2LuMzmuX9dyRbmWfAaXJTz O8z/aovmuR8MoPLpw596yCPedZho3zly8pbqxl/8csZsi16GWYjxIx0WMcqINAoB YNNL8Q7pXXTvkwboeaDZh696LsfK3EC1qX1PxvjfyxAP73lz5Ys68elI+hNYsZYn LXTSDW+zvLQ10Bi+OCKcNnjJXec6p6K/xRqDRTVEiiF2ucbnfciR5Ryff1zWxC45 OKZEDb6mxNUB+4pms0K9nmLgtr8NRLnWAv5uaNJsysdoK4EnkswZwR1u7nBLVceg RLjXytMwxuzvE/4Gy963hnnEb/wi9lG2bDvSRRnDInDdx6sng4fi7EiRrVDhTCTW GcZiwZAAymHAmO+lSQ1LmhIoYgh6ssKj4CwpzFymdaTJASiqYKP4MmnLrck/mNq8 pbEJfnxAlDcL/Xh1RYsmbmAG/g5RLTyyrZZ1K0A+8bSnDLLhkDZDYLLW/aafBou1 t2Zm5/I1YSGkUHVj911pONlBJKB7Alr2aYV/kLPE8l6tV4rmwqiXknLIE3EBsbpC e2oR7qOlCdKBiow3nkYKYoqnNHGOet6V3YkhK34T2xuU6d5t8OO7QshFBZGnGhEK jUDKmSO6tcM= =GWua -----END PGP SIGNATURE----- --=-=-=--
guix-patches@HIDDEN
:bug#62243
; Package guix-patches
.
Full text available.Received: (at 62243) by debbugs.gnu.org; 20 Mar 2023 08:49:11 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 20 04:49:10 2023 Received: from localhost ([127.0.0.1]:53646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1peBCY-0002Tg-JB for submit <at> debbugs.gnu.org; Mon, 20 Mar 2023 04:49:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1peBCW-0002TU-ND for 62243 <at> debbugs.gnu.org; Mon, 20 Mar 2023 04:49:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1peBCP-0001xs-TR; Mon, 20 Mar 2023 04:49:03 -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=cnZ57mHDgYED0/2GpfI3HPLw3hVKFp9MNxYRNDwO75M=; b=Xb7wvhwFJ3susKs3b85L W8kslqLHZnke5liL4WuMYplkbps0E0O0AjP1q7XAvYFClBjBsQYpMuWKRXqOCbZkLMhBrITOCMb8Z pSiAzTlaDJ52LmdCrGmzeZIN7DC9zDKpchVjPOajhTA+WCxBN4+w/Sx+ntIdKwTidBL+VmAnWx0GI Lpm+UQrljD8pjcLIGvxQEwvMlQIQUAP/6GYRKSMZBFz/a3PG44UzVbkYbOxD4afjNLweAI32FmDTG iFo8DpHURckvc8ty6VoXdDFaoDQ8hQR7Vxk65ZaAy7PUmp9CvdMIrp5G9z2IHdzS1eeOS2IvwDTSJ z7KQqgVTtLrVpQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1peBCP-0002CL-7f; Mon, 20 Mar 2023 04:49:01 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Christopher Baines <mail@HIDDEN> Subject: Re: bug#62243: [PATCH] gnu: guile-3.0-latest: Add patch for invalid unicode handling. References: <20230317145828.20404-1-mail@HIDDEN> Date: Mon, 20 Mar 2023 09:48:59 +0100 In-Reply-To: <20230317145828.20404-1-mail@HIDDEN> (Christopher Baines's message of "Fri, 17 Mar 2023 14:58:28 +0000") Message-ID: <87edpjq03o.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62243 Cc: 62243 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Chris, Christopher Baines <mail@HIDDEN> skribis: > This patch fixes handling of invalid unicode when using suspendable ports. > > As the build coordinator agents use suspendable ports, this will fix issu= es > with building things where the log output contains invalid unicode. > > * gnu/packages/patches/guile-fix-invalid-unicode-handling.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/guile.scm (guile-3.0-latest)[source]: Use it. [...] > +From 31a1c3c4783e8e66b93500737f23f209d8115f77 Mon Sep 17 00:00:00 2001 > +From: Christopher Baines <mail@HIDDEN> > +Date: Fri, 17 Mar 2023 12:48:39 +0000 > +Subject: [PATCH] Fix some invalid unicode handling issues with suspendab= le > + ports. > + > +Based on the implementation in ports.c. I don't understand what this > +code is really doing, but the suspendable ports implementation differs > +from the similar C code for a couple of inequalities. > + > +* module/ice-9/suspendable-ports.scm (decode-utf8, bad-utf8-len): Flip a > +couple of inequalities. > +* test-suite/tests/ports.test ("string ports"): Add additional invalid > +UTF-8 test case. Good catch! Could you please submit it to bug-guile@HIDDEN first, perhaps with a higher-level example based on what you have in <https://issues.guix.gnu.org/62240> showing how to reproduce the issue? Then ideally we=E2=80=99d use the new release in Guix; if that would be inconvenient, for instance because of delays, that would at least allow us to refer to the upstream commit/issue in Guix. Don=E2=80=99t hesitate to ping me on IRC to make sure this doesn=E2=80=99t = stall. Thanks! Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#62243
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 17 Mar 2023 14:58:37 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 17 10:58:37 2023 Received: from localhost ([127.0.0.1]:45380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pdBXQ-0002pv-GP for submit <at> debbugs.gnu.org; Fri, 17 Mar 2023 10:58:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:42472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1pdBXO-0002pn-6B for submit <at> debbugs.gnu.org; Fri, 17 Mar 2023 10:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1pdBXN-0005cV-Tv for guix-patches@HIDDEN; Fri, 17 Mar 2023 10:58:33 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1pdBXL-00005h-U1 for guix-patches@HIDDEN; Fri, 17 Mar 2023 10:58:33 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id 0367716E8F for <guix-patches@HIDDEN>; Fri, 17 Mar 2023 14:58:29 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 8f1f8136 for <guix-patches@HIDDEN>; Fri, 17 Mar 2023 14:58:28 +0000 (UTC) From: Christopher Baines <mail@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH] gnu: guile-3.0-latest: Add patch for invalid unicode handling. Date: Fri, 17 Mar 2023 14:58:28 +0000 Message-Id: <20230317145828.20404-1-mail@HIDDEN> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@HIDDEN; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) This patch fixes handling of invalid unicode when using suspendable ports. As the build coordinator agents use suspendable ports, this will fix issues with building things where the log output contains invalid unicode. * gnu/packages/patches/guile-fix-invalid-unicode-handling.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/guile.scm (guile-3.0-latest)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/guile.scm | 4 +- .../guile-fix-invalid-unicode-handling.patch | 80 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/guile-fix-invalid-unicode-handling.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0a1a5d077f..25e24206e8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1294,6 +1294,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fibers-epoll-instance-is-dead.patch \ %D%/packages/patches/guile-fibers-fd-finalizer-leak.patch \ %D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \ + %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \ %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \ %D%/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch \ %D%/packages/patches/guile-present-coding.patch \ diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 2fd9b711ce..b6db506140 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -398,7 +398,9 @@ (define-public guile-3.0-latest version ".tar.xz")) (sha256 (base32 - "03bm1mnfc9kkg2ls942a0js7bxrdzmcffgrgg6anwdmjfan2a9hs")))) + "03bm1mnfc9kkg2ls942a0js7bxrdzmcffgrgg6anwdmjfan2a9hs")) + (patches (search-patches + "guile-fix-invalid-unicode-handling.patch")))) (arguments (substitute-keyword-arguments (package-arguments guile-3.0) ;; Guile 3.0.9 is bit-reproducible when built in parallel, thanks to diff --git a/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch b/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch new file mode 100644 index 0000000000..97b0f19057 --- /dev/null +++ b/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch @@ -0,0 +1,80 @@ +From 31a1c3c4783e8e66b93500737f23f209d8115f77 Mon Sep 17 00:00:00 2001 +From: Christopher Baines <mail@HIDDEN> +Date: Fri, 17 Mar 2023 12:48:39 +0000 +Subject: [PATCH] Fix some invalid unicode handling issues with suspendable + ports. + +Based on the implementation in ports.c. I don't understand what this +code is really doing, but the suspendable ports implementation differs +from the similar C code for a couple of inequalities. + +* module/ice-9/suspendable-ports.scm (decode-utf8, bad-utf8-len): Flip a +couple of inequalities. +* test-suite/tests/ports.test ("string ports"): Add additional invalid +UTF-8 test case. +--- + module/ice-9/suspendable-ports.scm | 8 ++++---- + test-suite/tests/ports.test | 7 +++++++ + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/module/ice-9/suspendable-ports.scm b/module/ice-9/suspendable-ports.scm +index a823f1d37..9fac1df62 100644 +--- a/module/ice-9/suspendable-ports.scm ++++ b/module/ice-9/suspendable-ports.scm +@@ -419,7 +419,7 @@ + (= (logand u8_2 #xc0) #x80) + (case u8_0 + ((#xe0) (>= u8_1 #xa0)) +- ((#xed) (>= u8_1 #x9f)) ++ ((#xed) (<= u8_1 #x9f)) + (else #t))) + (kt (integer->char + (logior (ash (logand u8_0 #x0f) 12) +@@ -436,7 +436,7 @@ + (= (logand u8_3 #xc0) #x80) + (case u8_0 + ((#xf0) (>= u8_1 #x90)) +- ((#xf4) (>= u8_1 #x8f)) ++ ((#xf4) (<= u8_1 #x8f)) + (else #t))) + (kt (integer->char + (logior (ash (logand u8_0 #x07) 18) +@@ -462,7 +462,7 @@ + ((< buffering 2) 1) + ((not (= (logand (ref 1) #xc0) #x80)) 1) + ((and (eq? first-byte #xe0) (< (ref 1) #xa0)) 1) +- ((and (eq? first-byte #xed) (< (ref 1) #x9f)) 1) ++ ((and (eq? first-byte #xed) (> (ref 1) #x9f)) 1) + ((< buffering 3) 2) + ((not (= (logand (ref 2) #xc0) #x80)) 2) + (else 0))) +@@ -471,7 +471,7 @@ + ((< buffering 2) 1) + ((not (= (logand (ref 1) #xc0) #x80)) 1) + ((and (eq? first-byte #xf0) (< (ref 1) #x90)) 1) +- ((and (eq? first-byte #xf4) (< (ref 1) #x8f)) 1) ++ ((and (eq? first-byte #xf4) (> (ref 1) #x8f)) 1) + ((< buffering 3) 2) + ((not (= (logand (ref 2) #xc0) #x80)) 2) + ((< buffering 4) 3) +diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test +index 66e10e3dd..1b30e1a68 100644 +--- a/test-suite/tests/ports.test ++++ b/test-suite/tests/ports.test +@@ -1059,6 +1059,13 @@ + eof)) + + (test-decoding-error (#xf0 #x88 #x88 #x88) "UTF-8" ++ (error ;; 2nd byte should be in the 90..BF range ++ error ;; 88: not a valid starting byte ++ error ;; 88: not a valid starting byte ++ error ;; 88: not a valid starting byte ++ eof)) ++ ++ (test-decoding-error (#xf4 #xa4 #xbd #xa4) "UTF-8" + (error ;; 2nd byte should be in the 90..BF range + error ;; 88: not a valid starting byte + error ;; 88: not a valid starting byte +-- +2.39.1 + -- 2.39.1
Christopher Baines <mail@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#62243
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.