From owner-freebsd-current@FreeBSD.ORG Wed Jan 5 21:34:53 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A2C616A4CE for ; Wed, 5 Jan 2005 21:34:53 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF1E943D45 for ; Wed, 5 Jan 2005 21:34:52 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.254.12] (g4.samsco.home [192.168.254.12]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id j05Lbdie019020; Wed, 5 Jan 2005 14:37:39 -0700 (MST) (envelope-from scottl@freebsd.org) Message-ID: <41DC5D70.5030105@freebsd.org> Date: Wed, 05 Jan 2005 14:34:40 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040514 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Maksim Yevmenkin References: <41DB08B9.6090801@savvis.net> <41DB1310.4060807@cronyx.ru> <41DB1700.7060708@savvis.net> <41DB1839.9080104@elischer.org> <41DC4FA2.8070609@savvis.net> <41DC5398.8020508@freebsd.org> <41DC5561.4090005@savvis.net> <41DC5690.3090205@freebsd.org> <41DC598D.50409@savvis.net> <41DC5C5E.9080706@savvis.net> In-Reply-To: <41DC5C5E.9080706@savvis.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: current@freebsd.org cc: Julian Elischer cc: Roman Kurakin Subject: Re: netgraph(4) initialization order X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2005 21:34:53 -0000 Maksim Yevmenkin wrote: > [...] > >>>> how about new attached patch? >>>> >>> >>> Exactly what I had in mind =-) Have you tested this out to make sure >>> it fixes the problem cases? >> >> >> i'm building kernel now, but i'm almost certain it will fix the >> problem. the stack trace i got points to ng_newtype() calling >> ng_findtype() that wants to mtx_lock(ng_typelist_mtx). i'm pretty sure >> the ng_typelist_mtx mutex was not initialized, that is ngb_mod_event() >> was never called. >> >> panic: mtx_lock() of spin mutex (null) @ >> /usr/src/sys/netgraph/ng_base.c:1189 >> >> no mutex name and ng_typelist_mtx is *not* a spin mutex. >> >> ng_ubt(4) calls ng_newtype() from its mod_event handler, so i think >> ng_ubt(4) mod_event handler was called before ngb_mod_event(). > > > built new kernel (with netgraph and ubt compiled in) and rebooted the > box. no crash. so patch works. > > can i commit it? > > thanks, > max Sounds good, thanks for working on this! I don't think that there are any API/ABI implications for RELENG_5 that would prevent this from being merged back, but we might want to think a bit more about it just to be sure. Scott