<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Tejasvi Aswathanarayana wrote:
<blockquote TYPE=CITE>Crash exits with an error "cannot determine pid_hash
array
<br>dimensions". Looking at the crash change log, it appears that it was
<br>fixed in 4.0-2.24 for the 2.6.17 kernel. The core I have is of a
<br>2.6.16.13 xenified kernel. Is the fix even relevant ?
<p><output>
<br>$ ./crash vmlinux-2.6.16.13-xen test.core
<p>crash 4.0-3.5
<br>Copyright (C) 2002, 2003, 2004, 2005, 2006  Red Hat, Inc.
<br>Copyright (C) 2004, 2005, 2006  IBM Corporation
<br>Copyright (C) 1999-2006  Hewlett-Packard Co
<br>Copyright (C) 2005  Fujitsu Limited
<br>Copyright (C) 2005  NEC Corporation
<br>Copyright (C) 1999, 2002  Silicon Graphics, Inc.
<br>Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux,
Inc.
<br>This program is free software, covered by the GNU General Public License,
<br>and you are welcome to change it and/or distribute copies of it under
<br>certain conditions.  Enter "help copying" to see the conditions.
<br>This program has absolutely no warranty.  Enter "help warranty"
for details.
<p>GNU gdb 6.1
<br>Copyright 2004 Free Software Foundation, Inc.
<br>GDB is free software, covered by the GNU General Public License, and
you are
<br>welcome to change it and/or distribute copies of it under certain conditions.
<br>Type "show copying" to see the conditions.
<br>There is absolutely no warranty for GDB.  Type "show warranty"
for details.
<br>This GDB was configured as "x86_64-unknown-linux-gnu"...
<p>please wait... (gathering task table data)
<br>crash: cannot determine pid_hash array dimensions
<br></output>
<p>Is there a way I can get crash's source at releases  4.0-2.24 and
<br>4.0-2.23 so that I can try a fix for this kernel in case it is a
<br>specific kernel fix  ?
<p>Thanks
<br>-Tejasvi</blockquote>
<tt>Interesting -- I got a private message yesterday from another</tt>
<br><tt>2.6.16-era xen user with the same problem.</tt><tt></tt>
<p><tt>Anyway, over time the manner of pid table handling has</tt>
<br><tt>changed several times, and so to handle the various manners,</tt>
<br><tt>the crash utility's task_init() function assigns an appropriate</tt>
<br><tt>function to gather all pids/tasks running on the system.</tt><tt></tt>
<p><tt>You're referring to this entry in the changelog:</tt><tt></tt>
<p><tt>4.0-2.24 - Fix for 2.6.17 kernels that do not use "pgdat_list" memory
node</tt>
<br><tt>           list
header, which would cause crash to fail during initialization</tt>
<br><tt>           with
a "crash: cannot resolve: pgdat_list" error message.</tt>
<br><tt>           (anderson@redhat.com)</tt><tt></tt>
<p><tt>         - Fix for 2.6.17
kernels that have re-worked the kernel pid_hash</tt>
<br><tt>           handling,
which would cause crash to fail during initialization</tt>
<br><tt>           with
a "crash: cannot determine pid_hash array dimensions" error</tt>
<br><tt>           message. 
(anderson@redhat.com)</tt>
<br><tt>...</tt>
<br><tt></tt> <tt></tt>
<p><tt>The change above implemented yet another pid hash handler</tt>
<br><tt>called refresh_hlist_task_table_v2(), which as the comments</tt>
<br><tt>above indicate, was required for 2.6.17 kernels.  In crash</tt>
<br><tt>version 4.0-2.24, a new refresh_hlist_task_table_v2() function</tt>
<br><tt>was added to replace refresh_hlist_task_table(), to account</tt>
<br><tt>for this change:</tt><tt></tt>
<p><tt>/*</tt>
<br><tt> *  2.6.17 replaced:</tt>
<br><tt> *    static struct hlist_head *pid_hash[PIDTYPE_MAX];</tt>
<br><tt> *  with</tt>
<br><tt> *     static struct hlist_head *pid_hash;</tt>
<br><tt> */</tt><tt></tt>
<p><tt>So, for starters, can you display how "pid_hash" is</tt>
<br><tt>declared in your kernel?</tt><tt></tt>
<p><tt>Unfortunately the only 2.6.16-era x86_64 kernel dumpfile that</tt>
<br><tt>I have on-hand as a reference is an early kdump dumpfile,</tt>
<br><tt>(non-xen) which selects the older refresh_hlist_task_table():</tt><tt></tt>
<p><tt>crash> sys</tt>
<br><tt>      KERNEL: /usr/dumps/kdump/vmlinux
(2.6.16-20-smp)</tt>
<br><tt>    DUMPFILE: /usr/dumps/kdump/vmcore</tt>
<br><tt>        CPUS: 2</tt>
<br><tt>        DATE: Mon Apr 24 11:02:03
2006</tt>
<br><tt>      UPTIME: 00:31:04</tt>
<br><tt>LOAD AVERAGE: 0.00, 0.00, 0.00</tt>
<br><tt>       TASKS: 63</tt>
<br><tt>    NODENAME: elm3a242</tt>
<br><tt>     RELEASE: 2.6.16-20-smp</tt>
<br><tt>     VERSION: #1 SMP Mon Apr 10 04:51:13 UTC
2006</tt>
<br><tt>     MACHINE: x86_64  (3000 Mhz)</tt>
<br><tt>      MEMORY: 4.6 GB</tt>
<br><tt>       PANIC: "SysRq : Trigger a
crashdump"</tt>
<br><tt>crash> help -t</tt>
<br><tt>           current:
1678f60 [62]</tt>
<br><tt>             
.pid: 3235</tt>
<br><tt>            
.comm: "bash"</tt>
<br><tt>            
.task: ffff810121a7d810</tt>
<br><tt>      .thread_info: ffff81011d826000</tt>
<br><tt>        .processor: 1</tt>
<br><tt>           
.ptask: ffff810121d91790</tt>
<br><tt>        .mm_struct: ffff810122f9eb00</tt>
<br><tt>          .tc_next:
0</tt>
<br><tt>     context_array: 1677df0</tt>
<br><tt><b>refresh_task_table: refresh_hlist_task_table()</b></tt>
<br><tt>...</tt>
<br><tt> </tt>
<br><tt>This is the code sequence in task_init() that selects</tt>
<br><tt>refresh_hlist_task_table() or refresh_hlist_task_table_v2():</tt><tt></tt>
<p><tt>      } else {</tt>
<br><tt>             
tt->pidhash_addr = symbol_value("pid_hash");</tt>
<br><tt>             
if (!get_array_length("pid_hash", NULL, sizeof(void *)) &&</tt>
<br><tt>                 
VALID_STRUCT(pid_link))</tt>
<br><tt>                     
tt->refresh_task_table = refresh_hlist_task_table_v2;</tt>
<br><tt>             
else</tt>
<br><tt>                     
tt->refresh_task_table = refresh_hlist_task_table;</tt>
<br><tt>      }</tt><tt></tt>
<p><tt>Since you are breaking down on initialization, can you put</tt>
<br><tt>some debug code in place that displays?:</tt><tt></tt>
<p><tt>1. the output of the get_array_length("pid_hash",...) call, and</tt>
<br><tt>2. the output of VALID_STRUCT(pid_link)</tt><tt></tt>
<p><tt>Something must be slightly different between the mainline</tt>
<br><tt>and xen 2.6.16-era kernels.</tt><tt></tt>
<p><tt>What appears to be happening is that refresh_hlist_task_table()</tt>
<br><tt>is being selected, but in that function, this subsequent call</tt>
<br><tt>is failing:</tt><tt></tt>
<p><tt>        if (!(plen = get_array_length("pid_hash",
NULL, sizeof(void *))))</tt>
<br><tt>               
error(FATAL, "cannot determine pid_hash array dimensions\n");</tt><tt></tt>
<p><tt>Alternatively, if you want to make the vmlinux/dumpfile pair</tt>
<br><tt>available to me, I can take a look at it.</tt><tt></tt>
<p><tt>Thanks,</tt>
<br><tt>  Dave</tt>
<br><tt></tt> 
<br><tt></tt> 
<br><tt></tt> 
<br><tt></tt> 
<br><tt></tt> </html>