[Crash-utility] HEADS UP: upstream kernel pidhash removal

Dave Anderson anderson at redhat.com
Wed Nov 22 18:30:52 UTC 2017


----- Original Message -----
> 
> FYI, if you're running with bleeding edge upstream kernels, this
> recent commit destroys a fundamental underpinning required by the
> crash utility:
> 
>   commit e8cfbc245e24887e3c30235f71e9e9405e0cfc39
>   Author: Gargi Sharma <gs051095 at gmail.com>
>   Date:   Fri Nov 17 15:30:34 2017 -0800
> 
>     pid: remove pidhash
>     
>     pidhash is no longer required as all the information can be looked up
>     from idr tree.  nr_hashed represented the number of pids that had been
>     hashed.  Since, nr_hashed and PIDNS_HASH_ADDING are no longer relevant,
>     it has been renamed to pid_allocated and PIDNS_ADDING respectively.
>
> I'm not sure how the failure will manifest itself, but it certainly will
> will fail early on during session initialization.  

Here's what happens, in this case running on a Fedora rawhide kernel:

  # uname -r
  4.15.0-0.rc0.git6.1.fc28.x86_64
  
It fails with a seemingly unrelated error message because it has
defaulted to using an ancient task-gathering function that was 
suitable for kernels back in the pre-pidhash Linux 2.2 era:

  # ./crash
  
  crash 7.2.0++
  Copyright (C) 2002-2017  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"...
  
  WARNING: kernel relocated [208MB]: patching 98688 gdb minimal_symbol values
  
                                                                         
  crash: cannot resolve "init_task_union"

  #
  
> When I saw the original
> patch postings, I started tinkering with the creation of yet another
> function to plug into "tt->refresh_task_table" for the new IDR/radix-tree
> scheme, but until I see an actual live kernel and/or vmcore with the patch
> above, I've held off on further work on it.
> 
> In the meantime, you can use the "crash --active" command line option,
> which restricts the task list to those that are registered as the current
> task in each per-cpu runqueue.

At least that works:

  # ./crash --active
  
  crash 7.2.0++
  Copyright (C) 2002-2017  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"...
  
  WARNING: kernel relocated [208MB]: patching 98688 gdb minimal_symbol values
  
        KERNEL: /usr/lib/debug/lib/modules/4.15.0-0.rc0.git6.1.fc28.x86_64/vmlinux
      DUMPFILE: /dev/crash
          CPUS: 8
          DATE: Wed Nov 22 18:14:17 2017
        UPTIME: 01:28:32
  LOAD AVERAGE: 0.58, 0.42, 0.24
         TASKS: 8
      NODENAME: lenovo-thinkstation-01.lab.bos.redhat.com
       RELEASE: 4.15.0-0.rc0.git6.1.fc28.x86_64
       VERSION: #1 SMP Mon Nov 20 18:08:48 UTC 2017
       MACHINE: x86_64  (2925 Mhz)
        MEMORY: 4 GB
           PID: 1687
       COMMAND: "crash"
          TASK: ffff9b1d2a903380  [THREAD_INFO: ffff9b1d2a903380]
           CPU: 5
         STATE: TASK_RUNNING (ACTIVE)
  
  WARNING: only the active tasks on each cpu are being tracked
  
  crash>

Dave 




More information about the Crash-utility mailing list