From owner-freebsd-threads@FreeBSD.ORG Wed Sep 13 18:58:36 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 9612316A416; Wed, 13 Sep 2006 18:58:36 +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 0E66643D98; Wed, 13 Sep 2006 18:58:05 +0000 (GMT) (envelope-from anders@fupp.net) Received: from localhost (totem.fix.no [80.91.36.20]) by fupp.net (Postfix) with ESMTP id E264D8D9896; Wed, 13 Sep 2006 20:58:03 +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 81684-01-6; Wed, 13 Sep 2006 20:58:03 +0200 (CEST) Received: by fupp.net (Postfix, from userid 1000) id 68A958D9874; Wed, 13 Sep 2006 20:58:03 +0200 (CEST) Date: Wed, 13 Sep 2006 20:58:03 +0200 From: Anders Nordby To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org Message-ID: <20060913185803.GA27955@totem.fix.no> References: <20060911075431.D12758D9874@fupp.net> <200609110800.k8B80ie3041853@freefall.freebsd.org> <20060912195547.GA71462@totem.fix.no> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <20060912195547.GA71462@totem.fix.no> 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: Thomas-Martin Seck , Suleiman Souhlal 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: Wed, 13 Sep 2006 18:58:36 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, 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 Then Squid stops responding to new requests, and I can not even kill it with kill -9: root@cache3:~# pgrep -l squid 547 squid root@cache3:~# kill -9 547 root@cache3:~# pgrep -l squid 547 squid Have to reboot to get the system working again, but it seems now it doesn't panic. Regards, -- Anders. --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="kqueue-debug.patch" --- sys/kern/kern_event.c.orig Wed Sep 13 08:44:57 2006 +++ sys/kern/kern_event.c Wed Sep 13 08:51:03 2006 @@ -900,6 +900,8 @@ goto done; } KN_LIST_LOCK(kn); + if (kn->kn_fop->f_event == NULL) + printf("NULL f_event in new kn\n"); } else { /* * The user may change some filter values after the @@ -912,6 +914,8 @@ kn->kn_sfflags = kev->fflags; kn->kn_sdata = kev->data; kn->kn_kevent.udata = kev->udata; + if (kn->kn_fop->f_event == NULL) + printf("NULL f_event in existing kn\n"); } /* @@ -921,6 +925,12 @@ * is called on a zombie process. It will call filt_proc * which will remove it from the list, and NULL kn_knlist. */ + if (kn->kn_fop->f_event == NULL) { + printf("f_event == NULL\n"); + KN_LIST_UNLOCK(kn); + error = EAGAIN; + goto done; + } event = kn->kn_fop->f_event(kn, 0); KQ_LOCK(kq); if (event) --LZvS9be/3tNcYl/X--