From owner-freebsd-current Tue Nov 14 10:14:02 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id KAA28624 for current-outgoing; Tue, 14 Nov 1995 10:14:02 -0800 Received: from haywire.DIALix.COM (news@haywire.DIALix.COM [192.203.228.65]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id KAA28592 for ; Tue, 14 Nov 1995 10:13:47 -0800 Received: (from news@localhost) by haywire.DIALix.COM (sendmail) id CAA07636 for freebsd-current@freebsd.org; Wed, 15 Nov 1995 02:12:48 +0800 (WST) Received: from GATEWAY by haywire.DIALix.COM with netnews for freebsd-current@freebsd.org (problems to: usenet@haywire.dialix.com) To: freebsd-current@freebsd.org Date: 15 Nov 1995 02:12:40 +0800 From: peter@haywire.dialix.com (Peter Wemm) Message-ID: <48am6o$7eb$1@haywire.DIALix.COM> Organization: DIALix Services, Perth, Australia. References: <199511141423.BAA15830@asstdc.scgt.oz.au> Subject: Re: kern_sysctl.c Sender: owner-current@freebsd.org Precedence: bulk imb@scgt.oz.au (michael butler) writes: >The recent changes to kern_sysctl.c appear to have broken (at least) mountd, >mount_nfs, rwhod and gated. The last two fail on reboot with a warning >message: "gethostname: Cannot allocate memory". gated, mountd and mount_nfs >also core dump into the root directory :-( > michael The following will fix it completely: Index: kern_sysctl.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.49 diff -c -r1.49 kern_sysctl.c *** kern_sysctl.c 1995/11/14 09:42:22 1.49 --- kern_sysctl.c 1995/11/14 15:59:14 *************** *** 293,301 **** --- 293,303 ---- { int error=0; + #if 0 if (arg2) error = SYSCTL_OUT(req, arg1, arg2); else + #endif error = SYSCTL_OUT(req, arg1, strlen((char *)arg1)+1); if (error || !req->newptr || !arg2) Also, beware that mountd's parent (after forking the child into daemon mode) will still core dump after applying this fix. You need to manually kill the mountd child and start it by hand. It'll work from bootup quite happily then. I have not investigated why this is the case, I suspect that mountd is corrupting it's state file when gethostname() is failing, causing it to crash next time, even after the kernel bug is fixed. -Peter