Re: Consistent crash of BeagleBone kernel

From: Tim Kientzle <tim_at_kientzle.com>
Date: Mon, 10 Aug 2015 21:33:11 -0700
> On Aug 10, 2015, at 12:39 AM, Konstantin Belousov <kostikbel_at_gmail.com> wrote:
> 
> On Sun, Aug 09, 2015 at 05:24:13PM -0700, Tim Kientzle wrote:
>> 
>>> On Aug 9, 2015, at 11:10 AM, Konstantin Belousov <kostikbel_at_gmail.com> wrote:
>>> 
>>> On Sun, Aug 09, 2015 at 10:53:20AM -0700, Tim Kientzle wrote:
>>>> 
>>>> I suspect the LOR is new.
>>>> 
>>>> It looks like the panic is occurring when WITNESS tries to print the backtrace for the LOR.  I???m not familiar with that code; does it use the kernel linker?
>>>> 
>>> 
>>> It indeed locks the linker lock to resolve symbols. So it seems to be
>>> even more useful to make the linker lock recursive locally, then you
>>> should be able to see the backtrace for LOR.
>> 
>> Changing the kld_sx lock to recursive, I now see a backtrace for the ufs/kernel linker LOR.  Full trace pasted below.
>> 
>> This is displayed just before the network interfaces; I suspect it???s being triggered when my startup initializes the urtwn wireless adapter (which does indeed load a number of kernel modules).
>> 
>> lock order reversal:
>> 1st 0xc083ef40 kernel linker (kernel linker) _at_ /Users/tim/projects/crochet/src-head/sys/kern/kern_linker.c:1030
>> 2nd 0xc2d63c94 ufs (ufs) _at_ /Users/tim/projects/crochet/src-head/sys/kern/vfs_lookup.c:529
> The order, for which witness complained, is in fact the right order.
> The linker_load_module() function calls LINKER_LOAD_FILE() with the
> kld_sx locked, and linker itself locks module vnode.
> 
> So there was something in your system which exposed the reversed order
> vnode->kld_sx before the action.  To catch it, keep the modification to
> mark kld_sx as recursive, but also add an item to the order_lists in
> the sys/kern/subr_witness.c like this:
> 	{"kernel linker", &lock_class_sx},
> 	{"ufs", &lock_class_lockmgr},
> 	{NULL, NULL}
> and watch were would it fire.

I’ll do this when I get back to that system next week.

I have a guess, though:  I noticed that the old bufwait/dirhash LOR is being triggered before this.  Could the backtrace from that be teaching Witness a bogus ufs -> kld ordering?

Tim
Received on Tue Aug 11 2015 - 02:33:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:59 UTC