Memcached crashing on FreeBSD
mellon at pobox.com
Mon Apr 11 09:50:13 PDT 2005
On Mon, Apr 11, 2005 at 09:37:40AM -0700, Brad Fitzpatrick wrote:
> On Mon, 11 Apr 2005, Anatoly Vorobey wrote:
> > It's normal for memcache to fail to allocate a new slab with
> > malloc(); in this case malloc() should just return an error, but
> > it aborts on your system, probably due to your configuration of
> > /etc/malloc.conf . See malloc(3). You can try running memcached
> > with MALLOC_OPTIONS set to "a"; that should override your
> > /etc/malloc.conf settings if that's the problem.
> Can a program change the a/A flag, essentially telling libc that we can
> handle memory failures gracefully?
Yes, I think that's what the _malloc_options global variable is for;
We could do something like _malloc_options="a"; guarded by #ifdef's
for FreeBSD. It seems like this would solve the problem, although I
don't have a ready access to a FreeBSD box to try it.
[or maybe "ax", seeing as the "X" option also causes malloc to abort
in case allocation fails. Yes, _malloc_options="ax" seems like the
thing to try].
"There's nothing simply good, nor ill alone" -- John Donne
More information about the memcached