<tt><font size=2>> Dave Anderson <anderson@redhat.com></font></tt>
<br><tt><font size=2>> <br>
> To:</font></tt>
<br><tt><font size=2>> <br>
> "Discussion list for crash utility usage, maintenance and <br>
> development" <crash-utility@redhat.com></font></tt>
<br><tt><font size=2>> <br>
> Date:</font></tt>
<br><tt><font size=2>> <br>
> 13.01.2010 16:14</font></tt>
<br><tt><font size=2>> <br>
> Subject:</font></tt>
<br><tt><font size=2>> <br>
> Re: [Crash-utility] crash-5.0: zero-size memory-allocation</font></tt>
<br><tt><font size=2>> <br>
> Sent by:</font></tt>
<br><tt><font size=2>> <br>
> crash-utility-bounces@redhat.com</font></tt>
<br><tt><font size=2>> <br>
> <br>
> ----- "ville mattila" <ville.mattila@stonesoft.com>
wrote:<br>
> <br>
> > > From:<br>
> > ><br>
> > > Dave Anderson <anderson@redhat.com><br>
> > ><br>
> > ...<br>
> > > But your kernel shows cache_cache.buffer_size set to zero
-- and the<br>
> > > ASSIGN_SIZE(kmem_cache_s) above dutifully downsized the
data structure<br>
> > > size from 204 to zero. Later on, that size was used to allocate
a<br>
> > > kmem_cache buffer, which failed when a GETBUF() was called
with <br>
> a zero-size.<br>
> > ><br>
> > > I guess a check could be made above for a zero cache_cache.buffer_size,<br>
> > > but why would that ever be?<br>
> > ><br>
> > > Try this:<br>
> > ><br>
> > > # crash --no_kmem_cache vmlinux vmcore<br>
> > ><br>
> > > which will allow you to get past the kmem_cache initialization.<br>
> > ><br>
> > > Then enter:<br>
> > ><br>
> > > crash> p cache_cache<br>
> > ><br>
> > > Does the "buffer_size" member really show zero?<br>
> > <br>
> > Yes it seems so!<br>
> > initialize_task_state: using old defaults<br>
> > <readmem: 8067a300, KVADDR, "fill_task_struct",
868, (ROE), 86e3f78><br>
> > addr: 8067a300 paddr: 67a300 cnt: 868<br>
> > STATE: TASK_RUNNING (PANIC)<br>
> > <br>
> > crash> p cache_cache<br>
> > cache_cache = GETBUF(128 -> 0)<br>
> > <readmem: 8067f1c0, KVADDR, "gdb_readmem_callback",
204, (ROE), 8ac00d8><br>
> > addr: 8067f1c0 paddr: 67f1c0 cnt: 204<br>
> > $3 = {<br>
> > array = {0x0, 0x8067f1c4, 0x8067f1c4, 0x0, 0x0, 0x0, 0x0, 0x0,<br>
> > 0xf7813e00, 0xf7849400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0,<br>
> > 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},<br>
> > batchcount = 0,<br>
> > limit = 0,<br>
> > shared = 0,<br>
> > buffer_size = 0,<br>
> > reciprocal_buffer_size = 0,<br>
> > flags = 0,<br>
> > num = 0,<br>
> > gfporder = 0,<br>
> > gfpflags = 60,<br>
> > colour = 120,<br>
> > colour_off = 8,<br>
> > slabp_cache = 0x100,<br>
> > slab_size = 16777216,<br>
> > dflags = 0,<br>
> > ctor = 0xf,<br>
> > name = 0x0,<br>
> > next = {<br>
> > next = 0x0,<br>
> > prev = 0x2<br>
> > },<br>
> > nodelists = {0x40}<br>
> > }<br>
> > FREEBUF(0)<br>
> <br>
> That's some serious corruption!<br>
>  <br>
        Yes, this double free caused a lot
of head scratching! </font></tt>
<br>
<br>
<br><tt><font size=2>> > ><br>
> > > BTW, you can work around the problem by commenting out the
call<br>
> > > to kmem_cache_downsize() in vm_init().<br>
> > <br>
> > This workaround works ok.<br>
> <br>
> But even then, if you comment out the call to kmem_cache_downsize(),<br>
> the kmem_cache_init() function could not have done anything useful<br>
> because the "cache_cache.next.next" pointer is corrupted
with a NULL, <br>
> which points to the first of the chain of kmem_cache slab cache headers.<br>
> I'm surprised it managed to continue without running into another<br>
> roadblock -- did it display the "crash: unable to initialize
kmem<br>
> slab cache subsystem" error message?<br>
> <br>
        No, there is no other error messages.
</font></tt>
<br>
<br><tt><font size=2>> > > (And if you're using makedumpfile with
excluded pages, hope that<br>
> > > the problem I described above doesn't occur...)<br>
> > ><br>
> > We are not excluding files so this is not a big issue. Also<br>
> > the --no_kmem_cache lets me open dump and let me do quite many
things<br>
> > already.<br>
> <br>
> Like I mentioned before, I could put a check in kmem_cache_downsize()<br>
> to check for a zero buffer_size, but the odds of that happening are<br>
> absurdly small.  I suppose I could check whether the value is
less<br>
> than the kmem_cache.nodelists structure offset.<br>
> <br>
   </font></tt>
<br><tt><font size=2>    That would be usefull, just warn that
some major corruption seems to have</font></tt>
<br><tt><font size=2>    happen.It is always good to get atleast
some crash info out. For example </font></tt>
<br><tt><font size=2>    dmesg and bt. I'll gladly test patches,
if needed.</font></tt>
<br>
<br><tt><font size=2>    Also one question. Is there some hidden
option that will show all the </font></tt>
<br><tt><font size=2>    hidden crash command line options, e.g.
--no_kmem_cache and alike?</font></tt>
<br>
<br><tt><font size=2> - Ville </font></tt>
<br><tt><font size=2>    </font></tt>
<br>
<br>
<br>