Message ID | ba54947857f51c8f1cfb1f2efbb96ecc778494cb.1736417843.git.efraim@flashner.co.il |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 86A7D27BBEA; Thu, 9 Jan 2025 10:36:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 39C1D27BBE2 for <patchwork@mira.cbaines.net>; Thu, 9 Jan 2025 10:36:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tVptg-0002L0-46; Thu, 09 Jan 2025 05:36:16 -0500 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 <Debian-debbugs@debbugs.gnu.org>) id 1tVptU-0002Jy-0I for guix-patches@gnu.org; Thu, 09 Jan 2025 05:36:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tVptS-0005FM-Fi for guix-patches@gnu.org; Thu, 09 Jan 2025 05:36:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Q/ai75J7T+yZapFzSk7mUCVbiUyxTcbenzx8cW3ptUs=; b=ScrUGxiadcq7Jjg745T+ckkioOBSewEV4FBaxc4ydlXlMTY1gh5KHQkbCGMyT88p5tlemTz2mhfWRr1tQiIVtbCwfHtlVaY6qkaPGQBzKMk/JPtsJRfOYGx2IUsPcK2D+guG9JmamX7zaLLbj+RNuf/+j0ibiQWp0nx0hdC4dmELjg6bV9FhgVusfK8ElnXViqID+s8aFbv2BUaLpXlYYKZ7Bo9Xx4zwFyka1fRy/6HHA7mcUz3HzgZz9xOA9ZwcLAe3Qxu5gXwPs72ofJH6hWXBrt1i9lu8luRJ6uiQJaglsa+tEvnN1ppSM8fJ+gJCM/NuTbzlz6YVb/LLD7Wq2g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tVptR-0007kC-W1 for guix-patches@gnu.org; Thu, 09 Jan 2025 05:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75457] [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems. Resent-From: Efraim Flashner <efraim@flashner.co.il> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Jan 2025 10:36:01 +0000 Resent-Message-ID: <handler.75457.B.173641893729733@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75457@debbugs.gnu.org, ludo@gnu.org Cc: Efraim Flashner <efraim@flashner.co.il> X-Debbugs-Original-To: guix-patches@gnu.org, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org> Received: via spool by submit@debbugs.gnu.org id=B.173641893729733 (code B ref -1); Thu, 09 Jan 2025 10:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jan 2025 10:35:37 +0000 Received: from localhost ([127.0.0.1]:50552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tVpt2-0007jV-FO for submit@debbugs.gnu.org; Thu, 09 Jan 2025 05:35:36 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37664) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <efraim.flashner@gmail.com>) id 1tVpt0-0007j9-Gj for submit@debbugs.gnu.org; Thu, 09 Jan 2025 05:35:35 -0500 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 <efraim.flashner@gmail.com>) id 1tVpsm-0001dX-Ef for guix-patches@gnu.org; Thu, 09 Jan 2025 05:35:23 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <efraim.flashner@gmail.com>) id 1tVpsk-0005AG-Ao; Thu, 09 Jan 2025 05:35:20 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43624b2d453so8020845e9.2; Thu, 09 Jan 2025 02:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736418915; x=1737023715; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=Q/ai75J7T+yZapFzSk7mUCVbiUyxTcbenzx8cW3ptUs=; b=bt2GT0fnUu7heo0qIW7E3IOqxl76SEZpywkKcKSrL/dX7xbo67KJmhM6xF7+/L8rLM cSQMdj90yPj8cc9N3Fx9tRFahtuXWhsOB+LhDMKV7Xz98dc/pc0M+k6v3LETHAWSn4YK OU16/8l+vxLyqR8ln9hLqW17eTDTZvg+qvrpQDeae2bJNFk1paC7w8cvDe/k6ZbPVaQu Whx9PZlc9/mG9zJkR/8Ei6UBIuVyAGgyBZ/yb/sjO22eaepoGLYZg1K4e39K4Ba/jCvp CD24jbliKnijO5EnR/nkmYOWVQCSGis4nKOqy9LCHuD7fakJr8IyQmdMBNMPAUi11epc IFkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736418915; x=1737023715; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Q/ai75J7T+yZapFzSk7mUCVbiUyxTcbenzx8cW3ptUs=; b=A3gOQK673h3tDpJnaf2JOsDuHGc0yMI8Scohu1KSZFrnYZidQAV7nB6SfigwlMeLjV ZSl+KKIeQYu9zL+YH9YTiVVBxNCmx19hd5d23jcvVBit50WpXiyznR5b4FhErXiIAEA2 IE1BgidQTHOLYNJbpnay2DWX2L11qwXp/jCfAq7ip0lOhh++rG6oyK2by61hVHStCA/e rrQrVcXnLg7xzm+1HnlnARpllWLbqHIMQP9Okyr5lZSxXW1R1ETgtkquKvfHlv3QoYKr zDk8vZl+TKercXH5i7Abc3zUQsA9Zx2XkWUqIYjtanR5gXVYyoXj/eGa7jIsZx09zqH1 zoiA== X-Forwarded-Encrypted: i=1; AJvYcCXo7afHeu2qIRn4GsC3DPyTTiwpdVI7GhhsHzZ8DK0YI7bzq3SfNdofwdZdgZ9i8p8WV+UT@gnu.org X-Gm-Message-State: AOJu0YzzSHz7Hh5jeRYTAB8EvBBR8dXtDdoCuQK0cmKJwgSRjCrK8MVd Zlq7xGO+D6gJJzAjRFhANToRLGC+ueh0HruM3Isc02q33pUaXDDeQMkBKMw0 X-Gm-Gg: ASbGnctwU8pTw2Sv/KpFzoOnLcECWVXOh7ZTzAy6XPh6K/gGp/TWAWOyyep/z6Yi7kc uwxg71tEH1Lu/xtaipKwg9Cv5SIKaHbGFi9V6ksLYlB9MGOrJ854yo+AZ4KcPYLbZfFmHcdcteN cGLrtCUmFcmiJk5UkgNfWExwVyz5LzfFfHroc9x+M4NBUOY4rsgDGb+8RBJspGdUY+E7N/yC27x rpvgWMobf9pdHQS2QRsVI1IkaqDCXEnLK0p+UZgD6K3OKnMfiPQJwxCTq7NOA== X-Google-Smtp-Source: AGHT+IGA0ccq1Dt3kOBrAENBHotAs/qVZGJAw1pndE03VnAFeJY99rZNFqfWt+Nt2VZpm9Jq6kf98Q== X-Received: by 2002:a05:600c:3b25:b0:431:5c3d:1700 with SMTP id 5b1f17b1804b1-436e26e2307mr49556985e9.21.1736418914691; Thu, 09 Jan 2025 02:35:14 -0800 (PST) Received: from localhost ([141.226.10.168]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dd1cc3sm16205515e9.14.2025.01.09.02.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 02:35:14 -0800 (PST) From: Efraim Flashner <efraim@flashner.co.il> Date: Thu, 9 Jan 2025 12:18:00 +0200 Message-ID: <ba54947857f51c8f1cfb1f2efbb96ecc778494cb.1736417843.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#75457,guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.
|
|
Commit Message
Efraim Flashner
Jan. 9, 2025, 10:18 a.m. UTC
* zlib.scm (uncompress): Use the sizeof an unsigned-long for all size calculations instead of forcing 64-bit integers. --- I tested this (all the tests passed) using the guix.scm in the repo using: guix build -f guix.scm guix build -f guix.scm --system=i686-linux guix build -f guix.scm --system=powerpc-linux (with offloading to an actual powerpc-linux machine) zlib.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) base-commit: cfaf683579a97630040efe4b7596af4bc519b05e
Comments
Efraim Flashner <efraim@flashner.co.il> skribis: > * zlib.scm (uncompress): Use the sizeof an unsigned-long for all size > calculations instead of forcing 64-bit integers. Pushed as 7eb66708fb8db750d7175b750531a48e3f49d96d. Interestingly i686 was fine, probably because it’s little endian so the bug you had on powerpc didn’t show up. Let’s see if there’s anything else to fix and if not, we should tag a new version. Thanks! Ludo’.
On Sat, Jan 18, 2025 at 06:55:29PM +0100, Ludovic Courtès wrote: > Efraim Flashner <efraim@flashner.co.il> skribis: > > > * zlib.scm (uncompress): Use the sizeof an unsigned-long for all size > > calculations instead of forcing 64-bit integers. > > Pushed as 7eb66708fb8db750d7175b750531a48e3f49d96d. > > Interestingly i686 was fine, probably because it’s little endian so the > bug you had on powerpc didn’t show up. > > Let’s see if there’s anything else to fix and if not, we should tag a > new version. I had thought that some of the 64-bitness of running on a 64-bit machine while building as i686 leaked through, but checking debian's build logs¹ for guile-zlib 0.2.1-1 was inconclusive, with powerpc and hppa showing the same test failure I was hitting. Nothing on m68k, which I think is big endian, but it looks like the tests weren't run there. ¹ https://buildd.debian.org/status/package.php?p=guile-zlib&suite=sid
diff --git a/zlib.scm b/zlib.scm index 86ca4fc..a0702dc 100644 --- a/zlib.scm +++ b/zlib.scm @@ -425,9 +425,10 @@ require PORT to be a file port." the uncompressed data." (define (try-uncompress length) (let* ((dest (make-bytevector (* (sizeof uint8) length))) - (dest-length (make-bytevector 8)) - (source-length (make-bytevector 8))) - (bytevector-u64-set! source-length 0 length (native-endianness)) + (dest-length (make-bytevector (sizeof unsigned-long))) + (source-length (make-bytevector (sizeof unsigned-long)))) + (bytevector-uint-set! source-length 0 length + (native-endianness) (sizeof unsigned-long)) (bytevector-uint-set! dest-length 0 length (native-endianness) (sizeof unsigned-long)) (let ((result (%uncompress2 (bytevector->pointer dest)