From owner-freebsd-net@FreeBSD.ORG Mon Jan 31 16:52:52 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 E39AA106564A for ; Mon, 31 Jan 2011 16:52:51 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id B0A3E8FC08 for ; Mon, 31 Jan 2011 16:52:51 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0VGqjbg043425 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 31 Jan 2011 08:52:49 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4D46E8E0.2030300@freebsd.org> Date: Mon, 31 Jan 2011 08:52:48 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Bjoern A. Zeeb" 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> <20110131122926.C39951@maildrop.int.zabbadoz.net> In-Reply-To: <20110131122926.C39951@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Eugene Grosbein , 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 16:52:52 -0000 On 1/31/11 4:32 AM, Bjoern A. Zeeb wrote: > 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. slaps head... kassert is at work.... > > >> *** 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" >> >