crash(1M) command on Linux?
A politically incorrect answer would be that Linux does not have a real need for crash(1M), crash(*) in general. Getting more serious, though, agreed that there isn't a crash(1M), but there exist enough utilities and/or schemes to facilitate debugging and profiling of the Linux kernel, and the Linux/GNU (politically correctly) system in general.
On System V'ish systems (maybe others, why not), crash(1M)
can be "used to examine the system memory image of a running or a crashed system by formatting and printing control structures, tables, and other information", as the manual says. On Linux, this, and much more capability is provided by a gamut of several kernel level features and user level utilities. A partial list follows.
- The most important point is that you have (if you like, that is) the source
code for the Linux kernel, so you may fiddle around with anything, and peek at the kernel internals to your heart's content - insert
printk's for all it is worth. Commercial systems do not provide kernel source and hence they have to provide interfaces of dealing with system misbehavior. - Extensive diagnostics are provided by many files in the /proc filesystem, wherein many of the kernel's control structures and tables are there for you to see: preformatted!
- You may use utilities like
straceandlsofto track things like open files and system calls. Of course, these tools, and others similar in functionality (trusson System V) are there on other systems also. There are editors for filesystems which let you see and modify (and corrupt) practically everything. - Debugging the kernel: The GNU debugger (
gdb) can be used to debug the Linux kernel, and why, that's it! When you can actually (remotely or not) debug the kernel, who needs utilities for printing formatted dumps (this part may be considered funny). - The Linux
OOPSfacility: Well, Linux is nice enough to show you a non-blue screen of death (not always, sometimes it would show register values and the works even without panic'ing, like if you insmod a module and a NULL is dereferenced), which is helpful to the serious hackers at least. Further, klogd may be used to trace oops. - The magic SysRQ key: This is a useful add-on to the already cool repertoire of Linux niceties.
/usr/src/linux/Documentation/sysrq.txtfor details. Also, you can profile parts of the kernel.