At 04:16 PM 10/16/2003, Norman Tuttle wrote:
>The conditions of lack of success for apr_socket_create() should include a 
>case where memory wasn't available to allocate for the creation of the APR 
>socket structure, but I did not see evidence of this in either the Win32 or 
>Unix versions of the APR library.

Norman, out of memory conditions either cause a segfault (null pointer deref)
or are handled with an absolute, fatal exception from apr_palloc (there is
an overridable callback for that condition.)

The attitude of the Apache HTTP Server project, and the APR project, is that
on an out-of-memory condition it's impossible to ever safely recover.

> Both functions call a void function alloc_socket() which does the allocation 
> and then immediately sets members of the allocated socket, so they are 
> obviously assuming the allocation occurred. Unfortunately, real software 
> cannot be so sure. I was wondering if (1) the APR provided alternate 
> functions which check for this failure case, and (2) how many APR functions 
> are doing memory checking?

The correct ansswer to (2) should be none.


Reply via email to