Hi!
We have recently run into a rather odd regression with glibc on Debian/sh4. Starting with glibc 2.24, file offsets are apparently wrong which results into all weird side effects.
One of these effects is that many applications error out with "File too large",
for example firebird3.0 during build:
sh -x -c "lockfile -1 /<<PKGBUILDDIR>>/gen/Release/firebird/bin/build-db.lock && /<<PKGBUILDDIR>>/gen/Release/firebird/bin/isql -q -i
/<<PKGBUILDDIR>>/src/dbs/metadata.sql; res=\$?; rm -f /<<PKGBUILDDIR>>/gen/Release/firebird/bin/build-db.lock; exit \$res"
+ lockfile -1 /<<PKGBUILDDIR>>/gen/Release/firebird/bin/build-db.lock
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
+ /<<PKGBUILDDIR>>/gen/Release/firebird/bin/isql -q -i /<<PKGBUILDDIR>>/src/dbs/metadata.sql
can't format message 17:0 -- message file /usr/lib/sh4-linux-gnu/firebird/3.0/firebird.msg not found
I/O error during "write" operation for file "/<<PKGBUILDDIR>>/gen/metadata.fdb"
-Error while trying to write to file
-File too large
can't format message 17:120 -- message file /usr/lib/sh4-linux-gnu/firebird/3.0/firebird.msg not found
+ res=1
+ rm -f /<<PKGBUILDDIR>>/gen/Release/firebird/bin/build-db.lock
+ exit 1
Or the systemd-journal:
[ 13.088000] systemd-journald[524]: Failed to create new system journal: File too large
Another side effect is that mkfs does not work properly anymore since it writes the superblock
at an incorrect offset. With a properly working glibc, the superblock is written at an offset
of 0x400 while with the broken glibc (2.24), the superblock starts at 0x000. As a result,
it's not possible to create a usable filesystem on affected machines:
root@tirpitz:~> mkfs.ext4 /dev/sda2
mke2fs 1.43.3 (04-Sep-2016)
Suggestion: Use Linux kernel >= 3.18 for improved stability of the metadata and journal checksum features.
Creating filesystem with 16252928 4k blocks and 4063232 inodes
Filesystem UUID: 7d9bf1ee-a913-45d0-895b-4032020c1f3b
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done
root@tirpitz:~> blkid /dev/sda2
/dev/sda2: PARTUUID="e6077cf7-02"
root@tirpitz:~> mount /dev/sda2 /srv
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
root@tirpitz:~>
Does anyone have a clue what could be the issue with glibc?
glibc commit 071af4769fcdfe2cd349157b01f27c9571478ace looks like a
likely culprit. It was between 2.23 and 2.24 and is related to this
musl commit which may be easier to understand:
Debugging this is complicated by the fact that qemu-sh4 is _wrong_,
i.e. mismatches the real kernel in the opposite direction, so if
someone tested on qemu they would find it working (or if they fixed it
on real hardware, you would find it broken on qemu). Someone should
file a qemu bug for this too but I haven't gotten around to it yet.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=2152cf7edadb7673ea1e216de6fdfa658ec4ac1f
[2] https://sourceware.org/git/?p=glibc.git;a=commit;h=ccebcff824e76f2d3905185b8ae9ff1b51607791
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 486 |
Nodes: | 16 (2 / 14) |
Uptime: | 146:20:27 |
Calls: | 9,659 |
Calls today: | 1 |
Files: | 13,708 |
Messages: | 6,167,979 |