Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 1997 19:02:06 -0600 (CST)
From:      Alex Nash <nash@Mcs.Net>
To:        julian@whistle.com
Cc:        cbray@best.com, freebsd-hackers@freebsd.org
Subject:   Re: malloc() problems in children after using rfork()
Message-ID:  <Pine.BSF.3.95.971125190051.16643A-100000@Mercury.mcs.net>

next in thread | raw e-mail | index | archive | help
On 25 Nov, Julian Elischer wrote:
>> Unless I'm missing something, even if the fix was brought into -stable
>> it still won't allow multiple rforked(RFMEM|RFPROC) processes to malloc
>> out of a shared data segment (without locking, of course).
> 
> of course you are right, and I'm not sure of the locking state of
> malloc.
> 
> I do belive SOME work was done on it but I don't
> know if it was completed.

malloc uses pthread_mutex_lock/pthread_mutex_unlock in libc_r, but no
locking is performed in libc.

I recall phk talking about making malloc safe from signal handlers
(because some program(s) were invoking malloc in signal handlers), but
deciding against the overhead that would be necessary to do so.

Alex





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.971125190051.16643A-100000>