Subject: Re: Malloc error output involving pthreads, what does it mean exactly? (on NetBSD 2.0)
To: Vincent <10.50@free.fr>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 03/02/2005 00:27:08
hi,

On Tue, Mar 01, 2005 at 01:18:58PM +0100, Vincent wrote:
> Hi,
> sorry for posting to both lists, I don't know precisely which owes this 
> message.
> 
> When I use gimp2 with a big image (~ 12 million pixels), it crashes 
> always sooner or later with a impossiblity to allocate something like a 
> 12 kB chunk of memory. With the A flag in MALLOC_OPTIONS, I get that:
> 
> gimp in malloc(): error: allocation failed.
> assertion "next != 0" failed: file 
> "/usr/src/lib/libpthread/pthread_run.c", line 130, function "pthread__next"
> 
> Is this a normal behavior when malloc fails to allocate memory, or is it 
> a bug somehow connected with the system pthreads?

it's a bug with pthreads.  more of a design flaw, really.
the libpthread library in -current has a workaround for this
(and other bugfixes too).

I don't think this has been merged back to the 2.0 branch yet,
maybe someone can do that?

otherwise you can try building the -current libpthread code in a
2.0-branch environment, that has some chance of working.

-Chuck