From owner-p4-projects Sat Aug 31 13:33: 0 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1CD4F37B401; Sat, 31 Aug 2002 13:32:56 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9169B37B400 for ; Sat, 31 Aug 2002 13:32:55 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E91D343E75 for ; Sat, 31 Aug 2002 13:32:54 -0700 (PDT) (envelope-from mini@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7VKWsJU010968 for ; Sat, 31 Aug 2002 13:32:54 -0700 (PDT) (envelope-from mini@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7VKWspv010965 for perforce@freebsd.org; Sat, 31 Aug 2002 13:32:54 -0700 (PDT) Date: Sat, 31 Aug 2002 13:32:54 -0700 (PDT) Message-Id: <200208312032.g7VKWspv010965@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to mini@freebsd.org using -f From: Jonathan Mini Subject: PERFORCE change 16865 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16865 Change 16865 by mini@mini_stylus on 2002/08/31 13:32:37 Add a test and warning against a proc with no threads. Such a proc should never exist, but it caused 'ps ax' to kernel panic when I did that accidentally. Affected files ... .. //depot/projects/kse/sys/kern/kern_proc.c#79 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_proc.c#79 (text+ko) ==== @@ -825,6 +825,13 @@ } if (p->p_state != PRS_ZOMBIE) { td = FIRST_THREAD_IN_PROC(p); + if (td == NULL) { + /* XXXKSE: This should never happen. */ + printf("fill_kinfo_proc(): pid %d has no threads!\n", + p->p_pid); + mtx_unlock_spin(&sched_lock); + return; + } if (!(p->p_flag & P_KSES)) { if (td->td_wmesg != NULL) { strncpy(kp->ki_wmesg, td->td_wmesg, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message