From owner-freebsd-bugs Fri Jun 9 8:10: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id EDB5537C001 for ; Fri, 9 Jun 2000 08:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA18696; Fri, 9 Jun 2000 08:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 061C237C3E1; Fri, 9 Jun 2000 08:04:19 -0700 (PDT) Message-Id: <20000609150419.061C237C3E1@hub.freebsd.org> Date: Fri, 9 Jun 2000 08:04:19 -0700 (PDT) From: billh@europe.yahoo-inc.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/19145: ps not annotatable in 4.0 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19145 >Category: bin >Synopsis: ps not annotatable in 4.0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 09 08:10:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Bill Hails >Release: 4.0 >Organization: Yahoo! Europe >Environment: FreeBSD pagegen7.europe.yahoo.com 4.0-YAHOO-20000510 FreeBSD 4.0-YAHOO-20000510 #0: Thu May 11 00:39:30 PDT 2000 root@fb40.yahoo.com:/home/src/sys/compile/YAHOO i386 >Description: the kvm_getargv function returns the original argv passed to the process, ignoring any changes that the process may have made to ARGV, in conflict with the manual page. >How-To-Repeat: create this C program, call it getargv.c, and compile with cc -O -pipe getargv.c -lkvm -o getargv #include #include #include #include #include #include int main(int argc, char *argv[]) { kvm_t *kd; kd = kvm_open(NULL, "/dev/mem", NULL, O_RDONLY, "kvm_open:"); if (kd != NULL) { int cnt; struct kinfo_proc *p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &cnt); if (p != NULL) { int c; for (c = 0; c < cnt; ++c) { char **res = kvm_getargv(kd, p, 0); if (res) { while (*res) { printf("%s ", *res); res++; } printf("\n"); } else break; ++p; } } else { return(2); } kvm_close(kd); } else { return(1); } return(0); } then compile and run the following (call it argv0.c, "make argv0") int main(int argc, char *argv[]) { argv[0] = "test"; sleep(500); return(0); } in another window run the already compiled getargv as root. When I do this I see that the argv0 process has not had its ARGV[0] changed >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message