bin/123069: invalid value of 'elapsed' field in ps output if process is swapped out

Vladimir Kozbin wawaka at gmail.com
Fri Apr 25 09:40:02 UTC 2008


>Number:         123069
>Category:       bin
>Synopsis:       invalid value of 'elapsed' field in ps output if process is swapped out
>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 Apr 25 09:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Kozbin
>Release:        7.0-RELEASE
>Organization:
>Environment:
FreeBSD titan.lan 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Mar  2 20:16:34 UTC 2008     root at titan:/usr/obj/usr/src/sys/TITAN  amd64
>Description:
The problem is described here: http://lists.freebsd.org/pipermail/freebsd-stable/2008-April/042154.html
And the explanation is here: http://lists.freebsd.org/pipermail/freebsd-stable/2008-April/042157.html
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- print.c.orig	2007-09-17 09:27:18.000000000 +0400
+++ print.c	2008-04-25 13:11:06.994706727 +0400
@@ -559,6 +559,10 @@ elapsed(KINFO *k, VARENT *ve)
 	char obuff[128];
 
 	v = ve->var;
+	if (!k->ki_valid) {
+		(void)printf("%-*s", v->width, "-");
+		return;
+	}
 	val = now - k->ki_p->ki_start.tv_sec;
 	days = val / (24 * 60 * 60);
 	val %= 24 * 60 * 60;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list