DTrace can be used to find the root cause of a BAD TRAP Solaris 10 system crash. Most BAD TRAP panics are caused by one kernel module clobbering kernel memory containing a pointer. When this now bad pointer gets used later, the result is a BAD TRAP kernel panic. One possible way to find the root cause of this type of system crash is to turn on kernel memory auditing through the kmem_flags kernel tunable. Common memory access bugs that can be detected with these flags are:
I will demonstrate the power of mdb(1) by displaying kernel data structures related to virtual memory (VM) in order to show how to dump the contents of any running application's memory or any page of memory in general. As an example I will run a simple shell script that I will end up locating in the shell's heap. When I first figured out this example, it was an educated guess on my part that a shell script would end up in the heap of the shell interpreter. The file name of an interpreter script (files starting with #!) gets passed to the invoked interpreter as one of its arguments.