* [bug#75457] [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.
@ 2025-01-09 10:18 Efraim Flashner
2025-01-18 17:55 ` bug#75457: " Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2025-01-09 10:18 UTC (permalink / raw)
To: 75457, ludo; +Cc: Efraim Flashner
* 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(-)
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)
base-commit: cfaf683579a97630040efe4b7596af4bc519b05e
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#75457: [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.
2025-01-09 10:18 [bug#75457] [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems Efraim Flashner
@ 2025-01-18 17:55 ` Ludovic Courtès
2025-01-19 8:41 ` [bug#75457] " Efraim Flashner
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2025-01-18 17:55 UTC (permalink / raw)
To: Efraim Flashner; +Cc: 75457-done
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’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [bug#75457] [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.
2025-01-18 17:55 ` bug#75457: " Ludovic Courtès
@ 2025-01-19 8:41 ` Efraim Flashner
0 siblings, 0 replies; 3+ messages in thread
From: Efraim Flashner @ 2025-01-19 8:41 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 75457-done
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
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
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-19 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 10:18 [bug#75457] [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems Efraim Flashner
2025-01-18 17:55 ` bug#75457: " Ludovic Courtès
2025-01-19 8:41 ` [bug#75457] " Efraim Flashner
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).