Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3217674
  • 博文数量: 443
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 5679
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-08 12:30
个人简介

欢迎加入IT云增值在线QQ交流群:342584734

文章分类

全部博文(443)

文章存档

2022年(1)

2021年(1)

2015年(2)

2014年(1)

2013年(1)

2012年(4)

2011年(19)

2010年(32)

2009年(2)

2008年(4)

2007年(31)

2006年(301)

2005年(42)

2004年(2)

分类:

2006-09-27 10:18:44

ST-370
Course Objectives
Upon completion of this course, you should be able to:
Set up your system to capture kernel core dumps
Gather and interpret kernel core dumps to a probable cause using
adb and kadb macros
Create adb macros to aid and simplify kernel core dump analysis
Follow an organized approach in analyzing kernel core dumps


Cuase of Panic

userdata<----works with------user code/libraries                  //Problems cause application crash and application core file
                                    |  
                                    |  calls
                                    |
                                    V
                             System call interface
                                    |  
                                    |  calls
                                    |
                                    V
Kernel data<-----work with-----Kernel code                       //Problem cause panic and kernel core file                                      

Panic的原因:1)保护系统一致性(integrity safeguards)
                Unix内核遇到其不可处理的情况,为了不使问题扩大化,破坏数据。最好的办法不是试图去纠错,而是中断执行,调用系统的panic,将系统的CPU和内存状况dump出来,以备分析。
                2) 坏的陷入(bad trap)
                在不恰当的时候发生的trap是bad trap。常见的bad trap是不可恢复的内存错误。虽然Sun机器都有ECC保护,但若发生多于2个bit的内存错误,系统无法纠错。
               
Panic的过程:1)Panic Messages
               内核调用panic给的描述性参数。
             2)Stack Traceback
               纪录调用堆栈。指明那些调用涉及此次Panic。
             3)Dump
               内核sync文件系统缓存并向dumpdevice写内存数据。
             4)Reboot
               dump完成后,系统试图reboot,当然有的时候系统关键部件损坏,系统不能正常reboot或连续reboot。
           
对于我们系统维护人员而言,分析core dump不是我们的任务。我们的任务是将core dump抓下来,让厂商分析。

How to enable save core
1. As for solaris 6 or earlier release,modify /etc/init.d/sysetup

DEFAULT:
  ##
  ## Default is to not do a savecore
  ##
  #if [ ! -d /var/crash/`uname -n` ]
  #then mkdir -p /var/crash/`uname -n`
  #fi
  #                echo 'checking for crash dump...\c '
  #savecore /var/crash/`uname -n`
  #                echo ''  

YOU WANT:
  #
  #Default is to not do a savecore
  #
  if [ ! -d /var/crash/`uname -n` ]
  then mkdir -p /var/crash/`uname -n`
  fi
                  echo 'checking for crash dump...\c '
  savecore /var/crash/`uname -n`
                  echo ''  

  Core dump文件(vmcore.n and unix.n)存在/var/crash/`uname -n`/下面。
2. As for Solaris 7&8&9,man dumpadm for more information.
  例如察看当前设置
    #dumpadm
    Dump content: kernel pages
    Dump device: /dev/dsk/c0t3d0s1 (swap)
    Savecore directory: /var/crash/dellboy
    Savecore enabled: yes
  例如改变配置
    # dumpadm -c all -d /dev/dsk/c0t0d0s2 -s /export/cores
    Dump content: all pages
    Dump device: /dev/dsk/c0t0d0s2 (dedicated)
    Savecore directory: /export/cores
    Savecore enabled: yes

How to test save core enabled
1. backup you most valuable data.
2. sync file system #sync;sync;sync
3. #halt or STOP-A
4. OK>;sync
5. system will reboot. check /var/adm/`uname -n`。

What the size of core dump:
1. 必定小于内存大小。
2. 取决于你需要dump的内容,如只是kernel页面还是所有页面。
3. 通常200-300MB(凭记忆)

比panic还讨厌的是系统hang。至于原因也不是我们关心的。我们关心的是如何将core文件抓下来。假设你已经打开了save core 的选项。注意:Solaris6和以前版本缺省是不打开的,而Solaris7和以后版本是打开的。
1)最最简单的方法。STOP-A. 在OK状态下敲如sync。
2)不幸的是STOP-A不起作用。拔掉键盘然后在将键盘插回去。听到嘟的一声后,在OK状态下敲如sync。
3)更不幸的是方法2也不起作用。最后一招,如果是Enterprise系列的机器,拔系统板。可能会掉到OK状态,在OK状态下敲如sync。
4)如果上述方法均不见效。
  if 如果你有服务 then Call 800-810-0035 Sun公司服务热线
  elseif 没有服务但可以花钱 then 联系Sun本地的服务部门
  else 关机重起
阅读(5640) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~