[haiku-development] Re: weird segfault in malloc internals when trying to call fdopen()

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 18 Oct 2009 14:06:13 +0200

> > Unless you can reproduce that in a simple test, I'd consider it 
> > more likely
> > that something else corrupts the heap (e.g. by overwriting memory) 
> > and that
> > fdopen() is just an innocent bystander becoming the victim.
> Do we have a debugging memory allocator?

We do. There's malloc_debug in src/system/libroot/posix which can be 
enabled by switching over the malloc to the malloc_debug directory in 
the Jamfile and rebuilding libroot. That's it for now, it will be 
gradually more integrated and probably made available as a runtime 
setting, so you can enable and configure it dynamically. It can also do 
leak checking and does initialize and overwrite freed memory with known 
values to make access to these more obvious.


Other related posts: