9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] panic
Date: Wed, 17 Sep 2008 09:07:18 -0400	[thread overview]
Message-ID: <fa3db1525aa2e5fd0ea05eddece33c22@quanstro.net> (raw)
In-Reply-To: <dc8aa0e05301e3fb632e1316ae9171d5@yourdomain.dom>

> 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




  reply	other threads:[~2008-09-17 13:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 16:08 Markus Sonderegger
2008-09-17 13:07 ` erik quanstrom [this message]
2008-09-17 15:04   ` geoff
  -- strict thread matches above, loose matches on Subject: below --
2008-10-05 16:30 erik quanstrom
2007-11-21 16:29 Frank Lenaerts
2007-11-21 17:02 ` erik quanstrom
2007-11-21 17:31   ` Tim Wiess
2007-11-21 18:19     ` erik quanstrom
2007-11-22 15:39 ` Frank Lenaerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa3db1525aa2e5fd0ea05eddece33c22@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).