From owner-freebsd-current Wed Dec 10 15:40:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA04045 for current-outgoing; Wed, 10 Dec 1997 15:40:15 -0800 (PST) (envelope-from owner-freebsd-current) Received: from shell5.ba.best.com (cbray@shell5.ba.best.com [206.184.139.136]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA04040 for ; Wed, 10 Dec 1997 15:40:10 -0800 (PST) (envelope-from cbray@shell5.ba.best.com) Received: from localhost (cbray@localhost) by shell5.ba.best.com (8.8.8/8.8.BEST) with SMTP id PAA23485 for ; Wed, 10 Dec 1997 15:40:09 -0800 (PST) Date: Wed, 10 Dec 1997 15:40:09 -0800 (PST) From: Curtis Bray To: freebsd-current@FreeBSD.ORG Subject: FreeBSD 3.0-current(12/10): rfork() problems in USERLAND? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hey Folks, I'm curious if anyone else if seeing this behavior with rfork... I've cvsup'ed to the latest code as of 12/10 and I'm still having difficulties with rfork(RFPROC | RFMEM) out in userland. From past discussions my understanding was John Dyson had added the RFMEM support into current as part of the kernel thread support for the AIO stuff, but I'm unclear if the user process support has been finished. Anyway, here's a dump of the program I'm running (very very basic) and the output that occurs. The core file was truncated when I tried to look at it with gdb. -------- #include #include #include #include #include #include #include #include void child_proc(int procNum, int time) { printf("Child %d is exiting\n", procNum); exit(0); } void main(int argc, char *argv[]) { int numProc = 1; int procNum = 0; int time = 2; int ret, status; int numReturned = 0; if(argc > 1) numProc = atoi(argv[1]); if(argc > 2) time = atoi(argv[2]); printf("Going to create %d rfork() process\n", numProc); for(procNum = 0; procNum < numProc; procNum++) { if((ret = rfork(RFPROC | RFMEM)) == 0) { printf("Inside child from fork: %d\n", procNum); child_proc(procNum, time); } else printf("Parent forked %d (ret = %d)\n", procNum, ret); } printf("Parent waiting for children.\n"); while((ret = wait(&status)) != -1) { printf("Parent woke up on wait for %d with status %d (#%d)\n", ret, status, numReturned++); printf("%d : Signaled? %d / %d\n", ret, WIFSIGNALED(status), WTERMSIG(status)); } } ----------- program output: Going to create 1 rfork() process Parent forked 0 (ret = 444) Parent waiting for children. Parent woke up on wait for 0 with status 4231 (#0) 0 : Signaled? 1 / 7 Bus error (core dumped) ---------- Any ideas? Thanks in advance! Curtis