Monday, March 17, 2014

Crash Utility: How to view user space back trace


Step 1) Download gcore extension from,

Step 2) To build the module from the top-level crash- directory, enter:
  $ tar xzf crash-gcore-command-1.2.2.tar.gz
  $ mv crash-gcore-command-1.2.2/* extensions
  $ make extensions

Step 3) Extend gcore command as follows from crash command prompt,
crash> extend /projects/mobcom_andrwks_ext8/users/arunks/crashutility/src/crash_utility/extensions/gcore.so

Step 4) Use gcore command to dump the user core dump file
            $gcore 1291
            Where 1291 is the pid of the process. This creates a file core.1291.init

Step 5) Use gdb to view the back trace. Pass elf and the core dump file to gdb as follows
            $ arm-none-linux-gnueabi-gdb /projects/mobcom_andrwks_ext8/users/arunks/bringup_eos2b/android/out/target/product/amethyst/obj/EXECUTABLES/init_intermediates/LINKED/init core.1291.init

Step 6) view back trace by bt command.
(gdb) bt
#0  umount2 () at bionic/libc/arch-arm/syscalls/umount2.S:10
#1  0x0000e0a0 in check_fs (blk_device=0x648b0 "/dev/block/platform/e6bd0000.mmcif/by-name/MODEMLOG", fs_type=0x64900 "ext4", target=0x648e8 "/mnt/modemlog") at system/core/fs_mgr/fs_mgr.c:512
#2  0x0000e7ea in fs_mgr_mount_all (fstab=0x645c0) at system/core/fs_mgr/fs_mgr.c:512
#3  0x0000873a in do_mount_all (nargs=Unhandled dwarf expression opcode 0xf3
) at bionic/libc/include/string.h:217
#4  0x0000992a in execute_one_command () at system/core/init/init.c:939
#5  0x00009e56 in main (argc=Unhandled dwarf expression opcode 0xf3
) at system/core/init/init.c:939

(gdb)

No comments: