From owner-freebsd-net@FreeBSD.ORG Thu Sep 27 18:05:54 2007 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 6547516A417; Thu, 27 Sep 2007 18:05:54 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx1.freebsd.org (Postfix) with ESMTP id 92B6C13C4B6; Thu, 27 Sep 2007 18:05:52 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <46FBF101.6080402@FreeBSD.org> Date: Thu, 27 Sep 2007 20:05:53 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Ivan Voras References: <46FBE818.3020800@FreeBSD.org> <9bbcef730709271054k5cbda605wcfd44adede05614f@mail.gmail.com> In-Reply-To: <9bbcef730709271054k5cbda605wcfd44adede05614f@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Panic in rt_check 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: Thu, 27 Sep 2007 18:05:54 -0000 Ivan Voras wrote: > On 27/09/2007, Kris Kennaway wrote: >> Ivan Voras wrote: >>> Hi, >>> >>> I have a machine that panics almost daily in route.c, in rt_check(). >>> This panic has been reported by several users, including Marcel >>> Moolenaar for a machine in freebsd.org. >>> >>> The problem is present in both 6-STABLE and 7-CURRENT, and apparently it >>> manifests on SMP machines, both i386 and AMD64. >>> >>> The panic backtrace looks like this: >>> >>> panic: mtx_lock() of destroyed mutex @ /usr/src/sys/net/route.c:1305 >> I've asked this before of others without getting an answer: is it >> possible that your gateway route is disappearing (e.g. router going >> offline, flaky switch, cable unplugged, etc)? I have seen this panic >> (only) in that situation. > > If there is a way to find this out from the machine itself, I can try > and look it up, otherwise I don't (and cannot) know. The > infrastructure is a bit big but AFAIK it's nothing special. > > Should I just call mtx_initialized() before the line and bail out if > it isn't? OTOH I need a stable patch that will be committed. You will need to evaluate based on other evidence. e.g. if you've noticed other network flakiness on this machine to do with the gateway. If my guess is correct then it's likely to be a race with something else removing the gateway route without locking it, which means that it's not always going to panic and you may notice other effects from it going away. Checking mtx_initialized won't help in that case because the race is still there. You'd need to check the places that can remove it and make sure they are all correctly locking the route first. Kris