Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2005 15:25:57 +0300
From:      Vladimir Sharun <sharun@ukr.net>
To:        freebsd-stable@freebsd.org, exim-users@exim.org
Subject:   Re: kmem_malloc(4096): kmem_map too small: 536870912 total allocated
Message-ID:  <20051025122557.GE55681@dun.ukr.net>
In-Reply-To: <E1EUNdm-000KRC-05@dilbert.firstcallgroup.co.uk>
References:  <20051025115712.GD55681@dun.ukr.net> <E1EUNdm-000KRC-05@dilbert.firstcallgroup.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Pete French wrote:
>> I found the sources of the leak: if exim accessess ANY configuration/text 
>> files over NFS, there will be leak. And, how often exim will be called, then
>> quicker your system dies.

 PF> Surely this has to be a problenm wth NFS in the kernel, not with exim
 PF> though? Did you log a FreeBSD PR on this ? I've been following your tracking
 PF> of it with interest, and I don't want it to get lost in the noise!

So, the test:

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>

int main() {
  int lockfd;
    char* tempfile="/media/testfile";
     lockfd=open(tempfile,O_CREAT);
     printf("Open errno:   %d\n",errno);
     if (flock(lockfd, LOCK_SH|LOCK_NB)==-1) {
     printf("ERROR shared lock:  %d\n",errno); }
  if (flock(lockfd, LOCK_EX|LOCK_NB)==-1) {  
        printf("ERROR exclusive lock:  %d\n",errno); }
   close(lockfd); }

If *ANY* lock will be transfered over a wire, memory after them will not be freed.
Regardless to errno. Even in case, where we do not start rpc.lockd 
(errno 45) or correctly start locking, in any case leak will be there. The only
way to avoid leak is mount NFS share with -L (do not transfer fcntl() locks over 
a wire). 
Systems affected: any FreeBSD 6.0 up to rc1.

Whoooh! 30 hours of investigations ;-)

-- 
UKR.NET Postmaster



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051025122557.GE55681>