Memcached crashing on FreeBSD

Anatoly Vorobey mellon at pobox.com
Mon Apr 11 11:29:59 PDT 2005


On Mon, Apr 11, 2005 at 02:15:11PM -0400, Jason Coene wrote:
> 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

Oh, hmm, you're right. I didn't notice that.

That's... incredibly... perverted, isn't it?

I guess it's an optimization. Saves you a disk read (more like a file 
system cache lookup) in case the file does exit (*goes away shaking his 
head*).

> 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

MALLOC_OPTIONS is probably better as Jacob Coby notes in another 
message. It'll have the benefit of working on Open/Net BSDs provided
they interpret the letters in the same way.

[after checking: no, it won't; NetBSD and OpenBSD understand the 
letters similarly, but they have malloc_options, 
not _malloc_options. Hooray for diversity!]

> I have recompiled and have this running.

Good luck! 

-- 
avva
"There's nothing simply good, nor ill alone" -- John Donne



More information about the memcached mailing list