From owner-freebsd-current Sun Dec 31 12:24:34 2000 From owner-freebsd-current@FreeBSD.ORG Sun Dec 31 12:24:32 2000 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from green.dyndns.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 746C237B400; Sun, 31 Dec 2000 12:24:30 -0800 (PST) Received: from localhost (7jkmw6@localhost [127.0.0.1]) by green.dyndns.org (8.11.1/8.11.1) with ESMTP id eBVKOOu12964; Sun, 31 Dec 2000 15:24:27 -0500 (EST) (envelope-from green@FreeBSD.org) Message-Id: <200012312024.eBVKOOu12964@green.dyndns.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: User Sja Cc: freebsd-current@FreeBSD.org, ps@FreeBSD.org Subject: Re: PROCTREE_LOCK() vs. gdb hang In-Reply-To: Message from User Sja of "Sun, 31 Dec 2000 18:55:41 +0200." <3A4F650D.3212A5C5@eqonline.fi> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 31 Dec 2000 15:24:24 -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG User Sja wrote: > I don't really know my way around the kernel so I'm just guessing here: > > Is there a proctree lock release operation missing in kern_sig.c, > function issignal()? There seems to be one lock operation more > than there are release operations. I tried putting one in and > now gdb doesn't hang the whole machine (at least as easily as > before.) I think you've really found the problem! Your analysis and fix seems to be correct, and it wouldn't affect "normal" operations, only those when a process is being traced. I'll test it out right now to make sure it works, and Paul can commit it if he also thinks it is correct. > #kern (sja@tilli) 112> cvs diff -u kern_sig.c > Index: kern_sig.c > =================================================================== > RCS file: /usr/cvs/src/sys/kern/kern_sig.c,v > retrieving revision 1.98 > diff -u -r1.98 kern_sig.c > --- kern_sig.c 2000/12/23 19:43:09 1.98 > +++ kern_sig.c 2000/12/31 16:01:45 > @@ -1311,6 +1311,7 @@ > PROCTREE_LOCK(PT_SHARED); > } while (!trace_req(p) > && p->p_flag & P_TRACED); > + PROCTREE_LOCK(PT_RELEASE); > > /* > * If the traced bit got turned off, go back up > > > ++sja -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message