On 9/28/22 21:52, Eduard Bloch wrote:
Hallo,
Hallo Eduard,
* Helge Deller [Wed, Sep 28 2022, 12:46:53PM]:
Package: apt-cacher-ng
Severity: 3.7.4-1
Tags: lfs, hppa, patch
Please enable large file support.
apt-cacher-ng uses readdir() which can fail on 32-bit arches
running on large discs.
This does not make sense. readdir() does not care about large discs. It
might care about the file number in a directory. And while there are
some limitations with readdir for virtual filesystems (like NFS) there
should be no issue with local filesystem where kernel is maintaining the
internal handle with proper means.
In apt-cacher-ng-3.7.4/src/dirwalk.cc, line 100ff you find:
struct dirent *dp;
...
while ( nullptr != (dp = readdir(dir)) )
{
if (strcmp(dp->d_name, ".") && strcmp(dp->d_name, ".."))
{
The problem here is, that if those flags [*] aren't set, the "struct dirent"
will only be able to hold file numbers which are max. 32bits width.
If you call readdir() a few lines below, this readdir will not be able
to store the file info in the dirent struct (if the file is located in
high area of discs), instead returns NULL with errno set (e.g. E2BIG or like
that).
Finally the readdir() will not work as expected as it doesn't find some files.
[*] _LARGEFILE_SOURCE or _FILE_OFFSET_BITS=64
I found a similiar issue with glibc right recently:
https://sourceware.org/bugzilla/show_bug.cgi?id=29583
So do you have your cache on NFS with thousands of files in a single
directory?
No, but a disc of TB size on a 32-bit platform.
Sometimes I see a cron job warning:
/etc/cron.daily/apt-cacher-ng:
Aborted
run-parts: /etc/cron.daily/apt-cacher-ng exited with return code 134
Change is trivial, just add "future=+lfs" to DEB_BUILD_MAINT_OPTIONS:
This does not make sense. That would only inject a couple of runtime
influencing defines.
Well, not just runtime influencing. More importantly: Build-time.
They enlarge the dirent struct for 64-bit wide inode numbers and
thus allow readdir() [which actually calls the readdir64 syscall then]
to function properly.
apt-cacher-ng has been adding those defines since
the early days of its creation.
Really?
I don't find the CFLAGS _LARGEFILE_SOURCE or _FILE_OFFSET_BITS=64 in the
sources.
And how would that affect readdir related syscalls?
I hope I explained above.
Helge