msync - can someone shed some light please?

Julien ÉLIE julien at trigofacile.com
Sun Jun 15 06:00:39 UTC 2025


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
> 
> Inn refuses to start up, until I literally remove 1 line from my active 
> file.  As soon as I add them again, the issue reoccurs.  The name of the 
> group being added/removed is of no consequence, the issue is about the 
> amount of groups – that is what is getting me here, I completely fail to 
> understand how inn can’t start up with ~107K groups in the active file.

Do you happen to be able to rebuild INN with the fix that Richard proposed?

--- a/lib/mmap.c
+++ b/lib/mmap.c
@@ -27,7 +27,7 @@ inn__msync_page(void *p, size_t length, int flags)
      } else {
          const size_t mask = ~(size_t) (pagesize - 1);
          char *start = (char *) ((uintptr_t) p & mask);
-        char *end = (char *) (((uintptr_t) p + length + pagesize) & mask);
+        char *end = (char *) (((uintptr_t) p + length + pagesize - 1) & 
mask);

          return msync(start, end - start, flags);
      }




Also, maybe adding several newsgroups with the mod-active program may 
help unblocking your situation as the length of the active file will change?
   https://www.eyrie.org/~eagle/software/inn/docs/mod-active.html

Basically, you put in a file lines like:
ctlinnd newgroup xxx
ctlinnd newgroup yyy
ctlinnd newgroup zzz

Then you call as the news user:
mod-active filename


I hope it helps.

-- 
Julien ÉLIE

« – Est-ce que tu peux remettre en état un druide qui a dérapé sur une
     roche d'huile ?
   – Euh ?!? C'est un accident peu fréquent, mais je pense pouvoir y
     parvenir ! » (Astérix)



More information about the inn-workers mailing list