Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Sep 1998 16:34:46 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: vfork and malloc 
Message-ID:  <12755.906302086@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 20 Sep 1998 15:01:06 BST." <Pine.BSF.4.01.9809201458240.28425-100000@herring.nlsystems.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.01.9809201458240.28425-100000@herring.nlsystems.com>, Do
ug Rabson writes:

>Is it safe to call malloc in the child process after a vfork?  I have been
>trying to debug a rare fault in make which goes away when I change the
>vfork() in src/usr.bin/make/compat.c to fork().  After the vfork, it calls
>execvp() which allocates memory via strdup().

It may not be safe to do if the mmap(2)'ed area used for the page table
isn't also shared at that time.

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
"ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12755.906302086>