From owner-freebsd-net@FreeBSD.ORG Mon Jan 31 12:35:08 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B79106566C; Mon, 31 Jan 2011 12:35:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 83DEA8FC1A; Mon, 31 Jan 2011 12:35:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 88D4B41C705; Mon, 31 Jan 2011 13:35:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id l3Um-DzJWLjd; Mon, 31 Jan 2011 13:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AAD6641C710; Mon, 31 Jan 2011 13:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 97B084448F3; Mon, 31 Jan 2011 12:32:15 +0000 (UTC) Date: Mon, 31 Jan 2011 12:32:15 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Eugene Grosbein In-Reply-To: <4D4685A0.6040400@rdtc.ru> Message-ID: <20110131122926.C39951@maildrop.int.zabbadoz.net> References: <4D3011DB.9050900@frasunek.com> <4D30458D.30007@sentex.net> <4D309983.70709@rdtc.ru> <201101141437.55421.jhb@freebsd.org> <4D46575A.802@rdtc.ru> <4D4670C2.4050500@freebsd.org> <4D4685A0.6040400@rdtc.ru> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, Mike Tancsa Subject: Re: panic: bufwrite: buffer is not busy??? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 12:35:08 -0000 On Mon, 31 Jan 2011, Eugene Grosbein wrote: > On 31.01.2011 14:20, Julian Elischer wrote: > >>> # gdb kernel >>> GNU gdb 6.1.1 [FreeBSD] >>> Copyright 2004 Free Software Foundation, Inc. >>> GDB is free software, covered by the GNU General Public License, and you are >>> welcome to change it and/or distribute copies of it under certain conditions. >>> Type "show copying" to see the conditions. >>> There is absolutely no warranty for GDB. Type "show warranty" for details. >>> This GDB was configured as "amd64-marcel-freebsd"... >>> (gdb) l *0xffffffff803c1315 >>> 0xffffffff803c1315 is in ng_address_hook (/home/src/sys/netgraph/ng_base.c:3504). >>> 3499 * Quick sanity check.. >>> 3500 * Since a hook holds a reference on it's node, once we know >>> 3501 * that the peer is still connected (even if invalid,) we know >>> 3502 * that the peer node is present, though maybe invalid. >>> 3503 */ >>> 3504 if ((hook == NULL) || >>> 3505 NG_HOOK_NOT_VALID(hook) || >>> 3506 NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) || >>> 3507 NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) { >>> 3508 NG_FREE_ITEM(item); >> >> >> replace with: which is essentially what I had suggested in the formerly mentioned PR already (just remove the first printf macro). >> 3504 if ((hook == NULL) || >> 3505 NG_HOOK_NOT_VALID(hook) || >> ((peer = NG_HOOK_PEER(hook)) == NULL) || >> 3506 NG_HOOK_NOT_VALID(peer) || >> ((peernode = NG_PEER_NODE(hook)) == NULL) || >> 3507 NG_NODE_NOT_VALID(peernode)) { >> if (peer) >> kassert((peernode != NULL), ("peer node NULL wile peer hook exists")); >> 3508 NG_FREE_ITEM(item); >> The problem is that it will not help to fix the race; if you go up in the same file you'll find another similar one of these checks with a scary rev 1.1. (I think) comment (that you, Julian, should know very well;-) The solution that this needs is: proper locking. > It does not compile: > > /home/src/sys/netgraph/ng_base.c: In function 'ng_address_hook': > /home/src/sys/netgraph/ng_base.c:3511: warning: implicit declaration of function 'kassert' > /home/src/sys/netgraph/ng_base.c:3511: warning: nested extern declaration of 'kassert' yeah KASSERT is upper case. > *** Error code 1 > 1 error > *** Error code 2 > 1 error > *** Error code 2 > 1 error > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html