apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <...@apache.org>
Subject Re: apr_hash_set allocation failure behavior
Date Wed, 17 Mar 2010 22:47:20 GMT

On 17 Mar 2010, at 22:18, Ivan Novick wrote:

> Hello,
> I am doing some testing with APR version 1.2.12
> When adding to a hash table using apr_hash_set ... If memory can not be
> allocated what is the expected behavior?
> I am seeing apr_hash_set calls expand_array.
> expand_array core dumps if memory can not be allocated.
> Is this expected?  Is there a way to get an error code for a failed insert
> to a table rather than a coredump?

There's a kind-of half-excuse for that.  Namely, if you're out of memory,
you're already in so much trouble segfault is neither here nor there.

But of course it's bad.  It might be helpful if you could provide a backtrace
of exactly what fails.  And the answer to your question is unfortunately no.

Nick Kew

View raw message