From owner-freebsd-current@FreeBSD.ORG Wed Jul 5 15:52:55 2006 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 E1DFB16A4DA; Wed, 5 Jul 2006 15:52:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 525CE43D49; Wed, 5 Jul 2006 15:52:54 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k65Fqp2x000393; Wed, 5 Jul 2006 11:52:51 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 5 Jul 2006 11:39:01 -0400 User-Agent: KMail/1.9.1 References: <20060630101132.S14714@godot.imp.ch> In-Reply-To: <20060630101132.S14714@godot.imp.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607051139.02615.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 05 Jul 2006 11:52:52 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1585/Tue Jul 4 16:39:34 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Martin Blapp , mlaier@freebsd.org Subject: Re: Please help reviewing ! Got another crash because of the ttymodem() / ttyclose() race 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: Wed, 05 Jul 2006 15:52:56 -0000 On Friday 30 June 2006 05:09, Martin Blapp wrote: > > Hi all, > > This time its FreeBSD 5.5 RELEASE. Same code is in 6.X (which crashed on a > different server 5 days ago) and CURRENT. > > #25 0xc064f4bd in ttymodem () > #26 0xc06532bd in ptcclose () > #27 0xc05e4e14 in spec_close () > #28 0xc05e3edf in spec_vnoperate () > #29 0xc06815e0 in vn_close () > #30 0xc06825f2 in vn_closefile () > #31 0xc0601ba4 in fdrop_locked () > #32 0xc0601af1 in fdrop () > #33 0xc060015b in closef () > #34 0xc05fd5e5 in close () > #35 0xc07c5e97 in syscall () > > Can PLEASE PLEASE someone help me fix this problem > and review the patch ? > > The patch is based on Max Laiers tty.t_pgrp patch. > > http://mx.imp.ch/patch-tty.t_pgrp.diff > > Especially the part in ttyinfo() needs to be reviewed > carefully. I'm not sure that the proctree_lock should protect t_pgrp as that is part of the tty structure, not process groups or session structures. I think probably it should be protected by Giant for now until the tty subsystem is locked. Also, the ttyinfo() part will not work since it tries to acquire a mutex (PGRP_LOCK()) while holding a spin mutex (sched_lock). -- John Baldwin