From owner-freebsd-current Mon May 7 14:19:37 2001 Delivered-To: freebsd-current@freebsd.org Received: from newsguy.com (perry.pathlink.com [209.155.233.33]) by hub.freebsd.org (Postfix) with ESMTP id DF3C137B443 for ; Mon, 7 May 2001 14:19:32 -0700 (PDT) (envelope-from dcs@newsguy.com) Received: from newsguy.com (ppp070-bsace7001.telebrasilia.net.br [200.181.80.70]) by newsguy.com (8.11.0/8.9.1) with ESMTP id f47LIUD76030; Mon, 7 May 2001 14:18:30 -0700 (PDT) Message-ID: <3AF71124.607292BB@newsguy.com> Date: Mon, 07 May 2001 18:18:28 -0300 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en,pt-BR,pt,en-GB,en-US,ja MIME-Version: 1.0 To: Dag-Erling Smorgrav Cc: Dennis Glatting , Kris Kennaway , freebsd-stable@frebsd.org, freebsd-current@FreeBSD.ORG Subject: Re: pgm to kill 4.3 via vm References: <20010507074503.Y24943-100000@btw.plaintalk.bellevue.wa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dag-Erling Smorgrav wrote: > > Dennis Glatting writes: > > I am intentionally testing at the limits to see what happens, usually > > interesting things. :) In this case, the application is well behaved (in > > the error proccesing sense): it'll exit, thus releasing its memory > > resources, when the kernel reports a memory allocation failure. > > No. > > malloc() will return NULL only if you hit a resource limit or exhaust > address space. There may or may not be memory (real or virtual) > available at that time. > > Plus, your program doesn't even do what you think it does (because a) > it has at least one significant bug and b) malloc() doesn't behave the > way you think it does). And even if it did, the /dev/random stuff is > pointless, you can achieve the same effect by setting every byte you > allocate (possibly even just the first byte of every chunk) to 0. > > To really test what you think your program tests, you should mmap() an > amount of memory larger than RAM + swap and touch every page. Even > then, the result will be a SIGSEGV, not a graceful termination. Regardless, the machine should recover once all (trouble) programs have been killed. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.secret.bsdconspiracy.net Caffeine is proof that God hates mornings too To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message