kdump ktrace.out a.out

提供: FreeBSD入門
移動: 案内検索
スポンサーリンク


Hello World プログラムを ktrace して記録された ktrace.outkdump コマンドでデコードした例です。


概要

Hello World プログラムを ktrace して記録された ktrace.outkdump コマンドでデコードした例です。

使い方

RET や CALL などのオペレーションの意味は、 kdump を参照してください。

% kdump
  3899 ktrace   RET   ktrace 0
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/local/sbin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/local/bin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/sbin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/bin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/sbin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/bin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/games/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/X11R6/bin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/home/secure/s/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "/usr/local/apache2/bin/a.out"
  3899 ktrace   RET   execve -1 errno 2 No such file or directory
  3899 ktrace   CALL  execve(0xbfbfe238,0xbfbfe778,0xbfbfe780)
  3899 ktrace   NAMI  "./a.out"
  3899 ktrace   NAMI  "/libexec/ld-elf.so.1"
  3899 a.out    RET   execve 0
  3899 a.out    CALL  mmap(0,0x8000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0)
  3899 a.out    RET   mmap 671481856/0x28060000
  3899 a.out    CALL  issetugid
  3899 a.out    RET   issetugid 0
  3899 a.out    CALL  lstat(0x28065000,0xbfbfd378)
  3899 a.out    NAMI  "/etc"
  3899 a.out    STRU  struct stat {dev=98, ino=1041920, mode=drwxr-xr-x , nlink=20, uid=0, gid=0, rdev=4167688, atime=1332581274, stime=1368894574, ctime=1368894574, birthtime=1325575620, size=2048, blksize=32768, blocks=8, flags=0x0 }
  3899 a.out    RET   lstat 0
  3899 a.out    CALL  lstat(0x28065000,0xbfbfd378)
  3899 a.out    NAMI  "/etc/libmap.conf"
  3899 a.out    RET   lstat -1 errno 2 No such file or directory
  3899 a.out    CALL  open(0x2805bd6d,0<O_RDONLY>,<unused>0)
  3899 a.out    NAMI  "/var/run/ld-elf.so.hints"
  3899 a.out    RET   open 3
  3899 a.out    CALL  read(0x3,0xbfbfdd6c,0x80)
  3899 a.out    GIO   fd 3 read 128 bytes
       0x0000 4568 6e74 0100 0000 8000 0000 aa00 0000 0000 0000 a900 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000  |Ehnt..........................................................|
       0x003e 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000  |..............................................................|
       0x007c 0000 0000                                                                                                                                                   |....|
 
 3899 a.out    RET   read 128/0x80
  3899 a.out    CALL  lseek(0x3,0x80,SEEK_SET,0)
  3899 a.out    RET   lseek 128/0x80
  3899 a.out    CALL  read(0x3,0x28062300,0xaa)
  3899 a.out    GIO   fd 3 read 170 bytes
       "/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/R/lib:/usr/local/lib/compat:/usr/local/lib/gcc46:/usr/local/lib/gcc48:/usr/local/lib/mysql:/usr/local/lib/pth\0"
  3899 a.out    RET   read 170/0xaa
  3899 a.out    CALL  close(0x3)
  3899 a.out    RET   close 0
  3899 a.out    CALL  access(0x28065000,0<F_OK>)
  3899 a.out    NAMI  "/lib/libc.so.7"
  3899 a.out    RET   access 0
  3899 a.out    CALL  open(0x28061020,0<O_RDONLY>,<unused>0)
  3899 a.out    NAMI  "/lib/libc.so.7"
  3899 a.out    RET   open 3
  3899 a.out    CALL  fstat(0x3,0xbfbfe00c)
  3899 a.out    STRU  struct stat {dev=98, ino=2749088, mode=-r--r--r-- , nlink=1, uid=0, gid=0, rdev=11001496, atime=1368894594, stime=1368872575, ctime=1368872583, birthtime=1368872575, size=1218588, blksize=32768, blocks=2496, flags=0x20
000 }
  3899 a.out    RET   fstat 0
  3899 a.out    CALL  mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE>,0x3,0,0)
  3899 a.out    RET   mmap 671514624/0x28068000
  3899 a.out    CALL  mmap(0,0x12a000,0<PROT_NONE>,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0,0)
  3899 a.out    RET   mmap 671518720/0x28069000
  3899 a.out    CALL  mmap(0x28069000,0x10d000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE>,0x3,0,0)
  3899 a.out    RET   mmap 671518720/0x28069000
  3899 a.out    CALL  mmap(0x28176000,0x7000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED>,0x3,0x10c000,0)
  3899 a.out    RET   mmap 672620544/0x28176000
  3899 a.out    CALL  mmap(0x2817d000,0x16000,0x3<PROT_READ|PROT_WRITE>,0x1012<MAP_PRIVATE|MAP_FIXED|MAP_ANON>,0xffffffff,0,0)
  3899 a.out    RET   mmap 672649216/0x2817d000
  3899 a.out    CALL  munmap(0x28068000,0x1000)
  3899 a.out    RET   munmap 0
  3899 a.out    CALL  close(0x3)
  3899 a.out    RET   close 0
  3899 a.out    CALL  mmap(0,0x11000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0)
  3899 a.out    RET   mmap 672739328/0x28193000
  3899 a.out    CALL  sysarch(0xa,0xbfbfe090)
  3899 a.out    RET   sysarch 0
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe06c)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe03c)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe03c)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  fstat(0x1,0xbfbfe5c0)
  3899 a.out    STRU  struct stat {dev=1895890688, ino=113, mode=crw--w---- , nlink=1, uid=1001, gid=4, rdev=113, atime=1369465141, stime=1369465141, ctime=1369465141, birthtime=-1, size=0, blksize=4096, blocks=0, flags=0x0 }
  3899 a.out    RET   fstat 0
  3899 a.out    CALL  readlink(0x2816b3b9,0xbfbfe196,0x400)
  3899 a.out    NAMI  "/etc/malloc.conf"
  3899 a.out    RET   readlink -1 errno 2 No such file or directory
  3899 a.out    CALL  issetugid
  3899 a.out    RET   issetugid 0
  3899 a.out    CALL  break(0x8049620)
  3899 a.out    RET   break 0
  3899 a.out    CALL  break(0x8400000)
  3899 a.out    RET   break 0
  3899 a.out    CALL  mmap(0,0x400000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0)
  3899 a.out    RET   mmap 672808960/0x281a4000
  3899 a.out    CALL  mmap(0x285a4000,0x25c000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0)
  3899 a.out    RET   mmap 677003264/0x285a4000
  3899 a.out    CALL  munmap(0x281a4000,0x25c000)
  3899 a.out    RET   munmap 0
  3899 a.out    CALL  ioctl(0x1,TIOCGETA,0xbfbfe5f0)
  3899 a.out    RET   ioctl 0
  3899 a.out    CALL  write(0x1,0x28405000,0xc)
  3899 a.out    GIO   fd 1 wrote 12 bytes
       "Hello World
       "
  3899 a.out    RET   write 12/0xc
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe60c)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe5cc)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_BLOCK,0x2805f920,0xbfbfe5cc)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  sigprocmask(SIG_SETMASK,0x2805f930,0)
  3899 a.out    RET   sigprocmask 0
  3899 a.out    CALL  exit(0)

関連項目




スポンサーリンク