NetBSD Problem Report #12266

Received: (qmail 6623 invoked from network); 22 Feb 2001 17:35:06 -0000
Message-Id: <200102221735.f1MHZ5A00834@chuq.com>
Date: Thu, 22 Feb 2001 09:35:05 -0800 (PST)
From: Chuck Silvers <chuq@chuq.com>
Reply-To: Chuck Silvers <chuq@chuq.com>
To: gnats-bugs@gnats.netbsd.org
Subject: ps on a dump prints command line from live system
X-Send-Pr-Version: 3.95

>Number:         12266
>Category:       bin
>Synopsis:       ps on a dump prints command line from live system
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 22 17:36:00 +0000 2001
>Closed-Date:    
>Last-Modified:  Sat Nov 14 23:34:29 +0000 2009
>Originator:     Chuck Silvers
>Release:        NetBSD-current Thu Feb 22 09:26:59 PST 200
>Organization:
me
>Environment:
System: NetBSD spathi.chuq.com 1.5R NetBSD 1.5R (SPATHI) #0: Thu Feb 8 10:37:39 PST 2001 chs@spathi.chuq.com:/home/chs/netbsd/src/ubc.spathi/sys/arch/i386/compile/SPATHI i386


>Description:

when running ps on a crash dump, I was surprised to see that one of the
processes in the dump was someone running ps on the crash dump.
a second ps run showed that process as "bash".  another process
in the dump was reported as "/usr/sbin/named (tar)", and that pid
on my machine really was named.  looks like ps is sometimes using
information from the running system when it should only be reading
from the dump.

23 spathi:dump> ps alx -N netbsd.2 -M netbsd.2.core
UID PID      PPID CPU PRI  NI    VSZ RSS WCHAN    STAT TT     TIME COMMAND
  0   0 134702331   0 -18   0      0   0 schedule DKs  ??  0:00.00 (swapper)
  0   1 134702331   0  10   0    320   0 wait     Is   ??  0:00.00 init 
  0   2 134702331   0  10   0      0   0 usbevt   DK   ??  0:00.00 (usb0)
  0   3 134702331   2  10   0      0   0 cardslot DK   ??  0:02.00 (cardslot0)
  0   4 134702331   0  10   0      0   0 apmev    DK   ??  0:00.00 (apm0)
  0   5 134702331   0 -18   0      0   0 pgdaemon DK   ??  0:00.00 (pagedaemon)
  0   6 134702331   0 -18   0      0   0 reaper   DK   ??  0:00.00 (reaper)
  0   7 134702331   0  18   0      0   0 syncer   DK   ??  0:00.00 (ioflush)
  0   8 134702331   0 -18   0      0   0 aiodoned DK   ??  0:00.00 (aiodoned)
  0  23 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  24 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  25 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  26 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0 116 134702331   0   2   0    356   0 -        Rs   ??  0:00.00 (syslogd)
  0 121 134702331   0   2   0    696   0 select   Is   ??  0:00.00 (rpcbind)
  0 126 134702331   0  10   0 100464   0 mfsidl   Is   ??  0:00.00 (mount_mfs)
  0 132 134702331   0   2   0    200   0 select   Is   ??  0:00.00 (mountd)
  0 134 134702331  23   2   0     68   0 netcon   IWs  ??  0:00.00 (nfsd)
  0 137 134702331   0   2   0     48   0 nfsd     IL   ??  0:00.00 (nfsd)
  0 138 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 139 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 140 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 143 134702331   0   2   0    304   0 select   Is   ??  0:00.00 (amd)
  0 163 134702331   0  10  20    220   0 nanoslee INs  ??  0:00.00 (cron)
  0 165 134702331   0  18 -12    664   0 pause    S<s  ??  0:00.00 (ntpd)
  0 167 134702331  16   2   0    116   0 select   IWs  ??  0:00.00 (lpd)
  0 170 134702331   0   2   0     48   0 select   Is   ??  0:00.00 (apmd)
  0 172 134702331   0   2   0     84   0 select   Is   ??  0:00.00 (inetd)
  0 182 134702331  17  18   0    172   0 pause    IWs  ??  0:00.00 (xdm)
  0 187 134702331   0   2   0   9088   0 select   Is   ??  0:00.00 (XFree86)
  0 192 134702331   0   2   0    376   0 select   Is   ??  0:00.00 (xdm)
  0 211 134702331   0   2   0    292   0 -        R    ??  0:00.00 (xconsole)
  0 542 134702331   0   2   0    340   0 select   I    ??  0:00.00 (sshd)
  0 249 134702331   0  10   0    612   0 wait     I    p1- 0:00.00 (bash)
  0 264 134702331   3  10   0    452   0 wait     IW   p1- 0:03.00 (sh)
  0 269 134702331   4   2   0    464   0 netio    I    p1- 0:04.00 /usr/sbin/named (tar)
  0 270 134702331   7  -5   0    484   0 biowait  D    p1- 0:07.00 (tar)
100 544 134702331   0  10   0    624   0 wait     Is   p1  0:00.00 (bash)
  0 572 134702331   0   3   0    612   0 ttyin    I+   p1  0:00.00 ps alx -N netbsd.2 -M netbsd.2.c
  0 188 134702331   0   3   0     48   0 ttyin    Ss+  E0  0:00.00 (getty)
  0 189 134702331  17   3   0     48   0 ttyin    IWs+ E1  0:00.00 (getty)
  0 190 134702331  17   3   0     48   0 ttyin    IWs+ E2  0:00.00 (getty)
  0 191 134702331  17   3   0     48   0 ttyin    IWs+ E3  0:00.00 (getty)
24 spathi:dump> ps -alx -N netbsd.2 -M netbsd.2.core
UID PID      PPID CPU PRI  NI    VSZ RSS WCHAN    STAT TT     TIME COMMAND
  0   0 134702331   0 -18   0      0   0 schedule DKs  ??  0:00.00 (swapper)
  0   1 134702331   0  10   0    320   0 wait     Is   ??  0:00.00 init 
  0   2 134702331   0  10   0      0   0 usbevt   DK   ??  0:00.00 (usb0)
  0   3 134702331   2  10   0      0   0 cardslot DK   ??  0:02.00 (cardslot0)
  0   4 134702331   0  10   0      0   0 apmev    DK   ??  0:00.00 (apm0)
  0   5 134702331   0 -18   0      0   0 pgdaemon DK   ??  0:00.00 (pagedaemon)
  0   6 134702331   0 -18   0      0   0 reaper   DK   ??  0:00.00 (reaper)
  0   7 134702331   0  18   0      0   0 syncer   DK   ??  0:00.00 (ioflush)
  0   8 134702331   0 -18   0      0   0 aiodoned DK   ??  0:00.00 (aiodoned)
  0  23 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  24 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  25 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0  26 134702331   0  10   0      0   0 nfsidl   IK   ??  0:00.00 (nfsio)
  0 116 134702331   0   2   0    356   0 -        Rs   ??  0:00.00 (syslogd)
  0 121 134702331   0   2   0    696   0 select   Is   ??  0:00.00 (rpcbind)
  0 126 134702331   0  10   0 100464   0 mfsidl   Is   ??  0:00.00 (mount_mfs)
  0 132 134702331   0   2   0    200   0 select   Is   ??  0:00.00 (mountd)
  0 134 134702331  23   2   0     68   0 netcon   IWs  ??  0:00.00 (nfsd)
  0 137 134702331   0   2   0     48   0 nfsd     IL   ??  0:00.00 (nfsd)
  0 138 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 139 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 140 134702331  23   2   0     48   0 nfsd     IL   ??  0:23.00 (nfsd)
  0 143 134702331   0   2   0    304   0 select   Is   ??  0:00.00 (amd)
  0 163 134702331   0  10  20    220   0 nanoslee INs  ??  0:00.00 (cron)
  0 165 134702331   0  18 -12    664   0 pause    S<s  ??  0:00.00 (ntpd)
  0 167 134702331  16   2   0    116   0 select   IWs  ??  0:00.00 (lpd)
  0 170 134702331   0   2   0     48   0 select   Is   ??  0:00.00 (apmd)
  0 172 134702331   0   2   0     84   0 select   Is   ??  0:00.00 (inetd)
  0 182 134702331  17  18   0    172   0 pause    IWs  ??  0:00.00 (xdm)
  0 187 134702331   0   2   0   9088   0 select   Is   ??  0:00.00 (XFree86)
  0 192 134702331   0   2   0    376   0 select   Is   ??  0:00.00 (xdm)
  0 211 134702331   0   2   0    292   0 -        R    ??  0:00.00 (xconsole)
  0 542 134702331   0   2   0    340   0 select   I    ??  0:00.00 (sshd)
  0 249 134702331   0  10   0    612   0 wait     I    p1- 0:00.00 (bash)
  0 264 134702331   3  10   0    452   0 wait     IW   p1- 0:03.00 (sh)
  0 269 134702331   4   2   0    464   0 netio    I    p1- 0:04.00 /usr/sbin/named (tar)
  0 270 134702331   7  -5   0    484   0 biowait  D    p1- 0:07.00 (tar)
100 544 134702331   0  10   0    624   0 wait     Is   p1  0:00.00 (bash)
  0 572 134702331   0   3   0    612   0 ttyin    I+   p1  0:00.00 (bash)
  0 188 134702331   0   3   0     48   0 ttyin    Ss+  E0  0:00.00 (getty)
  0 189 134702331  17   3   0     48   0 ttyin    IWs+ E1  0:00.00 (getty)
  0 190 134702331  17   3   0     48   0 ttyin    IWs+ E2  0:00.00 (getty)
  0 191 134702331  17   3   0     48   0 ttyin    IWs+ E3  0:00.00 (getty)

427 spathi:~> ps ax | grep 269
  269 ?? IWs      0:00.00 /usr/sbin/named 




>How-To-Repeat:
	presumably, run ps on a crashdump where some of the pids in the dump
	also exist in the running system.

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: elad@netbsd.org
State-Changed-When: Sat, 23 Sep 2006 18:34:57 +0000
State-Changed-Why:
can you try to reproduce this on -current? 


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 14 Nov 2009 23:34:29 +0000
State-Changed-Why:
problem still exists in HEAD.

ps calls kvm_getargv2() to get argv strings, and in libkvm that goes straight
to sysctl() with no attempt to read from the dump.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.