From owner-freebsd-current@FreeBSD.ORG Wed Oct 28 06:37:37 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 01BC6106568D for ; Wed, 28 Oct 2009 06:37:37 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 633228FC1D for ; Wed, 28 Oct 2009 06:37:36 +0000 (UTC) Received: from [IPv6:2002:508f:ee96::224:36ff:feef:67d1] (unknown [IPv6:2002:508f:ee96:0:224:36ff:feef:67d1]) by mail-n.franken.de (Postfix) with ESMTP id 6FD0F1C0B4612; Wed, 28 Oct 2009 07:37:32 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Michael Tuexen In-Reply-To: Date: Wed, 28 Oct 2009 07:37:31 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: To: Benjamin Kaduk X-Mailer: Apple Mail (2.1076) X-Mailman-Approved-At: Wed, 28 Oct 2009 11:25:28 +0000 Cc: bzeeb+freebsd+lor@zabbadoz.net, freebsd-current@freebsd.org Subject: Re: lock order reversal on startup (rtentry, ifnet_sx) 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: Wed, 28 Oct 2009 06:37:37 -0000 Hi Ben, does Index: route.c =================================================================== --- route.c (revision 197953) +++ route.c (working copy) @@ -1497,7 +1497,11 @@ ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = rt->rt_ifp->if_index; } + RT_ADDREF(rt); + RT_UNLOCK(rt); rt_newaddrmsg(cmd, ifa, error, rt); + RT_LOCK(rt); + RT_REMREF(rt); if (cmd == RTM_DELETE) { /* * If we are deleting, and we found an entry, fix the issue? Best regards Michael On Oct 28, 2009, at 1:25 AM, Benjamin Kaduk wrote: > Hi all, > > I don't see this explicitly mentioned before, nor on > http://sources.zabbadoz.net/freebsd/lor.html > > It shows up on startup with a -current from two days ago. > Looking at the svn logs, maybe it was introduced with r197328? > > > lock order reversal: (sleepable after non-sleepable) > 1st 0xffffff0002d360a8 rtentry (rtentry) @ /usr/src/sys/net/route.c: > 1474 > 2nd 0xffffffff80e00b00 ifnet_sx (ifnet_sx) @ /usr/src/sys/netinet/ > sctp_bsd_addr.c:212 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x81e > _sx_slock() at _sx_slock+0x55 > sctp_init_ifns_for_vrf() at sctp_init_ifns_for_vrf+0x2e > sctp_addr_change() at sctp_addr_change+0xce > rt_newaddrmsg() at rt_newaddrmsg+0x54 > rtinit() at rtinit+0x358 > in_ifinit() at in_ifinit+0x2fd > in_control() at in_control+0x1047 > ifioctl() at ifioctl+0xfc1 > kern_ioctl() at kern_ioctl+0xc5 > ioctl() at ioctl+0xfd > syscall() at syscall+0x1af > Xfast_syscall() at Xfast_syscall+0xe1 > --- syscall (54, FreeBSD ELF64, ioctl), rip = 0x800b8072c, rsp = > 0x7fffffffe4e8, rbp = 0x7fffffffef6a --- > > > -Ben Kaduk > >