httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Fear <>
Subject Re: memory questions about subpools
Date Sun, 14 Jul 1996 21:31:09 GMT

Howard Fear
>> new_block(0) in turn calls malloc_block.  malloc_block can return NULL if
>> no space is available.  Since address is dereferenced, this produces a
>> sigsegv, right?

Robert S. Thau writes:
> Yep.  This is an error check I somehow forgot to insert ages ago.
> (NB the failure has come back to haunt me since).  Please feel free
> to submit a patch.

I took a look through this and I don't think its easily patchable
new_block is called at too low a level to determine the correct way of
logging an error, so its best strategy is to just return null.  However,
the functions that call new block, make_sub_pool and palloc, also don't
check for null.  make_sub_pool is limited in its use, so its relatively
easy to add checks, log appropriately, and exit.  palloc, however, is
called all over the place.  Its return value is also never checked as
far as I can tell.

Overall, I suspect the only way to add this is to have palloc just
exit.  But I'm not qualified to guess what the impacts of this would
be  although, it couldn't be worse than the sigsegv's that must surely
happen now.

If logging (if possible) is desired, then other major changes would have
to be made.  Either everyone calling palloc would have to be modified to
check its return value, or pools would have to be linked to their servers
to get at the log files when open.

The bottom line is that I'll wait for advice and/or encouragement before
I do anything with this.

Howard Fear      email1:

View raw message