From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#56413: [PATCH v2 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes Date: Mon, 06 Mar 2023 17:39:10 +0100 Message-ID: <87ilfd96mp.fsf@gnu.org> References: <87tu39rc4i.fsf@gnu.org> <20230305222100.1062507-1-rlb@defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 56413@debbugs.gnu.org To: Rob Browning Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Mar 06 17:40:51 2023 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZDtL-00035q-3L for guile-bugs@m.gmane-mx.org; Mon, 06 Mar 2023 17:40:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZDsZ-0005n8-Q4; Mon, 06 Mar 2023 11:40:03 -0500 Original-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 ) id 1pZDsY-0005k7-88 for bug-guile@gnu.org; Mon, 06 Mar 2023 11:40:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZDsX-0005s6-Ub for bug-guile@gnu.org; Mon, 06 Mar 2023 11:40:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZDsX-0005Qa-IV for bug-guile@gnu.org; Mon, 06 Mar 2023 11:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 06 Mar 2023 16:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56413 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 56413-submit@debbugs.gnu.org id=B56413.167812075920810 (code B ref 56413); Mon, 06 Mar 2023 16:40:01 +0000 Original-Received: (at 56413) by debbugs.gnu.org; 6 Mar 2023 16:39:19 +0000 Original-Received: from localhost ([127.0.0.1]:43446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZDrr-0005Pa-Ik for submit@debbugs.gnu.org; Mon, 06 Mar 2023 11:39:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZDrq-0005PL-8r for 56413@debbugs.gnu.org; Mon, 06 Mar 2023 11:39:18 -0500 Original-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 ) id 1pZDrk-0005hc-Pn; Mon, 06 Mar 2023 11:39:12 -0500 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=WenfYAjBfUFUHwHYgnE58EY6ZmyrDEb6G/luyYMxBRk=; b=i2JE71gpkuNcsTCDHocI twcLqBELZNNjYolipg5z7xPza4hb2/57b8vsM5Em3bKcxmKVBeXq+I6M4sFxtKns6TEIvYOS6qKT9 JH9jc1ZK0Z+2c7HUMDefTEMzFfpXxCfLBpvwo03IqY/S2OhxQhsRat66efuLs6uDRT9CtRS+Sg1fL 3XACM4ix3+WBZELxK2qNiSUCDIYMHhBZbs4B2Na3mJwTCvvFJiOrvXp4uAXkWCGuUbPTIR/5m9aAc F0JMOgcqm+EtI2TUR2nUfRc4o5GMvBWfGaKhOQQQA+11yuUR1vHCEvs9XK4j1LngWUBTsumXcsJXd Oca9ZyhSVcPIOw==; Original-Received: from [193.50.110.138] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZDrk-00073p-DT; Mon, 06 Mar 2023 11:39:12 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 16 =?UTF-8?Q?Vent=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de =?UTF-8?Q?l'=C3=89pinard?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <20230305222100.1062507-1-rlb@defaultvalue.org> (Rob Browning's message of "Sun, 5 Mar 2023 16:21:00 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10564 Archived-At: Hi, Rob Browning skribis: > Noticed while investigating a migration to utf-8 strings. After making > changes that routed non-ascii symbol hashing through this function, > encoding-iso88597.test began intermittently failing because it would > traverse trailing garbage when u8_strnlen reported 8 chars instead of 4. > > Change the scm_i_str2symbol and scm_i_str2uninterned_symbol internal > hash type to unsigned long to explicitly match the scm_i_string_hash > result type. > > * libguile/hash.c (scm_i_utf8_string_hash): Call u8_mbsnlen not u8_strnle= n. > * libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol): > Use unsigned long for scm_i_string_hash result. > * test-suite/standalone/.gitignore: Add test-hashing. > * test-suite/standalone/Makefile.am: Add test-hashing. > * test-suite/standalone/test-hashing.c: Add. LGTM, thanks! Please update =E2=80=98NEWS=E2=80=99 too, under a new =E2=80=9CBug fixes=E2= =80=9D heading. Ludo=E2=80=99.