Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 26945 invoked by uid 6000); 24 Nov 1999 13:01:23 -0000 Received: (qmail 26933 invoked from network); 24 Nov 1999 13:01:13 -0000 Received: from silk.apana.org.au (root@202.12.87.81) by taz.hyperreal.org with SMTP; 24 Nov 1999 13:01:13 -0000 Received: from kheldar.apana.org.au (bjh@kheldar.apana.org.au [202.12.87.82]) by silk.apana.org.au (8.9.1/8.9.1) with SMTP id AAA07143 for ; Thu, 25 Nov 1999 00:00:42 +1100 Message-Id: <199911241300.AAA07143@silk.apana.org.au> From: "Brian Havard" To: "new-httpd@apache.org" Date: Thu, 25 Nov 1999 00:00:38 +1000 (EST) X-Mailer: PMMail 2.10.1999 for OS/2 Warp 4.00 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: cvs commit: apache-2.0/src/lib/apr/lib apr_execve.c apr_pools.c apr_tables.c Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org On Wed, 24 Nov 1999 04:45:44 -0800 (PST), Greg Stein wrote: >By "talking Apache here", I meant "Apache-using-APR". In that condition, >everything ever written for Apache assumes that a memory allocation will >SUCCEED. So, in light of Apache... yes, we should be killing the process >if we can't get the memory. > >I also maintain that we must at least attempt to log the error somewhere, >rather than silently die. [...] >And I say no. The current model of "alloc and you'll get it" means that >Apache can be very fast. It doesn't have to worry about not getting >memory. > >If you *do* have to worry about it, then you start putting checks on every >darn function call. You ever see what that looks like? Go look at some COM >code in Windows. You have one line of work, three lines of error handling. >It is absolutely horrible. Further, the time to check a result, when it is >typically successful is just wasted time. Lastly, people will just start >getting lazy and not putting in checks. Then you end up with a case where >a NULL pointer gets hit at some arbitrary point in the code, a long ways >away from the (failed) allocation. Tracking that back is a bitch. How about using something like the C++ method where you can register an out of memory handler function (set_new_handler())? That way Apache can register a handler that does the log & abort step without forcing all APR using apps to have the same behaviour. -- ______________________________________________________________________________ | Brian Havard | "He is not the messiah! | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian | ------------------------------------------------------------------------------