[Pkg-clamav-devel] Bug#740059: Bug#740059: clamav: LibClamAV Error: CRITICAL: fmap() failed
Sebastian Andrzej Siewior
sebastian at breakpoint.cc
Thu Dec 3 19:58:59 GMT 2026
On 2026-12-01 21:11:59 [+0200], Edmund Lodewijks wrote:
> Looking at the 1.4.7 tarball, libclamav/fmap.c:393-416):
>
> if (use_aging) {
> if ((m->data = (fmap_t *)mmap(NULL, mapsz,
> PROT_READ | PROT_WRITE, MAP_PRIVATE | ANONYMOUS_MAP,
> -1, 0)) == MAP_FAILED) {
> m->data = NULL;
> }
> ...
> }
> if (!use_aging) {
> m->data = (fmap_t *)cli_max_malloc(mapsz);
> }
>
> Doesn't this do sort of what you want? Yet, it still wouldn't work on a
> 32-bit system? That would mean armhf, which is an officially supported
> Debian architecture. Not sure if this bug can be closed, since the issue is
> probably not resolved; but it also doesn't look like it will be?
Maybe close it. I remember the windows implementation read the file
chunks while linux mapped the whole thing. That would be ideal so you
would map the whole thing and keep it. If you scan large files, I can't
imagine having 10G in RAM sitting around is a good thing.
Anyway. I would suggest to close it and if someone has this problem I
would suggest to look at this again and loop in upstream.
Sebastian
More information about the Pkg-clamav-devel
mailing list