Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

32.3. コアダンプの分析

システムクラッシュの原因を特定するには、crash ユーティリティーを使用します。これにより、GDB(GNU Debugger)と非常に似た対話式プロンプトを利用できます。このユーティリティーを使用すると、実行中の Linux システムや netdumpdiskdumpxendumpkdump で作成されたコアダンプを対話形式で分析できます。
関連するパッケージがインストールされていることを確認します。
vmcore ダンプファイルを分析するには、crash および kernel-debuginfo パッケージがインストールされている必要があります。システムに crash パッケージをインストールするには、root で次のコマンドを実行します。
yum install crash
kernel-debuginfo パッケージをインストールするには、yum-utils パッケージがインストールされていることを確認し、root で以下のコマンドを実行します。
debuginfo-install kernel
このコマンドを使用するには、デバッグパッケージを含むリポジトリーにアクセスできる必要があることに注意してください。システムが Red Hat Subscription Management に登録されている場合は、「現在の設定の表示」 の説明に従って rhel-6-variant-debug-rpms リポジトリーを有効にします。システムが RHN Classic に登録されている場合は、システムを rhel-architecture-variant-6-debuginfo チャンネルにサブスクライブし https://access.redhat.com/site/solutions/9907 ます。

32.3.1. crash ユーティリティーの実行

シェルプロンプトで次の形式のコマンドを入力してユーティリティーを起動します。
crash /usr/lib/debug/lib/modules/kernel/vmlinux /var/crash/timestamp/vmcore
カーネル のバージョンは、kdump が取得したものと同じである必要があります。現在実行中のカーネルを確認するには、uname -r コマンドを使用します。

例32.2 crash ユーティリティーの実行

~]# crash /usr/lib/debug/lib/modules/2.6.32-69.el6.i686/vmlinux \
/var/crash/127.0.0.1-2010-08-25-08:45:02/vmcore

crash 5.0.0-23.el6
Copyright (C) 2002-2010  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, 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.0
Copyright (C) 2009 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 "i686-pc-linux-gnu"...

      KERNEL: /usr/lib/debug/lib/modules/2.6.32-69.el6.i686/vmlinux
    DUMPFILE: /var/crash/127.0.0.1-2010-08-25-08:45:02/vmcore  [PARTIAL DUMP]
        CPUS: 4
        DATE: Wed Aug 25 08:44:47 2010
      UPTIME: 00:09:02
LOAD AVERAGE: 0.00, 0.01, 0.00
       TASKS: 140
    NODENAME: hp-dl320g5-02.lab.bos.redhat.com
     RELEASE: 2.6.32-69.el6.i686
     VERSION: #1 SMP Tue Aug 24 10:31:45 EDT 2010
     MACHINE: i686  (2394 Mhz)
      MEMORY: 8 GB
       PANIC: "Oops: 0002 [#1] SMP " (check log for details)
         PID: 5591
     COMMAND: "bash"
        TASK: f196d560  [THREAD_INFO: ef4da000]
         CPU: 2
       STATE: TASK_RUNNING (PANIC)

crash>