From owner-freebsd-current@FreeBSD.ORG Sun Aug 7 20:24:47 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F60116A448 for ; Sun, 7 Aug 2005 20:24:47 +0000 (GMT) (envelope-from apelisse@gmail.com) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D6F440E0 for ; Sun, 7 Aug 2005 19:59:14 +0000 (GMT) (envelope-from apelisse@gmail.com) Received: by nproxy.gmail.com with SMTP id x37so189686nfc for ; Sun, 07 Aug 2005 12:59:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=rV1aNRnenH2IgaloViR7f6D3wBu+2WY3GqpkzEWTp2744Rg0oRKXYRvSU/wvCAogc6Ic6auYVirRFpRDu2BXqxZ67VSkXCvXojmmFo90pnjkXYBvap+U/dG6z3yDU1W5yM9wflKFqgTQXegfGr/MX0RvdUNUUVUUn0szj2gKAaw= Received: by 10.48.239.18 with SMTP id m18mr138399nfh; Sun, 07 Aug 2005 12:59:13 -0700 (PDT) Received: by 10.48.239.9 with HTTP; Sun, 7 Aug 2005 12:59:13 -0700 (PDT) Message-ID: <61c7468305080712591f8c7fda@mail.gmail.com> Date: Sun, 7 Aug 2005 21:59:13 +0200 From: Antoine Pelisse To: freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Fix for some stress panics X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2005 20:24:47 -0000 http://people.freebsd.org/~pho/stress/log/cons149.html http://people.freebsd.org/~pho/stress/log/cons130.html I've been working on this panic today (the two are obviously=20 the same) and here is a patch to fix it: --- sys/kern/kern_proc.c.orig Mon Apr 18 04:10:36 2005 +++ sys/kern/kern_proc.c Sun Aug 7 21:18:03 2005 @@ -884,10 +884,8 @@ _PHOLD(p); FOREACH_THREAD_IN_PROC(p, td) { fill_kinfo_thread(td, &kinfo_proc); - PROC_UNLOCK(p); error =3D SYSCTL_OUT(req, (caddr_t)&kinfo_proc, sizeof(kinfo_proc)); - PROC_LOCK(p); if (error) break; } As a matter of fact, if td is removed from the list through thread_unlink= =20 while the mutex is released and the next thread is removed just after, the FOREAC= H=20 is looping through an unlinked list where the td_ksegrp has been set to NUL= L=20 by thread_exit. If we absolutely have to release the lock, then it's probably safer to chec= k=20 if=20 td_ksegroup !=3D NULL in the fill_kinfo_thread function. Regards,=20 Antoine Pelisse.