On Sat, Jun 28, 2008 at 03:37:36PM -0600, Philip Guenther wrote:

> On Sat, Jun 28, 2008 at 3:06 PM, Mark B. <[EMAIL PROTECTED]> wrote:
> > What is the default value for MALLOC_OPTIONS?
> >
> > /usr/src/lib/libc/stdlib/malloc.c says NULL, which is suprising, given
> > that OpenBSD will alert me to memory issues for programs that
> > run fine on another BSD.
> 
> All the options default to off, with the partial exception of the a/A
> option: the default behavior is not quite the same as either 'a' or
> 'A'.
> 
> (By default, it'll complain and abort if the internal structures get
> corrupted, you make a recursive call, or you pass it particularly
> bogus pointers.  'a' disables all those, while 'A' makes it also
> complain and die if allocation would fail.   It's probably those
> default checks that are triggering the alerts you referred to.)
> 
> 
> > Also, what options do folks use when they want to really test things out?
> 
> I use this:
> 
> $ ls -l /etc/malloc.conf
> lrwxr-xr-x  1 root  wheel  4 May 23 21:49 /etc/malloc.conf -> FGJP
> $
> 
> If a program I don't have the time to debug has problems with that
> then I set MALLOC_OPTIONS=fgjp (or whatever is sufficient) for just
> that program.
> 
> 
> Philip Guenther

Yes, those are a preyy good pick, but note that they have a cost.

If you are interested, you can run my new malloc (on current only),
which (amongst other things) is faster and detects a few more cases of
wrong usage by default. 

http://www.drijf.net/openbsd/malloc/

        -Otto

Reply via email to