From owner-freebsd-current Sat Feb 8 14: 5: 0 2003 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 215E537B401 for ; Sat, 8 Feb 2003 14:04:58 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-67-115-74-80.dsl.lsan03.pacbell.net [67.115.74.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B9CB43F75 for ; Sat, 8 Feb 2003 14:04:57 -0800 (PST) (envelope-from kris@obsecurity.org) Received: from rot13.obsecurity.org (rot13.obsecurity.org [10.0.0.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id 0088A67B88; Sat, 8 Feb 2003 14:04:56 -0800 (PST) Received: by rot13.obsecurity.org (Postfix, from userid 1000) id CF428F63; Sat, 8 Feb 2003 14:04:56 -0800 (PST) Date: Sat, 8 Feb 2003 14:04:56 -0800 From: Kris Kennaway To: Thomas Moestl Cc: Morten Rodal , Kris Kennaway , current@FreeBSD.ORG Subject: Re: Panic in fork() Message-ID: <20030208220456.GB15257@rot13.obsecurity.org> References: <20030208092406.GA12104@rot13.obsecurity.org> <20030208110512.GB12696@rot13.obsecurity.org> <20030208141542.GC11725@slurp.rodal.no> <20030208151226.GB624@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <20030208151226.GB624@crow.dom2ip.de> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 08, 2003 at 04:12:26PM +0100, Thomas Moestl wrote: > addr2line will usually point to the first line of a statement if it > spans multiple lines; in this case, the full guard is: >=20 > while (p2->p_pid =3D=3D trypid || > p2->p_pgrp->pg_id =3D=3D trypid || > p2->p_session->s_sid =3D=3D trypid) { OK, I suspected that. tjr was looking into this last night and proposed the following patch: http://people.freebsd.org/~tjr/kf.diff Kris Index: kern_fork.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /x/freebsd/src/sys/kern/kern_fork.c,v retrieving revision 1.181 diff -u -r1.181 kern_fork.c --- kern_fork.c 1 Feb 2003 12:17:07 -0000 1.181 +++ kern_fork.c 8 Feb 2003 11:32:18 -0000 @@ -318,6 +318,7 @@ * exceed the limit. The variable nprocs is the current number of * processes, maxproc is the limit. */ + sx_slock(&proctree_lock); sx_xlock(&allproc_lock); uid =3D td->td_ucred->cr_ruid; if ((nprocs >=3D maxproc - 10 && uid !=3D 0) || nprocs >=3D maxproc) { @@ -425,6 +426,7 @@ LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); =20 /* * Malloc things while we don't hold any locks. @@ -759,6 +761,7 @@ return (0); fail: sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); uma_zfree(proc_zone, newproc); if (p1->p_flag & P_KSES) { PROC_LOCK(p1); --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+RX8IWry0BWjoQKURAgiCAKCxL7rUGCNP/duXmwjHNUXUGzn4HQCdERUS oAHnk4QKRGxPzVV5Fc0QZP8= =sET8 -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message