[Crash-utility] vt->kmem_cache_len_nodes not set

Michael Holzheu holzheu at linux.vnet.ibm.com
Thu Jan 26 10:09:51 UTC 2012


Hello Dave,

I have a s390x dump of a Linux-3.1 kernel where I get the error message:

crash: zero-size memory allocation! (called from 8009f504)

The error comes from max_cpudata_limit() where GETBUF fails:

        /*
         *  Check the shared list of all the nodes.
         */
        start_address = (ulong *)GETBUF(sizeof(ulong) * vt->kmem_cache_len_nodes);

--> vt->kmem_cache_len_nodes = 0

I debugged the problem a bit and found out that the reason is
that crash does not set vt->kmem_cache_len_nodes for that dump.
This attribute seem to be only set in kmem_cache_downsize():

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 {
                        fprintf(fp, "XXX kernel_symbol_exists(\n");
                        vt->kmem_cache_len_nodes = 1;
                }

In my dump the "if" condition returns false (buffer_size = 768,
SIZE(kmem_cache_s = 624) therefore vt->kmem_cache_len_nodes is
not set. Perhaps the content of "cache_cache" is useful to understand
what is going on:

print cache_cache
$7 = {
  batchcount = 27, 
  limit = 54, 
  shared = 8, 
  buffer_size = 768, <<----- 
  reciprocal_buffer_size = 5592406, 
  flags = 0, 
  num = 5, 
  gfporder = 0, 
  gfpflags = 0, 
  colour = 0, 
  colour_off = 256, 
  slabp_cache = 0x0, 
  slab_size = 256, 
  dflags = 0, 
  ctor = 0, 
  name = 0x667b8e "kmem_cache", 
  next = {
    next = 0x93b528, 
    prev = 0xff04158
  }, 
  nodelists = 0x93b538, 
  array = {0xff23e00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x
0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
}

Any idea what's wrong here?

Best Regards

Michael




More information about the Crash-utility mailing list