From MDB to crash

Source: Internet
Author: User

On Solaris, the powerful tool for analyzing crashdump or debugging an operating system kernel online is the MDB. Of course, MDB does not support source-level debugging, only support assembly-level debugging. In Linux (for example in CentOS), a similar tool is crash.

 man-S8 crashname       - Analyze Linux crash dump data or a live systemsynopsis       crash [OPTION]: . NameList MEMORY-image[@ADDRESS]    (dumpfile form)       crash [OPTION] ... [NameList]                         (Live system form)
... <snip>..

The use of MDB is simpler than crash because you do not need to install namelist yourself. But crash is better than MDB to support source-level debugging because it works very closely with GDB.

Here's how to use crash to analyze a crashdump file on CentOS.

The first time to use crash feeling very circle, because do not understand God horse is namelist.

Note: with MDB for live debugging, you don't need god horse namelist. Very simply,-K (large K) can only be used on the console, allowing the entire kernel to hang. For example:

root# mdb-k    #<--Live kernelor root# mdb-k #<--kmdb    

In this case can only ask Niang and qwant (not at home Google), fortunately found the red Hat Enterprise Linux 7 Kernel Crash Dump Guide. So follow guide's tips step by step. An introduction to Kdump is as follows:

1. Check if Kexec-tools is installed

rpm-q kexec-toolskexec-tools-2.0.7-50.el7.x86_64

I am using CentOS 7, which is installed by default.

2. Installing System-config-kdump

Yum Install System-config-kdump

3. Kdump configuration via GUI (goto Applications->system tools->kernel crash dumps)

Choose Basic Settings-Manual Settings, set the new Kdump memory to 128M, use the default settings, and click Apply

Click Apply, you will encounter "unable to handle Kdump services" error, ignore, next need reboot

Check to see if Kdump is active

[Email protected] tmp]# Systemctl is-active kdumpfailed

4. Reboot

5. After reboot, check again if Kdump is active

Extension: Solaris/linux tool chain Comparison

# Solaris Linux (CentOS)
1 Cc Gcc
2 Dbx Gdb
3 Mdb Crash
4 DTrace Systemtab, Ftrace
5 Truss Strace

Resources:

1. Red Hat Enterprise Linux 7 Kernel Crash Dump Guide

2. Analyzing Linux kernel crash dumps with crash-the One tutorial that have it all

3. Http://elixir.free-electrons.com/linux/v4.12-rc3/source/Documentation/kdump/kdump.txt

4. Https://github.com/crash-utility/crash

From MDB to crash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.