From owner-freebsd-current Sun Sep 20 07:39:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA03148 for freebsd-current-outgoing; Sun, 20 Sep 1998 07:39:44 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA03143 for ; Sun, 20 Sep 1998 07:39:40 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.1/8.8.5) with ESMTP id QAA12757; Sun, 20 Sep 1998 16:34:46 +0200 (CEST) To: Doug Rabson cc: current@FreeBSD.ORG Subject: Re: vfork and malloc In-reply-to: Your message of "Sun, 20 Sep 1998 15:01:06 BST." Date: Sun, 20 Sep 1998 16:34:46 +0200 Message-ID: <12755.906302086@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , 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