From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 20:13:57 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 002E116A415; Fri, 22 Sep 2006 20:13:56 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5001143D70; Fri, 22 Sep 2006 20:13:40 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (5f1ynl036ywb5em0@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k8MKDb7N018193; Fri, 22 Sep 2006 13:13:37 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k8MKDbwt018192; Fri, 22 Sep 2006 13:13:37 -0700 (PDT) (envelope-from jmg) Date: Fri, 22 Sep 2006 13:13:37 -0700 From: John-Mark Gurney To: John Baldwin Message-ID: <20060922201336.GT23915@funkthat.com> Mail-Followup-To: John Baldwin , freebsd-threads@freebsd.org, anders@freebsd.org References: <200609202105.k8KL5fh7081141@freefall.freebsd.org> <200609212152.31366.john@baldwin.cx> <20060922023748.GR23915@funkthat.com> <200609221425.02723.john@baldwin.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200609221425.02723.john@baldwin.cx> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: anders@freebsd.org, freebsd-threads@freebsd.org Subject: Re: kern/103127: Kernel panic while using thread features in Squid 2.6 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 20:13:57 -0000 John Baldwin wrote this message on Fri, Sep 22, 2006 at 14:25 -0400: > On Thursday 21 September 2006 22:37, John-Mark Gurney wrote: > > John Baldwin wrote this message on Thu, Sep 21, 2006 at 21:52 -0400: > > > On Wednesday 20 September 2006 17:05, John-Mark Gurney wrote: > > > > Synopsis: Kernel panic while using thread features in Squid 2.6 > > > > > > > > State-Changed-From-To: open->feedback > > > > State-Changed-By: jmg > > > > State-Changed-When: Wed Sep 20 21:04:55 UTC 2006 > > > > State-Changed-Why: > > > > waiting for people to test the patch of badfo_kqfilter that is attached > > > > to the bug.. > > > > > > Should it possibly return EBADF rather than EINVAL? > > > > If we got this far, we have to have a valid fd, maybe ENXIO? > > badfo_* are used for bad (invalid) file descriptors. :) All the other badfo_* > functions return EBADF (except for poll, since it returns an event mask > rather than an errno). except we did have a valid fd since we did an fget on the descriptor, and that would fail if it was bad: if ((fp = fget_locked(fdp, fd)) == NULL || fp->f_ops == &badfileops) { FILEDESC_UNLOCK(fdp); return (EBADF); } or can f_ops change in the middle? >From my reading it looks like it can can during a close, but if the application is doing a simultanious close and attaching a knote, that's a race condition, and we techincally still have a valid fd till was can't fget the fd anymore... just MO of course... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."