From owner-freebsd-hackers Sat Jul 22 14:15:28 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bsa-1-as01-7-a52.gd.uol.com.br (bsa-1-as01-7-a52.gd.uol.com.br [200.197.118.52]) by hub.freebsd.org (Postfix) with ESMTP id E061737BA01 for ; Sat, 22 Jul 2000 14:15:16 -0700 (PDT) (envelope-from lioux@uol.com.br) Received: (qmail 511 invoked by uid 1001); 22 Jul 2000 21:13:52 -0000 From: "Mario Sergio Fujikawa Ferreira" Date: Sat, 22 Jul 2000 18:13:30 -0300 To: "Daniel C. Sobral" Cc: Mario Sergio Fujikawa Ferreira , freebsd-hackers@FreeBSD.ORG Subject: Re: sysutils/memtest and FreeBSD Message-ID: <20000722181330.A404@Fedaykin.here> References: <20000721175757.B319@Fedaykin.here> <3979B777.A8AD8511@newsguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <3979B777.A8AD8511@newsguy.com>; from dcs@newsguy.com on Sun, Jul 23, 2000 at 12:01:53AM +0900 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Daniel, On Sun, Jul 23, 2000 at 12:01:53AM +0900, Daniel C. Sobral wrote: > Mario Sergio Fujikawa Ferreira wrote: > > > > Backtracing showed that the problem was due > > to the malloc function inside the get_mem function. > > get_mem() is used to find out the largest possible memory segment. > > It incrementaly reduces the segment passed to malloc to alloc. > > It is the malloc function allright. It core dumps on the > > 1st pass on get_mem(), there is no time to do_reduce. Very weird. ;( > > Because FreeBSD overcommits, malloc() will only fail in case of > artificial limits being reached (like those of login.conf). If FreeBSD > suddenly finds itself in a position of not being able to meet the > previous commitments wrt to memory allocation, it will kill the > application with the largest memory allocations. > > I'll bet you the fifth season of Babylon 5 this is what's happening. :-) Are you willing to bet the 3rd and 4th seasons as well? The 4th season rocks. ;-) > Try limiting the maximum memory allocation to the total physical RAM. The code sets limits appropriatily with RLIMIT_MEMLOCK and RLIMIT_RSS with setrlimit(). Furthermore, I am not using any limits for the user testing the program (a can do it all user :). Besides, a failing malloc should return NULL, shouldn't it? I would have expected core if I had malloc_options="X" which I do not (in fact, I have no malloc_options). Regards, Mario Ferreira ps: Perhaps you could check the code, it is only 11K long. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message