Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1221550

Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures

From Thomas Uhle <thomas.uhle@tu-dresden.de>
Newsgroups linux.debian.bugs.dist
Subject Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures
Date 2024-11-25 16:30 +0100
Message-ID <JMJcd-buta-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Package: wget2
Version: 2.1.0-4
Severity: important
Tags: upstream ftbfs sid trixie
Control: block 1086111 by -1
Control: forwarded -1 https://gitlab.com/gnuwget/wget2/-/issues/684
X-Debbugs-CC: Andreas Tille <tille@debian.org>, Paul Gevers <elbrus@debian.org>

Dear maintainers,

currently, two tests from wget2's test suite (test-wget-1 and 
test-timestamping) may fail on 32-bit architectures due to a bug in the 
setup of wget2's option parser.  This might lead to misaligned memory 
access as can be seen in the armhf build log [1] at least:

> options.c:359:28: runtime error: store to misaligned address 0x00c1d26c for type 'long long int', which requires 8 byte alignment
> 0x00c1d26c: note: pointer points here
>   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
>               ^
> Unexpected error code 1, expected 0 [--chunk-size=3]

I have tracked down the bug to a bad typecast from '(size_t *) 
&config.chunk_size' to '(long long *)'.  While both 'long long' and 
'size_t' have 64 bits on 64-bit architectures, their memory size differ 
on 32-bit architectures: 'long long' still has 64 bits but 'size_t' has 
only 32 bits.

As there is more than one way to fix it, I have opened a ticket upstream 
to let the authors know about it and to discuss their preferences on how 
to fix it.

Best regards,

Thomas Uhle


[1] https://buildd.debian.org/status/fetch.php?pkg=wget2&arch=armhf&ver=2.1.0-4&stamp=1727628282

Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures Thomas Uhle <thomas.uhle@tu-dresden.de> - 2024-11-25 16:30 +0100
  Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures Thomas Uhle <thomas.uhle@mailbox.tu-dresden.de> - 2024-12-06 12:30 +0100
    Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures Andreas Tille <tille@debian.org> - 2024-12-06 14:10 +0100
      Bug#1089156: Bug#1088242: wget2: potential misaligned memory access on 32-bit architectures Thomas Uhle <thomas.uhle@mailbox.tu-dresden.de> - 2024-12-06 23:40 +0100

csiph-web