[Crash-utility] relocatable FC7/upstream x86 kernels
Dave Anderson
anderson at redhat.com
Wed Jul 25 18:14:17 UTC 2007
Dave Anderson wrote:
> So, whereas the vmlinux file shows these symbol values:
>
> $ nm -Bn vmlinux
> ...
> c1000000 T _text
> c1000000 T startup_32
> c1001000 T startup_32_smp
> c1001080 t checkCPUtype
> c1001101 t is486
> c1001108 t is386
> c1001175 t check_x87
> c10011a0 T setup_pda
> c10011c2 t setup_idt
> c10011df t rp_sidt
> c1001262 t early_divide_err
> c1001268 t early_illegal_opcode
> c1001271 t early_protection_fault
> c1001278 t early_page_fault
> c100127f t early_fault
> c10012a7 t hlt_loop
> c10012ac t ignore_int
> c10012f0 T _stext
> c10012f0 t run_init_process
> c10012f0 T stext
> c1001304 t init_post
> ...
>
> But when loaded into memory, they are all changed to reflect that
> the kernel was loaded at at 4MB physical instead of 16MB:
>
> $ cat /proc/kallsyms
> c0400000 T _text
> c0400000 T startup_32
> c0401000 T startup_32_smp
> c0401080 t checkCPUtype
> c0401101 t is486
> c0401108 t is386
> c0401175 t check_x87
Interesting -- I never thought /proc/kallsyms would have ever
come in so handy...
crash fails on my FC7 kernel in the "do not match" manner:
# crash /vmlinux-2.6.21-1.3194.fc7
crash 4.0-4.3
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005 NEC Corporation
Copyright (C) 1999, 2002 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 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB 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.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
crash: /vmlinux-2.6.21-1.3194.fc7 and /dev/crash do not match!
Usage:
crash [-h [opt]][-v][-s][-i file][-d num] [-S] [mapfile] [namelist] [dumpfile]
Enter "crash -h" for details.
#
But since /proc/kallsyms has a format similar to a System.map
file, if you throw it on the crash command line, crash thinks
that it is a System.map, and things just work:
# crash /vmlinux-2.6.21-1.3194.fc7 /proc/kallsyms
crash 4.0-4.3
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005 NEC Corporation
Copyright (C) 1999, 2002 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 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB 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.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
please wait... (patching 28475 gdb minimal_symbol values)
SYSTEM MAP: /proc/kallsyms
DEBUG KERNEL: /vmlinux-2.6.21-1.3194.fc7 (2.6.21-1.3194.fc7)
DUMPFILE: /dev/crash
CPUS: 4
DATE: Wed Jul 25 13:47:55 2007
UPTIME: 23:10:09
LOAD AVERAGE: 0.08, 0.03, 0.01
TASKS: 111
NODENAME: ibm-crichton-01.lab.boston.redhat.com
RELEASE: 2.6.21-1.3194.fc7
VERSION: #1 SMP Wed May 23 22:35:01 EDT 2007
MACHINE: i686 (2666 Mhz)
MEMORY: 1 GB
PID: 958
COMMAND: "crash"
TASK: c1934d30 [THREAD_INFO: ce64b000]
CPU: 3
STATE: TASK_RUNNING (ACTIVE)
crash> q
Of course if you're running with 2.6.22, you'd then probably bump
into the issue reported by Ken'ichi:
[Crash-utility] [Patch] linux-2.6.22 on i386
https://www.redhat.com/archives/crash-utility/2007-July/msg00061.html
So applying Ken'ichi's patch, and then using /proc/kallsyms, should get
you up and running for now... (presuming you've got CONFIG_KALLSYMS
configured)
Dave
More information about the Crash-utility
mailing list