Re: one time crash in usb_allocmem_flags

2014-02-10 Thread Nick Hudson

On 02/09/14 19:48, Alexander Nasonov wrote:

Hi,

I was running current amd64 (last updated few weeks ago) when I got
a random crash shortly after switching to X mode. If my analysis is
correct, it crashed in usb_allocmem_flags inside this loop:

 LIST_FOREACH(f, usb_frag_freelist, next) {
 KDASSERTMSG(usb_valid_block_p(f-block, usb_blk_fraglist),
 %s: usb frag %p: unknown block pointer %p,
  __func__, f, f-block);
 if (f-block-tag == tag)
 break;
 }

It couldn't access f-block-tag. I wasn't actively using any of
the usb devices at that time. I wonder if it's a known problem or
should I file a PR? Details of the analysis is below.


Please fill a PR so it doesn't get forgotten about.

At first glance it doesn't look like that usb_frag_freelist isn't 
protected correctly. I looks more like random corruption. What was the 
value of %edx?


Thanks,
Nick



Re: one time crash in usb_allocmem_flags

2014-02-10 Thread Alexander Nasonov
10.02.14, 12:15, Nick Hudson sk...@netbsd.org:
 
 Please fill a PR so it doesn't get forgotten about.

Sure, will do.

 
 At first glance it doesn't look like that usb_frag_freelist isn't 
 protected correctly. I looks more like random corruption. What was the 
 value of %edx?

The stack isn't in that function anymore, I'm not sure it shows the right 
values. 'show registers' command prints all zeroes except rbp=fe80ca6f1450 
and rsp=fe80ca6f1410.

-- 
Alex