From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: erik quanstrom Date: Wed, 17 Sep 2008 09:07:18 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] panic Topicbox-Message-UUID: 11962fba-ead4-11e9-9d60-3106f5b1d025 > hi, > i got the following panic in a kernel I compiled today: > > panic: D2B called on non-block f0d72af8 (double-free?) > panic: D2B called on non-block f0d72af8 (double-free?) > dumpstack disabled > cpu0: exiting > > it happen evertime i plug a usb device in. i don't know how > to debug this. any suggestions? > with my old kernel(2008-04-30) everthing works fine. it's very difficult to say without access to a) the stack dump and b) the kernel in question. this is because it's hard to find this sort of problem without knowing where the problem occurred. the stack dump will provide addresses and the kernel image will be enough to tie addresses to particular bits of code. as an unrelated aside, this reference counting updates uninitialized memory. /n/sources/plan9/sys/src/9/pc/usbohci.c:1454,1455 if(dirin == Dirout && bp) _xinc(&bp->ref); since the definition for _allocb is so if((b = mallocz(sizeof(Block)+size+Hdrspc, 0)) == nil) return nil; b->next = nil; b->list = nil; b->free = 0; b->flag = 0; [...] either the unused reference counting needs to be dropped, usbohci needs to initialize its own reference count or _allocb needs to initialize it to 1. i assume the reason blocks are not zeroed is for performance reasons. i'm not sure i understand a reference count for a Block, since i thought part of deal was that each Block has a unique owner. am i wrong? - erik