From owner-freebsd-threads@FreeBSD.ORG Mon Sep 18 08:33:49 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 5687516A416; Mon, 18 Sep 2006 08:33:49 +0000 (UTC) (envelope-from anders@fupp.net) Received: from fupp.net (totem.fix.no [80.91.36.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7B9443D64; Mon, 18 Sep 2006 08:33:45 +0000 (GMT) (envelope-from anders@fupp.net) Received: from localhost (totem.fix.no [80.91.36.20]) by fupp.net (Postfix) with ESMTP id B45FF8D98A3; Mon, 18 Sep 2006 10:33:43 +0200 (CEST) Received: from fupp.net ([80.91.36.20]) by localhost (totem.fix.no [80.91.36.20]) (amavisd-new, port 10024) with LMTP id 39230-01-6; Mon, 18 Sep 2006 10:33:43 +0200 (CEST) Received: by fupp.net (Postfix, from userid 1000) id 564A78D989D; Mon, 18 Sep 2006 10:33:43 +0200 (CEST) Date: Mon, 18 Sep 2006 10:33:43 +0200 From: Anders Nordby To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal , John-Mark Gurney Message-ID: <20060918083343.GA38761@totem.fix.no> References: <20060911075431.D12758D9874@fupp.net> <200609110800.k8B80ie3041853@freefall.freebsd.org> <20060912195547.GA71462@totem.fix.no> <20060913185803.GA27955@totem.fix.no> <20060916205044.GF9421@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060916205044.GF9421@funkthat.com> X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 User-Agent: Mutt/1.5.11 Cc: jhb@FreeBSD.org Subject: Re: threads/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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2006 08:33:49 -0000 Hi, On Sat, Sep 16, 2006 at 01:50:44PM -0700, John-Mark Gurney wrote: >> After talking with Pawel, I tried the attached patch to get some kqueue >> debug info. I just got it: >> >> Sep 13 20:18:56 cache3 kernel: NULL f_event in new kn >> Sep 13 20:18:56 cache3 kernel: f_event == NULL > > This means that the f_attach method for that event isn't setting f_event > properly... We need to figure out which event this is happening w/... > > Try the following modifications: >> (..) > > + if (kn->kn_fop->f_event == NULL) > { > > + printf("NULL f_event in new kn\n"); This modification was already done with the patch from Pawel, check the audit-trail of this PR. By using that patch, I got the messages "NULL f_event in new kn" and "f_event == NULL". Cheers, -- Anders. From owner-freebsd-threads@FreeBSD.ORG Mon Sep 18 08:40:27 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69A1816A403 for ; Mon, 18 Sep 2006 08:40:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBD4743D5D for ; Mon, 18 Sep 2006 08:40:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8I8ePFd027110 for ; Mon, 18 Sep 2006 08:40:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8I8ePue027109; Mon, 18 Sep 2006 08:40:25 GMT (envelope-from gnats) Date: Mon, 18 Sep 2006 08:40:25 GMT Message-Id: <200609180840.k8I8ePue027109@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Anders Nordby Cc: Subject: Re: threads/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: Anders Nordby List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2006 08:40:27 -0000 The following reply was made to PR kern/103127; it has been noted by GNATS. From: Anders Nordby To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal , John-Mark Gurney Cc: jhb@FreeBSD.org Subject: Re: threads/103127: Kernel panic while using thread features in Squid 2.6 Date: Mon, 18 Sep 2006 10:33:43 +0200 Hi, On Sat, Sep 16, 2006 at 01:50:44PM -0700, John-Mark Gurney wrote: >> After talking with Pawel, I tried the attached patch to get some kqueue >> debug info. I just got it: >> >> Sep 13 20:18:56 cache3 kernel: NULL f_event in new kn >> Sep 13 20:18:56 cache3 kernel: f_event == NULL > > This means that the f_attach method for that event isn't setting f_event > properly... We need to figure out which event this is happening w/... > > Try the following modifications: >> (..) > > + if (kn->kn_fop->f_event == NULL) > { > > + printf("NULL f_event in new kn\n"); This modification was already done with the patch from Pawel, check the audit-trail of this PR. By using that patch, I got the messages "NULL f_event in new kn" and "f_event == NULL". Cheers, -- Anders. From owner-freebsd-threads@FreeBSD.ORG Mon Sep 18 11:08:32 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 4963416A494 for ; Mon, 18 Sep 2006 11:08:32 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A21C43D46 for ; Mon, 18 Sep 2006 11:08:31 +0000 (GMT) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8IB8UWM041138 for ; Mon, 18 Sep 2006 11:08:30 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8IB8TCr041134 for freebsd-threads@FreeBSD.org; Mon, 18 Sep 2006 11:08:29 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 18 Sep 2006 11:08:29 GMT Message-Id: <200609181108.k8IB8TCr041134@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2006 11:08:32 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for (-lc_r & -lthr) 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/20016 threads pthreads: Cannot set scheduling timer/Cannot set virtu s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread dont dequeue signals s threa/34536 threads accept() blocks other threads o kern/38549 threads the procces compiled whith pthread stopped in pthread_ s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r s kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOC o threa/70975 threads unexpected and unreliable behaviour when using SYSV se o threa/72353 threads Assertion fails in /usr/src/lib/libpthread/sys/lock.c, o threa/72429 threads threads blocked in stdio (fgets, etc) are not cancella o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/85160 threads [libthr] [patch] libobjc + libpthread/libthr crash pro o threa/90278 threads libthr, ULE and -current produces >100% WCPU with apac o kern/91266 threads [threads] Trying sleep, but thread marked as sleeping s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc f threa/98256 threads gnome-system-monitor core dumps from pthread_testcance s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/101355 threads threaded application spents too much time in _umtx_op o kern/103127 threads Kernel panic while using thread features in Squid 2.6 30 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s kern/19247 threads uthread_sigaction.c does not do anything wrt SA_NOCLDW s kern/22190 threads A threaded read(2) from a socketpair(2) fd can sometim s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/74180 threads KSE problem. Applications those riched maximum possibl o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/81534 threads [libc_r] [patch] libc_r close() will fail on any fd ty 10 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Sep 18 16:27:49 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 750E816A416; Mon, 18 Sep 2006 16:27:49 +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 7A5EA43D7D; Mon, 18 Sep 2006 16:27:39 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (y2aq51y0a9u19qfz@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k8IGRc0E010590; Mon, 18 Sep 2006 09:27:38 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k8IGRbP4010589; Mon, 18 Sep 2006 09:27:37 -0700 (PDT) (envelope-from jmg) Date: Mon, 18 Sep 2006 09:27:36 -0700 From: John-Mark Gurney To: Anders Nordby Message-ID: <20060918162736.GL9421@funkthat.com> Mail-Followup-To: Anders Nordby , FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal , jhb@FreeBSD.org References: <20060911075431.D12758D9874@fupp.net> <200609110800.k8B80ie3041853@freefall.freebsd.org> <20060912195547.GA71462@totem.fix.no> <20060913185803.GA27955@totem.fix.no> <20060916205044.GF9421@funkthat.com> <20060918083343.GA38761@totem.fix.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060918083343.GA38761@totem.fix.no> 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: Suleiman Souhlal , FreeBSD-gnats-submit@FreeBSD.org, Thomas-Martin Seck , jhb@FreeBSD.org, freebsd-threads@FreeBSD.org Subject: Re: threads/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: Mon, 18 Sep 2006 16:27:49 -0000 Anders Nordby wrote this message on Mon, Sep 18, 2006 at 10:33 +0200: > Hi, > > On Sat, Sep 16, 2006 at 01:50:44PM -0700, John-Mark Gurney wrote: > >> After talking with Pawel, I tried the attached patch to get some kqueue > >> debug info. I just got it: > >> > >> Sep 13 20:18:56 cache3 kernel: NULL f_event in new kn > >> Sep 13 20:18:56 cache3 kernel: f_event == NULL > > > > This means that the f_attach method for that event isn't setting f_event > > properly... We need to figure out which event this is happening w/... > > > > Try the following modifications: > >> (..) > > > + if (kn->kn_fop->f_event == NULL) > > { ^^^ > > > + printf("NULL f_event in new kn\n"); > > This modification was already done with the patch from Pawel, check the > audit-trail of this PR. By using that patch, I got the messages "NULL > f_event in new kn" and "f_event == NULL". You missed my modifications to the patch... They were done in addition to his patch, and as I said in that email, they should fix the problem, it's not an information gathering exercise... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-threads@FreeBSD.ORG Mon Sep 18 16:30:35 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2793716A521 for ; Mon, 18 Sep 2006 16:30:35 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DDFD43D78 for ; Mon, 18 Sep 2006 16:30:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8IGUWoR075310 for ; Mon, 18 Sep 2006 16:30:32 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8IGUWNF075309; Mon, 18 Sep 2006 16:30:32 GMT (envelope-from gnats) Date: Mon, 18 Sep 2006 16:30:32 GMT Message-Id: <200609181630.k8IGUWNF075309@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: John-Mark Gurney Cc: Subject: Re: threads/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: Mon, 18 Sep 2006 16:30:35 -0000 The following reply was made to PR kern/103127; it has been noted by GNATS. From: John-Mark Gurney To: Anders Nordby Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal , jhb@FreeBSD.org Subject: Re: threads/103127: Kernel panic while using thread features in Squid 2.6 Date: Mon, 18 Sep 2006 09:27:36 -0700 Anders Nordby wrote this message on Mon, Sep 18, 2006 at 10:33 +0200: > Hi, > > On Sat, Sep 16, 2006 at 01:50:44PM -0700, John-Mark Gurney wrote: > >> After talking with Pawel, I tried the attached patch to get some kqueue > >> debug info. I just got it: > >> > >> Sep 13 20:18:56 cache3 kernel: NULL f_event in new kn > >> Sep 13 20:18:56 cache3 kernel: f_event == NULL > > > > This means that the f_attach method for that event isn't setting f_event > > properly... We need to figure out which event this is happening w/... > > > > Try the following modifications: > >> (..) > > > + if (kn->kn_fop->f_event == NULL) > > { ^^^ > > > + printf("NULL f_event in new kn\n"); > > This modification was already done with the patch from Pawel, check the > audit-trail of this PR. By using that patch, I got the messages "NULL > f_event in new kn" and "f_event == NULL". You missed my modifications to the patch... They were done in addition to his patch, and as I said in that email, they should fix the problem, it's not an information gathering exercise... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-threads@FreeBSD.ORG Wed Sep 20 21:05:41 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0BC316A412; Wed, 20 Sep 2006 21:05:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF23043D6A; Wed, 20 Sep 2006 21:05:41 +0000 (GMT) (envelope-from jmg@FreeBSD.org) Received: from freefall.freebsd.org (jmg@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8KL5fD6081145; Wed, 20 Sep 2006 21:05:41 GMT (envelope-from jmg@freefall.freebsd.org) Received: (from jmg@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8KL5fh7081141; Wed, 20 Sep 2006 21:05:41 GMT (envelope-from jmg) Date: Wed, 20 Sep 2006 21:05:41 GMT From: John-Mark Gurney Message-Id: <200609202105.k8KL5fh7081141@freefall.freebsd.org> To: anders@FreeBSD.org, jmg@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: 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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 21:05:42 -0000 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.. http://www.freebsd.org/cgi/query-pr.cgi?pr=103127 From owner-freebsd-threads@FreeBSD.ORG Wed Sep 20 21:14:22 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 39D0516A47B for ; Wed, 20 Sep 2006 21:14:22 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9479843D53 for ; Wed, 20 Sep 2006 21:14:20 +0000 (GMT) (envelope-from pawel.worach@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so49931uge for ; Wed, 20 Sep 2006 14:14:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=U0Ys77DJhulCcBRAfgL+AFdgIUUKSRKIpq57ALxaan65VAuZJw7ZYb/p3I80fO/NChvJS84ZnWJzEZlfyor+HSL2A72yzSjjzskHa6To+IS386yVMmNRf9BxadkkEuWBHpEnvS1MTnCPOVNP5aib02xG48VV7VAUXRgVR/oQ948= Received: by 10.67.101.8 with SMTP id d8mr8524962ugm; Wed, 20 Sep 2006 14:14:19 -0700 (PDT) Received: from ?192.168.1.200? ( [80.217.194.157]) by mx.gmail.com with ESMTP id q1sm291623uge.2006.09.20.14.14.17; Wed, 20 Sep 2006 14:14:18 -0700 (PDT) Message-ID: <4511AF26.4060701@gmail.com> Date: Wed, 20 Sep 2006 23:14:14 +0200 From: Pawel Worach User-Agent: Thunderbird 1.5.0.7 (X11/20060916) MIME-Version: 1.0 To: John-Mark Gurney References: <200609202105.k8KL5fh7081141@freefall.freebsd.org> In-Reply-To: <200609202105.k8KL5fh7081141@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 21:14:22 -0000 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.. > I've been running with it since you posted it, the panics went away (can't be 100% certain on this since it was pretty random) and no new ill effects observed. -- Pawel From owner-freebsd-threads@FreeBSD.ORG Thu Sep 21 07:24:13 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 E984D16A407; Thu, 21 Sep 2006 07:24:13 +0000 (UTC) (envelope-from anders@fupp.net) Received: from fupp.net (totem.fix.no [80.91.36.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7711543D46; Thu, 21 Sep 2006 07:24:11 +0000 (GMT) (envelope-from anders@fupp.net) Received: from localhost (totem.fix.no [80.91.36.20]) by fupp.net (Postfix) with ESMTP id A67978D98A1; Thu, 21 Sep 2006 09:24:09 +0200 (CEST) Received: from fupp.net ([80.91.36.20]) by localhost (totem.fix.no [80.91.36.20]) (amavisd-new, port 10024) with LMTP id 53839-01-6; Thu, 21 Sep 2006 09:24:09 +0200 (CEST) Received: by fupp.net (Postfix, from userid 1000) id 53FF48D989E; Thu, 21 Sep 2006 09:24:09 +0200 (CEST) Date: Thu, 21 Sep 2006 09:24:09 +0200 From: Anders Nordby To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal Message-ID: <20060921072409.GA53487@totem.fix.no> References: <20060911075431.D12758D9874@fupp.net> <200609110800.k8B80ie3041853@freefall.freebsd.org> <20060912195547.GA71462@totem.fix.no> <20060913185803.GA27955@totem.fix.no> <20060916205908.GG9421@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060916205908.GG9421@funkthat.com> X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 User-Agent: Mutt/1.5.11 Cc: Subject: Re: threads/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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2006 07:24:14 -0000 Hi, On Sat, Sep 16, 2006 at 01:59:08PM -0700, John-Mark Gurney wrote: > Please try the attached patch.. It appears that the badfo_kqfilter was > returning sucess instead of error since it was introcuded many years > ago... This many still cause other problems w/ squid, but will fix > the panics... > --- kern_descrip.c 21 Jul 2006 20:24:00 -0000 1.297 > +++ kern_descrip.c 16 Sep 2006 20:58:40 -0000 > @@ -2632,7 +2632,7 @@ > badfo_kqfilter(struct file *fp, struct knote *kn) > { > > - return (0); > + return (EINVAL); > } > > static int This patch fixes the kernel panics that I have reported about in this PR. I have 9 cache servers with Squid2.6 that had this problem. After patching them, one by one, they haven't had any panics anymore. Cheers, -- Anders. From owner-freebsd-threads@FreeBSD.ORG Thu Sep 21 07:30:37 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA07816A407 for ; Thu, 21 Sep 2006 07:30:37 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6178A43D6A for ; Thu, 21 Sep 2006 07:30:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8L7UPdg037245 for ; Thu, 21 Sep 2006 07:30:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8L7UPoY037244; Thu, 21 Sep 2006 07:30:25 GMT (envelope-from gnats) Date: Thu, 21 Sep 2006 07:30:25 GMT Message-Id: <200609210730.k8L7UPoY037244@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Anders Nordby Cc: Subject: Re: threads/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: Anders Nordby List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2006 07:30:37 -0000 The following reply was made to PR kern/103127; it has been noted by GNATS. From: Anders Nordby To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org, Thomas-Martin Seck , Suleiman Souhlal Cc: Subject: Re: threads/103127: Kernel panic while using thread features in Squid 2.6 Date: Thu, 21 Sep 2006 09:24:09 +0200 Hi, On Sat, Sep 16, 2006 at 01:59:08PM -0700, John-Mark Gurney wrote: > Please try the attached patch.. It appears that the badfo_kqfilter was > returning sucess instead of error since it was introcuded many years > ago... This many still cause other problems w/ squid, but will fix > the panics... > --- kern_descrip.c 21 Jul 2006 20:24:00 -0000 1.297 > +++ kern_descrip.c 16 Sep 2006 20:58:40 -0000 > @@ -2632,7 +2632,7 @@ > badfo_kqfilter(struct file *fp, struct knote *kn) > { > > - return (0); > + return (EINVAL); > } > > static int This patch fixes the kernel panics that I have reported about in this PR. I have 9 cache servers with Squid2.6 that had this problem. After patching them, one by one, they haven't had any panics anymore. Cheers, -- Anders. From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 01:52:37 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 647EE16A5B5; Fri, 22 Sep 2006 01:52:37 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 101E243D4C; Fri, 22 Sep 2006 01:52:33 +0000 (GMT) (envelope-from john@baldwin.cx) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8M1qWZH009092; Thu, 21 Sep 2006 21:52:32 -0400 (EDT) (envelope-from john@baldwin.cx) From: John Baldwin To: freebsd-threads@freebsd.org Date: Thu, 21 Sep 2006 21:52:30 -0400 User-Agent: KMail/1.9.1 References: <200609202105.k8KL5fh7081141@freefall.freebsd.org> In-Reply-To: <200609202105.k8KL5fh7081141@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609212152.31366.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Thu, 21 Sep 2006 21:52:32 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1922/Thu Sep 21 19:05:55 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-104.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, USER_IN_WHITELIST autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: John-Mark Gurney , anders@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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 01:52:37 -0000 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? -- John Baldwin From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 02:37:52 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 AF13816A403; Fri, 22 Sep 2006 02:37:52 +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 554A843D5C; Fri, 22 Sep 2006 02:37:52 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (1izb531z51vwrb39@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k8M2bnLX099047; Thu, 21 Sep 2006 19:37:49 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k8M2bmnx099046; Thu, 21 Sep 2006 19:37:48 -0700 (PDT) (envelope-from jmg) Date: Thu, 21 Sep 2006 19:37:48 -0700 From: John-Mark Gurney To: John Baldwin Message-ID: <20060922023748.GR23915@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200609212152.31366.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 02:37:52 -0000 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? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 18:25:16 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 322B616A4D8; Fri, 22 Sep 2006 18:25:16 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 303A743D68; Fri, 22 Sep 2006 18:24:59 +0000 (GMT) (envelope-from john@baldwin.cx) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8MIOuGk015171; Fri, 22 Sep 2006 14:24:56 -0400 (EDT) (envelope-from john@baldwin.cx) From: John Baldwin To: freebsd-threads@freebsd.org, John-Mark Gurney Date: Fri, 22 Sep 2006 14:25:02 -0400 User-Agent: KMail/1.9.1 References: <200609202105.k8KL5fh7081141@freefall.freebsd.org> <200609212152.31366.john@baldwin.cx> <20060922023748.GR23915@funkthat.com> In-Reply-To: <20060922023748.GR23915@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609221425.02723.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 22 Sep 2006 14:24:57 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1927/Fri Sep 22 06:06:31 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: anders@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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 18:25:16 -0000 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). -- John Baldwin From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 18:47:17 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 3EBFD16A403 for ; Fri, 22 Sep 2006 18:47:17 +0000 (UTC) (envelope-from belindat@us.ibm.com) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B13043D49 for ; Fri, 22 Sep 2006 18:47:16 +0000 (GMT) (envelope-from belindat@us.ibm.com) Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id k8MIlFWM005686 for ; Fri, 22 Sep 2006 14:47:15 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k8MIlFQf186998 for ; Fri, 22 Sep 2006 14:47:15 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k8MIlFpL011830 for ; Fri, 22 Sep 2006 14:47:15 -0400 Received: from thompsonb (wecm-9-67-127-164.wecm.ibm.com [9.67.127.164]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with SMTP id k8MIlDGe011765; Fri, 22 Sep 2006 14:47:15 -0400 MIME-Version: 1.0 Message-Id: <45142FAA.000003.01864@THOMPSONB> Date: Fri, 22 Sep 2006 14:47:06 -0400 (Eastern Daylight Time) X-Mailer: IncrediMail (5002253) From: "Belinda Thompson" X-FID: FLAVOR00-NONE-0000-0000-000000000000 X-Priority: 3 To: Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: pthread_cond_signal hang possible X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Belinda Thompson List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 18:47:17 -0000 Kernel: 2.6.5-7.244=0D glibc 2.3.2=0D =0D I am looking at an intermittent problem that appears to be pthread_cond_signal not returning. =0D =0D The mutex in question is only shared between two threads, one a read and = one a write thread for each "connection". =0D The mutex is protecting a queue that is filled by the RxThread...and drained by the TxThread.=0D =0D It looks like thread7 is unable to get the mutex back after being awakene= d from the pthread_cond_wait because thread8 is still holding it. =0D And..thread8 never returns from pthread_cond_signal to release the mutex.= =0D =0D Could thread8 have been preempted by thread7 preventing it from returning from the system call to wake the thread?=0D =0D Any ideas would be appreciated.=0D =0D The flow is simple and as follows:=0D =0D Thread7:=0D pthread_mutex_lock(mutex);=0D pthread_cond_wait(condition);=0D pthread_mutex_unlock(mutex)=0D =0D Thread8:=0D pthread_mutex_lock(mutex);=0D pthread_cond_signal(condition);=0D pthread_mutex_unlock(mutex);=0D =0D =0D The gdb output is as follows:=0D =0D [Switching to thread 7 (process 19955)]=0D #0 0x41ee8124 in __lll_lock_wait () from /lib/tls/libpthread.so.0=0D #1 0x41ee56fe in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0=0D #2 0x41df89da in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so= =2E6=0D #3 0x00405daa in TxThread ()=0D #4 0x41ee2a8c in start_thread () from /lib/tls/libpthread.so.0=0D #5 0x41dec714 in thread_start () from /lib/tls/libc.so.6=0D =0D [Switching to thread 8 (process 19954)]=0D #0 0x41ee5c54 in pthread_cond_signal@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0=0D #1 0x41df8992 in pthread_cond_signal@@GLIBC_2.3.2 () from /lib/tls/libc.= so 6=0D #2 0x00407514 in TransmitPacket ()=0D #3 0x0040f3b8 in QueueTx ()=0D #4 0x0040d51c in Transmit ()=0D #5 0x0041237c in msg_handler ()=0D #6 0x004083d6 in newmail()=0D #7 0x00402e8a in put_message ()=0D #8 0x00404138 in PutMail ()=0D #9 0x004084a0 in send_msg()=0D #10 0x004067c0 in RxThread ()=0D #11 0x41ee2a8c in start_thread () from /lib/tls/libpthread.so.0=0D #12 0x41dec714 in thread_start () from /lib/tls/libc.so.6 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." From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 20:44:13 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E8BB16A412; Fri, 22 Sep 2006 20:44:13 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E09D743D70; Fri, 22 Sep 2006 20:44:12 +0000 (GMT) (envelope-from jmg@FreeBSD.org) Received: from freefall.freebsd.org (jmg@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8MKiCDP030408; Fri, 22 Sep 2006 20:44:12 GMT (envelope-from jmg@freefall.freebsd.org) Received: (from jmg@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8MKiCSM030404; Fri, 22 Sep 2006 20:44:12 GMT (envelope-from jmg) Date: Fri, 22 Sep 2006 20:44:12 GMT From: John-Mark Gurney Message-Id: <200609222044.k8MKiCSM030404@freefall.freebsd.org> To: jmg@FreeBSD.org, freebsd-threads@FreeBSD.org, jmg@FreeBSD.org Cc: 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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 20:44:13 -0000 Synopsis: Kernel panic while using thread features in Squid 2.6 Responsible-Changed-From-To: freebsd-threads->jmg Responsible-Changed-By: jmg Responsible-Changed-When: Fri Sep 22 20:43:26 UTC 2006 Responsible-Changed-Why: I have a patch for this, which once we decide the correct return value will be committed... http://www.freebsd.org/cgi/query-pr.cgi?pr=103127 From owner-freebsd-threads@FreeBSD.ORG Fri Sep 22 21:39:42 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 DC5D616A403; Fri, 22 Sep 2006 21:39:42 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BAEC43D58; Fri, 22 Sep 2006 21:39:41 +0000 (GMT) (envelope-from john@baldwin.cx) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8MLdYe6016440; Fri, 22 Sep 2006 17:39:37 -0400 (EDT) (envelope-from john@baldwin.cx) From: John Baldwin To: freebsd-threads@freebsd.org, John-Mark Gurney Date: Fri, 22 Sep 2006 17:39:32 -0400 User-Agent: KMail/1.9.1 References: <200609202105.k8KL5fh7081141@freefall.freebsd.org> <200609221425.02723.john@baldwin.cx> <20060922201336.GT23915@funkthat.com> In-Reply-To: <20060922201336.GT23915@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609221739.33091.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 22 Sep 2006 17:39:39 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1927/Fri Sep 22 06:06:31 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: anders@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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 21:39:42 -0000 On Friday 22 September 2006 16:13, John-Mark Gurney wrote: > 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... No, not really. We did an fget() and have a valid file pointer, but the file was closed in between fget() and using of the file. Once the file is closed, it's bad, and EBADF is the appropriate way to smack the userland app upside the head for its bug. -- John Baldwin