After writing this entry, I was thinking how we can improve 'bt' command of the crash utility.
I wrote an LDAS (Linux Dump Analysis Script) of Alicia, btx.ldas, as an alternative of 'bt'. (btx.ldas is available at this URL as usual.)
Roughly speaking, btx.ldas is a filter of 'bt' command results. The basic idea is that there are return addresses on the right most colums and that means there should be call instructions just before the address. Furthermore, it's possible to check whether a supposed return address is really correct can by seeing if the operand of a call instruction is the address of the next stack frame or not. That's what btx.ldas does basically. Of couse, there are several technical issues, but as shown in the following, this approach looks to work. :)
The below examples are results by 'btx.ldas' and crash 'bt' command of the same "sendmail" process taken on my PentiumD 930 / FedoraCore 6 (x86_64) box.
(1) crash 'bt' command example
Among the 22 stack frames shown below, there are only 6 correct ones as I wrote in this entry. btx.ldas checks five bytes (size of a call instruction) before the rightmost addresses colored in blue in each stack frame.
(2) btx.ldas result
Below is an example using btx.ldas and Alicia-1.1.5. Extra 16 frames above were suppressed.
No comments:
Post a Comment