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

On 2009-10-16 at 13:42:25 [+0800], Alexander Botero-Lowry 
<alex.boterolowry@xxxxxxxxx> wrote:
> > a call to a wrapper around open() followed by fdopen() on the fd to get a 
> > FIL
> > E
> > stream. This works for about 6 of the charset files, and then after that 
> > the
> > call
> > to fdopen renders a very scary traceback deep in the bowels of malloc.
> 
> I did some more poking around by commenting out various bits of elisp code.
> If i comment out the define-charset call that causes this traceback, i get
> one define-charset call further. It seems in whatever combination I comment
> them out, I can do 6 define-charset/fdopen()s before the segfault.
> 
> I also commented out that entire file from the bootstrap process, and got
> further, but ended up also getitng a segfault (though I _think_ it may be
> as result of missing symbols it expects from mule-conf.el).
> 
> So my working theory is that haiku gets upset if you do > 6 fdopens() in
> quick succession.

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.

CU, Ingo

Other related posts: