Memcached crashing on FreeBSD

Jason Coene jcoene at gotfrag.com
Mon Apr 11 11:15:11 PDT 2005


Woops, I knew that I was going to fumble that one somehow!

The file /etc/malloc.conf does not exist on my system.  If I'm reading the
man page correctly it's not actually a file with contents, but a symbolic
link referencing the values.  Such as what would be produced by:

ln -s 'ax' /etc/malloc.conf

I was trying the direct assignment inside a .h file before, it works fine
when added to main().  Compiler doesn't recognize FREEBSD, it does like
__FreeBSD__.  I added the following just above the settings_init call in
main():

#ifdef __FreeBSD__
    _malloc_options = "ax";
#endif

I have recompiled and have this running.

Jason

> -----Original Message-----
> From: Anatoly Vorobey [mailto:mellon at pobox.com]
> Sent: Monday, April 11, 2005 2:02 PM
> To: Jason Coene
> Cc: memcached at lists.danga.com
> Subject: Re: Memcached crashing on FreeBSD
> 
> You wrote on Mon, Apr 11, 2005 at 01:53:13PM -0400:
> > Interesting stuff... As for the malloc options, I'm running the
> defaults.  I
> > suspect nearly every other FreeBSD user is as well.  I wasn't aware of
> the
> > FreeBSD default behavior, or the option to change it.  It does sound
> like
> > this might be a good thing for configure to look for - I'm surprised
> nobody
> > has run in to it yet.
> 
> What precisely is the contents of your /etc/malloc.conf (if you have
> it)?
> 
> It could be something else, a bug in malloc() perhaps, although that
> seems a remote possibility at the moment.
> 
> > In FreeBSD, _malloc_options is defined in /usr/include/stdlib.h as:
> >
> > extern const char *_malloc_options;
> >
> > I've added the following and re-compiled.  My #define picks up locally,
> but
> > my C is rusty and it's been too long for me to know whether or not the
> > library will get it.
> 
> No, that won't work. The library's already compiled to inspect its
> variable, it doesn't care about your #define's.
> 
> > A direct assignment of _malloc_options="ax"; won't compile.
> 
> It should. Can you give us the compiler output, perhaps?
> 
> See a random example program which assigns to _malloc_options here:
> http://www.mail-archive.com/freebsd-current@freebsd.org/msg27420.html
> 
> --
> avva
> "There's nothing simply good, nor ill alone" -- John Donne




More information about the memcached mailing list