From owner-freebsd-current@FreeBSD.ORG Sun May 17 12:16:41 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDF541065694; Sun, 17 May 2009 12:16:41 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121]) by mx1.freebsd.org (Postfix) with ESMTP id 851858FC12; Sun, 17 May 2009 12:16:41 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121] (may be forged)) (authenticated bits=0) by sakura.ninth-nine.com (8.14.3/8.14.3/NinthNine) with ESMTP id n4HCGZeh004492; Sun, 17 May 2009 21:16:40 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 17 May 2009 21:16:35 +0900 From: Norikatsu Shigemura To: freebsd-current@FreeBSD.org Message-Id: <20090517211635.216b23ae.nork@FreeBSD.org> In-Reply-To: <20090517200019.275f6c71.nork@FreeBSD.org> References: <20090517200019.275f6c71.nork@FreeBSD.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Norikatsu Shigemura Subject: Re: panic after dhclient in sys/net/if.c mtx_lock X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 17 May 2009 12:16:42 -0000 Hi. On Sun, 17 May 2009 20:00:19 +0900 Norikatsu Shigemura wrote: > ta_context = 0x0}, if_addr_mtx = {lock_object = {lo_name = 0x0, lo_flags = 0, > lo_data = 0, lo_witness = 0x0}, mtx_lock = 0}, if_clones = {le_next = 0x0, In this time, if_addr_mtx doesn't initilized. According to /usr/src/sys/netinet/in.c:921 (UP#14), ifp = &info, So I read: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* * add a loopback route to self */ if (!(ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { bzero(&info, sizeof(info)); info.rti_ifp = V_loif; info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = (struct sockaddr *)&ia->ia_addr; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - info.rti_ifp == V_loif (=vnet_net_0._loif), but different: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (kgdb) p info.rti_ifp $16 = (struct ifnet *) 0xffffff00050caa00 (kgdb) p vnet_net_0._loif $17 = (struct ifnet *) 0xffffff0005172000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Of cource, V_loif->if_addr_mtx is initialized. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (kgdb) p vnet_net_0._loif->if_addr_mtx $18 = {lock_object = {lo_name = 0xffffffff80576ca1 "if_addr_mtx", lo_flags = 16973824, lo_data = 0, lo_witness = 0x0}, mtx_lock = 4} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Hum.....