From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 3 16:37:09 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D1E71065672 for ; Wed, 3 Oct 2012 16:37:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA058FC12 for ; Wed, 3 Oct 2012 16:37:08 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA08079 for ; Wed, 03 Oct 2012 19:37:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <506C69B3.5060104@FreeBSD.org> Date: Wed, 03 Oct 2012 19:37:07 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-hackers X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: kvm_proclist: gnore processes in PRS_NEW X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2012 16:37:09 -0000 I believe that the following patch does the right thing that is repeated in a few other places. I would like to ask for a review just in case. commit cf0f573a1dcbc09cb8fce612530afeeb7f1b1c62 Author: Andriy Gapon Date: Sun Sep 23 22:49:26 2012 +0300 kvm_proc: ignore processes in larvae state diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 8fc415c..d1daf77 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -144,6 +144,8 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p, _kvm_err(kd, kd->program, "can't read proc at %p", p); return (-1); } + if (proc.p_state == PRS_NEW) + continue; if (proc.p_state != PRS_ZOMBIE) { if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), &mtd)) { -- Andriy Gapon