Panic in rt_check

Kris Kennaway kris at FreeBSD.org
Thu Sep 27 11:05:54 PDT 2007


Ivan Voras wrote:
> On 27/09/2007, Kris Kennaway <kris at freebsd.org> 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


More information about the freebsd-net mailing list