Your message dated Wed, 01 May 2024 05:49:26 +0000
with message-id <[email protected]>
and subject line Bug#1070042: fixed in e2fsprogs 1.47.1~rc2-1
has caused the Debian Bug report #1070042,
regarding libarchive: archive_entry_stat returns zero size on mips64el with 
_FILE_OFFSET_BITS=64
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1070042: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070042
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: libarchive
Version: 3.7.2-2
Severity: normal
X-Debbugs-Cc: [email protected], [email protected]
Control: affects -1 src:e2fsprogs

Hi,

the upload of e2fsprogs 1.47.1~rc1-1 to unstable yesterday uses a new
feature where libarchive is used to create filesystem images from
tarballs. This works on all architectures (main as well as ports) except
on mips64el:

https://buildd.debian.org/status/package.php?p=e2fsprogs

I attached a minimal reproducer. It includes an embedded gzipped tarball with a
single file called "myfilename" of size 10. It works fine if _FILE_OFFSET_BITS
is not set but with it, it reports a wrong archive member size of zero on
mips64el:

    $ gcc -Wall -g -O0 libarchivetest.c -larchive -D_FILE_OFFSET_BITS=64
    $ ./a.out
    myfilename: 0

Since the reproducer only makes use of libarchive, I'm filing this as a
libarchive bug. Since this problem is mips64el specific, I'm putting the
porter-list in X-Debbugs-Cc.

The problem can also be reproduced on bookworm.

gdb can show what is going on (thanks to Theodore Ts'o for the initial
debugging):

(gdb) run
[...]
Breakpoint 1, main () at test.c:49
49                      st = archive_entry_stat(entry);
(gdb) next
50                      fprintf(stderr, "%s: %ld\n", 
archive_entry_pathname(entry), st->st_size);
(gdb) p *st
$2 = {st_dev = 1, st_pad1 = {0, 0, 0}, st_ino = 1, st_mode = 33188, st_nlink = 
0, 
  st_uid = 1000, st_gid = 1000, st_rdev = 0, st_pad2 = {0, 0, 10}, st_size = 0, 
  st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 1714375615, tv_nsec 
= 0}, 
  st_ctim = {tv_sec = 0, tv_nsec = 0}, st_blksize = 0, st_pad4 = 0, st_blocks = 
0, 
  st_pad5 = {0 <repeats 14 times>}}

As one can see, the size "10" is not in st_size but in the padding before the
st_size member. This only happens when _FILE_OFFSET_BITS=64 and only on
mips64el.

Any idea what is going on with mips64el?

Thanks!

cheers, josch
#include <stdio.h>
#include <archive.h>
#include <archive_entry.h>

// gzipped tarball created with xxd --include
unsigned char archive_tar_gz[] = {
  0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xed, 0xce,
  0x41, 0x0a, 0xc2, 0x30, 0x10, 0x85, 0xe1, 0x59, 0x7b, 0x8a, 0x1c, 0x21,
  0xa3, 0xd3, 0xe4, 0x3c, 0xa5, 0x44, 0xb4, 0x98, 0x14, 0xda, 0xb8, 0xe8,
  0xed, 0xad, 0xb8, 0xd0, 0x95, 0xd2, 0x45, 0x29, 0xc2, 0xff, 0x6d, 0x1e,
  0xc3, 0x9b, 0xc5, 0xcb, 0xf3, 0xf9, 0x7a, 0x4b, 0xa5, 0xcd, 0x49, 0x36,
  0xe3, 0x17, 0xc1, 0xec, 0x99, 0x1a, 0x1b, 0xff, 0x99, 0x2f, 0x7a, 0x14,
  0xb5, 0xa0, 0xa7, 0x60, 0x4d, 0x88, 0x51, 0x96, 0x5b, 0x4d, 0xc5, 0xf9,
  0xed, 0x26, 0xbd, 0xdd, 0xa7, 0xda, 0x8e, 0xce, 0x49, 0x3f, 0x4c, 0xdd,
  0xe5, 0xcb, 0xdf, 0xaf, 0xfe, 0x4f, 0xe5, 0xb9, 0x1b, 0x4a, 0x4d, 0xa5,
  0x1e, 0xf6, 0x5e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe3, 0x01, 0x16, 0x64, 0x3c, 0x30,
  0x00, 0x28, 0x00, 0x00
};
unsigned int archive_tar_gz_len = 136;

int main() {
        int ret;
        struct archive_entry *entry;
        const struct stat *st;

        struct archive *a = archive_read_new();
        if (a == NULL) {
                fprintf(stderr, "archive_read_new\n");
                return 1;
        }
        archive_read_support_filter_all(a);
        archive_read_support_format_all(a);
        ret = archive_read_open_memory(a, archive_tar_gz, archive_tar_gz_len);
        if (ret != ARCHIVE_OK) {
                fprintf(stderr, "archive_read_open_memory\n");
                return 1;
        }
        for (;;) {
                ret = archive_read_next_header(a, &entry);
                if (ret == ARCHIVE_EOF) {
                        break;
                }
                if (ret != ARCHIVE_OK) {
                        fprintf(stderr, "archive_read_next_header\n");
                        return 1;
                }
                st = archive_entry_stat(entry);
                fprintf(stderr, "%s: %ld\n", archive_entry_pathname(entry), 
st->st_size);
        }
        archive_read_close(a);
        archive_read_free(a);
        return 0;
}

--- End Message ---
--- Begin Message ---
Source: e2fsprogs
Source-Version: 1.47.1~rc2-1
Done: Theodore Y. Ts'o <[email protected]>

We believe that the bug you reported is fixed in the latest version of
e2fsprogs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Theodore Y. Ts'o <[email protected]> (supplier of updated e2fsprogs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Wed, 01 May 2024 00:50:49 -0400
Source: e2fsprogs
Architecture: source
Version: 1.47.1~rc2-1
Distribution: unstable
Urgency: medium
Maintainer: Theodore Y. Ts'o <[email protected]>
Changed-By: Theodore Y. Ts'o <[email protected]>
Closes: 1070042 1070107
Changes:
 e2fsprogs (1.47.1~rc2-1) unstable; urgency=medium
 .
   * Update Chinese, Czech, French, Polish Romainian, Swedish, and
     Ukrainian translations
   * Fix libarchive support in mke2fs on mips64el (Closes: #1070042)
   * Fix e2scrub when the "systemctl" package is installed instead of
     systemd.  (Closes: #1070107)
   * Update to standards 4.7.0
Checksums-Sha1:
 10f5e2334d997ba156ffc36209134013d6aeb8db 2983 e2fsprogs_1.47.1~rc2-1.dsc
 6b7c50e16d99af888afb955ca679c361e59cbf35 9941383 
e2fsprogs_1.47.1~rc2.orig.tar.gz
 3cd3f7b166cf7a347f18414f61c10de5b6f427ef 488 
e2fsprogs_1.47.1~rc2.orig.tar.gz.asc
 5740a79efd30c9a38e228ba2623a1a40a031d5c1 89624 
e2fsprogs_1.47.1~rc2-1.debian.tar.xz
Checksums-Sha256:
 af93dc7e88a7cc95646b4fba5fb7da497112c9d0d0672a23a53130ffd3b5b1ec 2983 
e2fsprogs_1.47.1~rc2-1.dsc
 cfc9d0d6d1301357b420a40fd9c963bbc6563a03b3f29165162fd82c7470f97e 9941383 
e2fsprogs_1.47.1~rc2.orig.tar.gz
 e3429e842a50fb32e994dad37e54f5785b85f9a26cee8a7a26718804ea7f4ea7 488 
e2fsprogs_1.47.1~rc2.orig.tar.gz.asc
 50e1d2d28e07c53fefb5a10191c416f59777ee925a53cf3ce3ae6804673ccbeb 89624 
e2fsprogs_1.47.1~rc2-1.debian.tar.xz
Files:
 0f7f79c448ef863f242a9292faaa6fc9 2983 admin required e2fsprogs_1.47.1~rc2-1.dsc
 ef614d80a023834b8da61f6434ba7505 9941383 admin required 
e2fsprogs_1.47.1~rc2.orig.tar.gz
 952433dc629890f927697dd4ee0ba777 488 admin required 
e2fsprogs_1.47.1~rc2.orig.tar.gz.asc
 0aa8df88771700c4af0ea8611bbae8bd 89624 admin required 
e2fsprogs_1.47.1~rc2-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEK2m5VNv+CHkogTfJ8vlZVpUNgaMFAmYx0jcACgkQ8vlZVpUN
gaNldQf/XFRTXIHquwbAX2FC0dgrtM5gzeRt+g/B4hiK+pAnywjwulsRWVB6oz3o
WtMGXpIp8rt+hDNZuJLik7mLeRKHt7vbK3e9DhSKvGe889Duh49sJIIW+jCBYST5
4YOlb4u1V1u1bGVCEOcC12AhP//2rs/S2HNFxHYPV03WaqhAutx7MaSqpS/JrNIo
I3i/N/sow6s30sc/P8A9rN8y0TwM+yPHLciwqdFvxLpPzr/kW/MXH8/uul0v/0rX
M21Bta7yRmb3AWQSuaR5TUahCctc1t3IcLLsvgrAv3RRSUC79v66KGPyH2UPR3yD
UZixf+TJ5l3nitFMDnsoFq6S88Azbg==
=Bmwk
-----END PGP SIGNATURE-----

Attachment: pgpWxq01FPIY7.pgp
Description: PGP signature


--- End Message ---

Reply via email to