[Crash-utility] loop in crash

Karlsson, Jan Jan.Karlsson at sonymobile.com
Wed Apr 25 11:58:27 UTC 2012


Hi Dave,

I have a corrupt vmcore file (for ARM) that makes crash loop forever. The problem is in memory.c, function max_cpudata_limit. The last part of that function:

          if (VALID_MEMBER(kmem_list3_shared) && VALID_MEMBER(kmem_cache_s_lists) &&
              readmem(kmem_cache_nodelists(cache), KVADDR, &start_address[0],
              sizeof(ulong) * vt->kmem_cache_len_nodes, "array nodelist array",
              RETURN_ON_ERROR)) {
                   for (i = 0; i < vt->kmem_cache_len_nodes; i++) {
                             if (start_address[i] == 0)
                                       continue;
                             if (readmem(start_address[i] + OFFSET(kmem_list3_shared),
                                 KVADDR, &shared, sizeof(void *),
                                 "kmem_list3 shared", RETURN_ON_ERROR|QUIET)) {
                                       if (!shared)
                                                break;
                             }
                             if (readmem(shared + OFFSET(array_cache_limit),
                                 KVADDR, &limit, sizeof(int), "shared array_cache limit",
                               RETURN_ON_ERROR|QUIET)) {
                                       if (limit > max_limit)
                                                max_limit = limit;
                                       break;
                             }
                   }
          }
          FREEBUF(start_address);
          return max_limit;

bail_out:
          vt->flags |= KMEM_CACHE_UNAVAIL;
          error(INFO, "unable to initialize kmem slab cache subsystem\n\n");
          *cpus = 0;
          return 0;

The problem is that the readmem statement "if (readmem(start_address[i] + OFFSET(kmem_list3_shared), ....." fails, and then the function max_cpudata_limit is called over and over again. I did a patch adding "else goto bail_out;" if the readmem fails and then crash managed to continue. I do not know if this is really a good idea.

As this seems only to be a problem for corrupt vmcore files I do not know if you want to do anything about it.

Best regards
Jan


Jan Karlsson
Senior Software Engineer
MIB

Sony Mobile Communications
Tel: +46703062174
sonymobile.com<http://sonymobile.com/>

[cid:image001.jpg at 01CD22E9.EA9DB1E0]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120425/992b0729/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2843 bytes
Desc: image001.jpg
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120425/992b0729/attachment.jpg>


More information about the Crash-utility mailing list