httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch>
Subject Re: svn commit: r1172686 - in /httpd/httpd/trunk: ./ include/ modules/cache/ modules/examples/ modules/proxy/ modules/ssl/ server/ server/mpm/event/ server/mpm/worker/
Date Mon, 19 Sep 2011 18:20:18 GMT
On Monday 19 September 2011, Roy T. Fielding wrote:
> I am pretty sure that this kind of change has been vetoed numerous
> times in the past.  What has changed?

Probably nothing, except maybe the involved people. But I couldn't 
find any discussion about this (just about handling oom in APR, which 
is unrelated).

The reasons for this change are stated in the commit message. Either 
we add logging/handling code to every call of malloc and friends, or 
we make a wrapper. Just continuing is usually wrong. Even such 
seemingly innocuous things as not adding an entry to a cache in an out 
of mem situation can cause much time to be wasted for debugging. We 
had that with the LDAP cache in the past.

Besides, aborting with an error message is exactly what we do if an 
allocation from a pool fails (via the pool abort function). So why 
handle malloc differently?

> ....Roy
> On Sep 19, 2011, at 9:25 AM, wrote:
> > Author: sf
> > Date: Mon Sep 19 16:25:42 2011
> > New Revision: 1172686
> > 
> > URL:
> > Log:
> > Add wrappers for malloc, calloc, realloc that check for out of
> > memory situations.  Use them in most places where malloc, and
> > friends are used. This results in clean error messages in an out
> > of memory situation instead of segfaulting or silently
> > malfunctioning. In some places, it just allows to remove some
> > logging code.
> > 
> > PR 51568, PR 51569, PR 51571.

View raw message