msync - can someone shed some light please?

Richard Kettlewell rjk at terraraq.uk
Thu Aug 7 17:42:18 UTC 2025


On 13/06/2025 22:55, Richard Kettlewell wrote:
> Julien ÉLIE wrote:
>> Hi Chris,
>>
>>> When adding groups (ctlinnd newgroup…), the following occurs:
>>>
>>> 2025-06-12T14:14:57.572314+02:00 nntpspool innd: SERVER msync 
>>> failed / var/lib/news/active 0x0x7f3f46800000 5062656 Cannot allocate 
>>> memory
[...]
> Assuming the page size is 4096 bytes:
> * p = 0x7f3f46800000 is already page-aligned so start = p
> * length = 5062656 is a multiple of 4096,
>    so we will get end = p + length + 4096,
>    given end-start = length+4096.
> 
> The effect is that INN will attempt to msync 4096 bytes beyond the end 
> of the mapping.
> 
> In https://man7.org/linux/man-pages/man2/msync.2.html doing this is 
> documented as being an error. The error code is consistent with the log 
> message:
> 
>         ENOMEM The indicated memory (or part of it) was not mapped.
> 
> If length % 4096 > 0 then the effect would just be to round up to an 
> exact number of pages, avoiding the error. So we'd expect to see the 
> error in 1/4096 (about 0.025%) of possible active files sizes.

As luck would have it I am now seeing the same error on one of my 
servers, and indeed:

-rw-rw-r-- 1 news news 1499136 Aug  7 04:15 /var/lib/news/active

...which is a multiple of 4096.

I have deleted a couple of groups I don't care about l-)

ttfn/rjk



More information about the inn-workers mailing list