[Crash-utility] "zero-size memory allocation!" is back for Linux 3.1

Bob Montgomery bob.montgomery at hp.com
Thu Jan 19 20:39:54 UTC 2012


On Wed, 2012-01-18 at 09:35 -0500, Dave Anderson wrote:
> 

> > 
> > Which causes this in crash/memory.c:vm_init()
> > 
> >        ARRAY_LENGTH_INIT(vt->kmem_cache_len_nodes, NULL,
> >             "kmem_cache.nodelists", NULL, 0);
> > 
> > to set vt->kmem_cache_len_nodes to 0, and leads to the initialization
> > failure when max_cpudata_limit calls getbuf with a size of 0.
> > 
> > Got a fix in the works yet?
> > 
> > Thanks,
> > Bob Montgomery
> 
> No, afraid not.  Fedora uses slub instead of slab, so I haven't 
> noticed it.  I wonder why kmem_cache_downsize() doesn't recalculate
> vt->kmem_cache_len_nodes based upon "nr_node_ids"?:
> 
>         if (buffer_size < SIZE(kmem_cache_s)) {
> 
>                 if (kernel_symbol_exists("nr_node_ids")) {
>                         get_symbol_data("nr_node_ids", sizeof(int),
>                                 &nr_node_ids);
>                         vt->kmem_cache_len_nodes = nr_node_ids;
> 
>                 } else
>                         vt->kmem_cache_len_nodes = 1;
> 
> Dave

This code is skipped because the buffer_size test is no longer true.
Also references to the nodeslist array are bad because it got changed
from an array to a pointer to an external array.

I have a fix and have tested it to give the same results on a *pre-3.1*
CONFIG_SLAB kernel (compared 6.0.2 to 6.0.2-fix on a 2.6.32 base), but
will now work on trying to verify that it's telling the truth about my
CONFIG_SLAB 3.1 kernel.

More later,
Bob Montgomery




More information about the Crash-utility mailing list