From owner-freebsd-stable@FreeBSD.ORG Wed Jul 23 15:13:37 2003 Return-Path: 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 D7A4037B401 for ; Wed, 23 Jul 2003 15:13:37 -0700 (PDT) Received: from pit.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1629243FA3 for ; Wed, 23 Jul 2003 15:13:37 -0700 (PDT) (envelope-from barney@pit.databus.com) Received: from pit.databus.com (localhost [127.0.0.1]) by pit.databus.com (8.12.9/8.12.9) with ESMTP id h6NMDan8027099; Wed, 23 Jul 2003 18:13:36 -0400 (EDT) (envelope-from barney@pit.databus.com) Received: (from barney@localhost) by pit.databus.com (8.12.9/8.12.9/Submit) id h6NMDaJf027098; Wed, 23 Jul 2003 18:13:36 -0400 (EDT) (envelope-from barney) Date: Wed, 23 Jul 2003 18:13:36 -0400 From: Barney Wolff To: Doug White Message-ID: <20030723221336.GA26555@pit.databus.com> References: <20030723173427.GA72876@vmunix.com> <20030723140329.C92624@carver.gumbysoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030723140329.C92624@carver.gumbysoft.com> User-Agent: Mutt/1.4.1i cc: freebsd-stable@freebsd.org cc: Gabor Subject: Re: malloc does not return null when out of memory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2003 22:13:38 -0000 On Wed, Jul 23, 2003 at 02:09:00PM -0700, Doug White wrote: > On Wed, 23 Jul 2003, Gabor wrote: > > > We have a little soekris box running freebsd that uses racoon for key > > management. It's used for setting up an ipsec tunnel. I noticed that > > one of these devices lost the tunnel this morning. I looked in the > > log and saw this > > > > Jul 23 01:37:57 m0n0wall /kernel: pid 80 (racoon), uid 0, was killed: out of swap space > > [...] > > > Here is the tail end of the output. It dies when trying to poke at > > the memory using memset. If I just malloc without the memset, it > > never even dies. > > That's normal. If you malloc() memory and never touch it then it is never > actually allocated. > > Your problem is that you're running out of memory. Try killing off > unneeded daemons and set maxusers to a low value (like 32). Also try > reducing the size of your mfs partitions, if you're using rc.diskless2. I > don't think raccoon is much of a memory pig, unless you have a huge number > of connections. Shouldn't malloc return 0 when out of memory rather than returning an address that won't work? I believe that was the complaint. Presumably having NO_SWAPPING has something to do with it, but filling the swap might well do the same thing. One might argue that this is a config error, and ulimit should be used to cut the address space to below actually available memory. -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net.