From owner-cvs-sbin Wed Dec 13 03:36:26 1995 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA04711 for cvs-sbin-outgoing; Wed, 13 Dec 1995 03:36:26 -0800 (PST) Received: (from peter@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA04702 Wed, 13 Dec 1995 03:36:24 -0800 (PST) Date: Wed, 13 Dec 1995 03:36:24 -0800 (PST) From: Peter Wemm Message-Id: <199512131136.DAA04702@freefall.freebsd.org> To: CVS-committers, cvs-sbin Subject: cvs commit: src/sbin/savecore savecore.c Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk peter 95/12/13 03:36:21 Modified: sbin/savecore savecore.c Log: Add #include in order to make savecore compile again after the last round of include file changes. Revision Changes Path 1.11 +1 -0 src/sbin/savecore/savecore.c From owner-cvs-sbin Fri Dec 15 05:13:38 1995 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id FAA21129 for cvs-sbin-outgoing; Fri, 15 Dec 1995 05:13:38 -0800 (PST) Received: (from peter@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id FAA21119 Fri, 15 Dec 1995 05:13:36 -0800 (PST) Date: Fri, 15 Dec 1995 05:13:36 -0800 (PST) From: Peter Wemm Message-Id: <199512151313.FAA21119@freefall.freebsd.org> To: CVS-committers, cvs-sbin Subject: cvs commit: src/sbin/nfsd nfsd.c Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk peter 95/12/15 05:13:35 Modified: sbin/nfsd nfsd.c Log: The version of setproctitle() inside nfsd was busted. It was not terminating the argv array, causing parts of the argv[0] to be picked up several times by libkvm, causing strange ps results for the nfs-server and nfs-master processes.. :-] (How many copies of setproctitle() do we need anyway? NetBSD has it in libc and BSDI have it in libutil.) Revision Changes Path 1.5 +1 -0 src/sbin/nfsd/nfsd.c From owner-cvs-sbin Fri Dec 15 06:04:36 1995 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA24060 for cvs-sbin-outgoing; Fri, 15 Dec 1995 06:04:36 -0800 (PST) Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA24048 Fri, 15 Dec 1995 06:04:24 -0800 (PST) Received: from corbin.Root.COM (corbin [198.145.90.50]) by Root.COM (8.6.12/8.6.5) with ESMTP id GAA01131; Fri, 15 Dec 1995 06:04:21 -0800 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.12/8.6.5) with SMTP id GAA01840; Fri, 15 Dec 1995 06:04:22 -0800 Message-Id: <199512151404.GAA01840@corbin.Root.COM> To: Peter Wemm cc: CVS-committers@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org Subject: Re: cvs commit: src/sbin/nfsd nfsd.c In-reply-to: Your message of "Fri, 15 Dec 95 05:13:36 PST." <199512151313.FAA21119@freefall.freebsd.org> From: David Greenman Reply-To: davidg@Root.COM Date: Fri, 15 Dec 1995 06:04:22 -0800 Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk >peter 95/12/15 05:13:35 > > Modified: sbin/nfsd nfsd.c > Log: > The version of setproctitle() inside nfsd was busted. It was not terminating > the argv array, causing parts of the argv[0] to be picked up several times > by libkvm, causing strange ps results for the nfs-server and nfs-master > processes.. :-] > > (How many copies of setproctitle() do we need anyway? NetBSD has it in > libc and BSDI have it in libutil.) > > Revision Changes Path > 1.5 +1 -0 src/sbin/nfsd/nfsd.c You realize that it's never really valid to set an argv[x] to NULL, right? It breaks the user environment variables if the process execs (a NULL argv[] pointer is used as the seperation between the args and the environment). Fortunately, 'environ' is initialized at crt0 time, so getenv will continue to work as long as you don't exec. nfsd was expecting the strings for each of argv[*] to be linear in memory. It has code in there to zero out the entire strings area. "LastArg" is the end of the arg strings area. The result of this is that all argv[*] strings each point to a '\0' and thus terminates each of the strings. I don't understand where the garbage comes from. I think the kvm code is bogus and you've just masked the bug with the above change. -DG