From owner-freebsd-hackers Fri Nov 21 13:22:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id NAA13505 for hackers-outgoing; Fri, 21 Nov 1997 13:22:07 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from Kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id NAA13489 for ; Fri, 21 Nov 1997 13:22:04 -0800 (PST) (envelope-from nash@Jupiter.Mcs.Net) Received: from Jupiter.Mcs.Net (nash@Jupiter.mcs.net [192.160.127.88]) by Kitten.mcs.com (8.8.5/8.8.2) with ESMTP id PAA06064; Fri, 21 Nov 1997 15:22:02 -0600 (CST) Received: from localhost (nash@localhost) by Jupiter.Mcs.Net (8.8.7/8.8.2) with SMTP id PAA09561; Fri, 21 Nov 1997 15:22:01 -0600 (CST) Date: Fri, 21 Nov 1997 15:22:01 -0600 (CST) From: Alex Nash To: Curtis Bray cc: freebsd-hackers@freebsd.org Subject: Re: malloc() problems in children after using rfork() In-Reply-To: <3475E143.EE7AF250@best.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 21 Nov 1997, Curtis Bray wrote: > Hi, > > I'm trying to use rfork(RFPROC | RFMEM) so that all the children can > share the same address space with their parent. > > If I have multiple children issuing mallocs the children seem to core > dump. Once I turn the RFMEM flag off I have no problem mallocing (but > of course I loose the shared address space). Anyone know what I could > be doing wrong here? Do I have to put semaphores around every malloc?? > I hope that's not the case... Thanks in advance! The only locking malloc() performs is pthread_mutex_lock/unlock in the libc_r version. The non-threaded version provides no locking at all. Alex