From owner-freebsd-stable@FreeBSD.ORG Tue Oct 25 12:25:59 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54F1416A41F for ; Tue, 25 Oct 2005 12:25:59 +0000 (GMT) (envelope-from for.bounces@dun.ukr.net) Received: from dun.ukr.net (dun.ukr.net [212.42.67.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id D68F143D46 for ; Tue, 25 Oct 2005 12:25:58 +0000 (GMT) (envelope-from for.bounces@dun.ukr.net) Received: from sharun by dun.ukr.net with local ID 1EUNsL-000LG1-Qb ; Tue, 25 Oct 2005 15:25:57 +0300 Date: Tue, 25 Oct 2005 15:25:57 +0300 From: Vladimir Sharun To: freebsd-stable@freebsd.org, exim-users@exim.org Message-ID: <20051025122557.GE55681@dun.ukr.net> Mail-Followup-To: Vladimir Sharun , freebsd-stable@freebsd.org, exim-users@exim.org References: <20051025115712.GD55681@dun.ukr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Cc: Subject: Re: kmem_malloc(4096): kmem_map too small: 536870912 total allocated X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 12:25:59 -0000 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 #include #include 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