[Crash-utility] patch to add vmss memory regions support

Dave Anderson anderson at redhat.com
Thu Mar 26 20:12:27 UTC 2015



----- Original Message -----
> Dave,
>   updated the patch and please review. thanks.
>   - the page_size/page_shift problem.
>   - change type cast to union.
>   - the read_vmware_vmss() regression.
> 
> rgds,
> Dyno


Dyno,

Since you cannot make any additional sample vmss2core-generated
dumpfiles available to me, I can only test this latest patch
on the two dumpfile/kernel pairs that you gave me in February:
  
  vmlinux-2.6.32-431.el6 CentOS6.5-11bd56db.vmss

and

  vmlinux-3.13.0-39-generic Ubuntu1404_64bit-65993542.vmss 
  (with its companion Ubuntu1404_64bit-65993542.vmem file)

The CentOS kernel works OK with your patch:
  
  $ crash vmlinux-2.6.32-431.el6 CentOS6.5-11bd56db.vmss
  
  crash 7.1.1rc13
  Copyright (C) 2002-2014  Red Hat, Inc.
  Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
  Copyright (C) 1999-2006  Hewlett-Packard Co
  Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
  Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
  Copyright (C) 2005, 2011  NEC Corporation
  Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
  Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
  This program is free software, covered by the GNU General Public License,
  and you are welcome to change it and/or distribute copies of it under
  certain conditions.  Enter "help copying" to see the conditions.
  This program has absolutely no warranty.  Enter "help warranty" for details.
   
  GNU gdb (GDB) 7.6
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-unknown-linux-gnu"...
  
        KERNEL: vmlinux-2.6.32-431.el6            
      DUMPFILE: CentOS6.5-11bd56db.vmss
          CPUS: 4
          DATE: Tue Feb  3 18:22:03 2015
        UPTIME: 00:01:06
  LOAD AVERAGE: 0.71, 0.22, 0.07
         TASKS: 302
      NODENAME: promd-1s-dhcp37.eng.vmware.com
       RELEASE: 2.6.32-431.el6.x86_64
       VERSION: #1 SMP Fri Nov 22 03:15:09 UTC 2013
       MACHINE: x86_64  (2394 Mhz)
        MEMORY: 511.5 MB
         PANIC: ""
           PID: 0
       COMMAND: "swapper"
          TASK: ffffffff81a8d020  (1 of 4)  [THREAD_INFO: ffffffff81a00000]
           CPU: 0
         STATE: TASK_RUNNING (ACTIVE)
       WARNING: panic task not found
  
  crash> 
  
But the Ubuntu1404_64bit-65993542.vmss fails miserably:

  $ crash Ubuntu1404_64bit-65993542.vmss vmlinux-3.13.0-39-generic
  
  crash 7.1.1rc13
  Copyright (C) 2002-2014  Red Hat, Inc.
  Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
  Copyright (C) 1999-2006  Hewlett-Packard Co
  Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
  Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
  Copyright (C) 2005, 2011  NEC Corporation
  Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
  Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
  This program is free software, covered by the GNU General Public License,
  and you are welcome to change it and/or distribute copies of it under
  certain conditions.  Enter "help copying" to see the conditions.
  This program has absolutely no warranty.  Enter "help warranty" for details.
   
  crash: vmware_vmss.c:169: vmware_vmss_init: Assertion `__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("Memory") && (__s1_len = strlen (name), __s2_len = strlen ("Memory"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("Memory") + 1) - (size_t)(const void *)("Memory") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "Memory") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("Memory") && ((size_t)(const void *)(("Memory") + 1) - (size_t)(const void *)("Memory") == 1) ? __builtin_strcmp (name, "Memory") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("Memory"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("Memory") && ((size_t)(const void *)(("Memory") + 1) - (size_t)(const void *)("Memory") == 1) && (__s2_len = strlen ("Memory"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "Memory") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("Memory"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("Memory"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("Memory"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("Memory"))[3]); } } __result; }))) : __builtin_strcmp (name, "Memory")))); }) == 0' failed.
  Aborted (core dumped)
  $ 
  
Note that crash-7.1.0 works OK:
  
  $ /usr/bin/crash Ubuntu1404_64bit-65993542.vmss vmlinux-3.13.0-39-generic
  
  crash 7.1.0
  Copyright (C) 2002-2014  Red Hat, Inc.
  Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
  Copyright (C) 1999-2006  Hewlett-Packard Co
  Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
  Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
  Copyright (C) 2005, 2011  NEC Corporation
  Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
  Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
  This program is free software, covered by the GNU General Public License,
  and you are welcome to change it and/or distribute copies of it under
  certain conditions.  Enter "help copying" to see the conditions.
  This program has absolutely no warranty.  Enter "help warranty" for details.
   
  vmw: Memory dump is not part of this vmss file.
  vmw: Try to locate the companion vmem file ...
  vmw: vmem file: Ubuntu1404_64bit-65993542.vmem
  
  GNU gdb (GDB) 7.6
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-unknown-linux-gnu"...
  
        KERNEL: vmlinux-3.13.0-39-generic         
      DUMPFILE: Ubuntu1404_64bit-65993542.vmss
          CPUS: 1
          DATE: Thu Nov 13 14:10:53 2014
        UPTIME: 2 days, 03:40:33
  LOAD AVERAGE: 0.00, 0.01, 0.05
         TASKS: 669
      NODENAME: ubuntu
       RELEASE: 3.13.0-39-generic
       VERSION: #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014
       MACHINE: x86_64  (2693 Mhz)
        MEMORY: 1 GB
         PANIC: ""
           PID: 0
       COMMAND: "swapper/0"
          TASK: ffffffff81c15480  [THREAD_INFO: ffffffff81c00000]
           CPU: 0
         STATE: TASK_RUNNING 
       WARNING: panic task not found
  
  crash> 
  
Anyway, besides fixing whatever the problem is, please remove the assert()
calls entirely.  They did not exist in the original vmware_vmss.c file,
and shouldn't be added now.

assert() is not used by the top-level crash sources (except for qemu.c 
and qemu-load.c, which came from a 3rd party, and I didn't feel like changing 
all of them).  Instead, please use the crash convention by testing for the
anomoly, and then send an appropriate error message to error(FATAL, ...), 
which will kill the crash session if it's during session initialization, 
or kill the current command if it's during crash runtime.

Thanks,
  Dave




More information about the Crash-utility mailing list