TECH SOLUTION

TECH SOLUTION

Sunday, 20 October 2013

TROUBLESHOOTING OF HARD KERNEL PANIC



How to Troubleshoot a Hard Kernel Panic

Hard Panics Symptoms:
  •  Machine is completely locked up and unusable. 
  •  Num Lock / Caps Lock / Scroll Lock keys usually blink. 
  •  If in console mode, dump is displayed on monitor (including the phrase Aieee!). 
  •  Similar to Windows Blue Screen. 

Hard panics causes:
  •   The most common cause of a hard kernel panic is when a driver crashes within an interrupt handler,
  •  Usually because it tried to access a null pointer within the interrupt handler.
  •  When this happens, that driver cannot handle any new interrupts and eventually the system crashes.
  •  This is not exclusive to Dialogic drivers.

Hard panics information to collect:
  •  Depending on the nature of the panic, the kernel will log all information it can prior to locking up.
  •  Since a kernel panic is a drastic failure, it is uncertain how much information will be logged.
  •  Below are key pieces of information to collect.
  •  It is important to collect as many of these as possible, but there is no
    guarantee that all of them will be available,

Especially the first time a panic is seen. 
  •   /var/log/messages sometimes the entire kernel panic stack trace will be logged there
  •   Application / Library logs (RTF, cheetah, etc.) may show what was happening before the panic other information about what happened just prior to the panic, or how to reproduce 
  •  Screen dump from console. Since the OS is locked, you cannot cut and paste from the screen.
There are two common ways to get this info: 
  •  Digital Picture of screen (preferred, since it’s quicker and easier) 
    Copying screen with pen and paper or typing to another computer.
  •  If the dump is not available either in /var/log/message or on the screen,

  follow these tips to get a dump:

  •  If in GUI mode, switch to full console mode no dump info is passed to the GUI (not even to GUI shell). 
  •  Make sure screen stays on during full test run
    if a screen saver kicks in, the screen wont return
    after a kernel panic.
  Use these settings to ensure the screen stays on. 
 setterm -blank 0 
 setterm -powerdown 0 
 setvesablank off 

  •   From console, copy dump from screen (see above). 
  •   Hard panics Troubleshooting when a full trace is available
  •  The stack trace is the most important piece of information to use in troubleshooting a kernel panic.
  •  It is often crucial to have a full stack trace,something that may not be available if only a screen dump is provided the top of the stack may scroll off the screen, leaving only a partial stack trace. 
  •   If a full trace is available, it is usually sufficient to isolate root cause.
  •  To identify whether or not you have a large enough stack trace, look for a line with EIP, which will show what function call and module caused the panic.



   In the example below, this is shown in the following line:
Text Box: EIP is at _dlgn_setevmask [streams-dlgnDriver ] 0xe 
If the culprit is a Dialogic driver you will see a
module name with:
streams-xxxxDriver (xxxx = dlgn, dvbm, mercd, etc.)
Hard panic full trace example:
Unable to handle kernel NULL pointer dereference at
virtual address 0000000c
printing eip:
f89e568a
*pde = 32859001
*pte = 00000000
Oops: 0000
Kernel 2.4.9-31enterprise CPU: 1
EIP: 0010:[] Tainted: PF EFLAGS: 00010096
EIP is at _dlgn_setevmask [streams-dlgnDriver ] 0xe 
eax: 00000000 ebx: f65f5410 ecx: f5e16710 edx:
f65f5410
esi: 00001ea0 edi: f5e23c30 ebp: f65f5410 esp:
f1cf7e78
ds: 0018 es: 0018 ss: 0018
Process pwcallmgr (pid: 10334, stackpage=f1cf7000)
Stack: 00000000 c01067fa 00000086 f1cf7ec0 00001ea0
f5e23c30 f65f5410 f89e53ec
f89fcd60 f5e16710 f65f5410 f65f5410 f8a54420 f1cf7ec0
f8a4d73a 0000139e
f5e16710 f89fcd60 00000086 f5e16710 f5e16754 f65f5410
0000034a f894e648
Call Trace: [setup_sigcontext+ 218/288]
setup_sigcontext [kernel] 0xda
Call Trace: [] setup_sigcontext [kernel] 0xda
[] dlgnwput [streams-dlgnDriver ] 0xe8
[] Sm_Handle [streams-dlgnDriver ] 0¡Á1ea0
[] intdrv_lock [streams-dlgnDriver ] 0¡Á0
[] Gn_Maxpm [streams-dlgnDriver ] 0¡Á8ba
[] Sm_Handle [streams-dlgnDriver ] 0¡Á1ea0
[] lis_safe_putnext [streams] 0¡Á168
[] __insmod_streams- dvbmDriver_ S.bss_L117376
[streams-dvbmDriver ] 0xab8 [] dvbmwput
[streams-dvbmDriver ] 0¡Á6f5
[] dvwinit [streams-dvbmDriver ] 0¡Á2c0
[] lis_safe_putnext [streams] 0¡Á168
[] lis_strputpmsg [streams] 0¡Á54c
[] __insmod_streams_ S.rodata_ L35552 [streams] 0¡Á182e
[] sys_putpmsg [streams] 0¡Á6f
[system_call+ 51/56] system_call [kernel] 0¡Á33
[] system_call [kernel] 0¡Á33
Nov 28 12:17:58 talus kernel:
Nov 28 12:17:58 talus kernel:
Code: 8b 70 0c 8b 06 83 f8 20 8b 54 24 20 8b 6c 24 24
76 1c 89 5c 
 





































  
 Hard panics Troubleshooting when a full trace is not available

If only a partial stack trace is available, it can be tricky to isolate the root cause, since there is no explicit information about what module of function
call caused the panic.
Instead, only commands leading up to the final command will be seen in a partial
stack trace.
In this case, it is very important to collect as much information as possible about what happened leading up to the kernel panic (application
logs, library traces, steps to reproduce, etc).

  Hard panic partial trace example (note there is no line with EIP information)


[] ip_rcv [kernel] 0¡Á357
[] sramintr [streams_dlgnDriver ] 0¡Á32d
[] lis_spin_lock_ irqsave_fcn [streams] 0¡Á7d
[] inthw_lock [streams_dlgnDriver ] 0¡Á1c
[] pwswtbl [streams_dlgnDriver ] 0¡Á0
[] dlgnintr [streams_dlgnDriver ] 0¡Á4b
[] Gn_Maxpm [streams_dlgnDriver ] 0¡Á7ae
[] __run_timers [kernel] 0xd1
[] handle_IRQ_event [kernel] 0¡Á5e
[] do_IRQ [kernel] 0xa4
[] default_idle [kernel] 0¡Á0
[] default_idle [kernel] 0¡Á0
[] call_do_IRQ [kernel] 0¡Á5
[] default_idle [kernel] 0¡Á0
[] default_idle [kernel] 0¡Á0
[] default_idle [kernel] 0¡Á2d
[] cpu_idle [kernel] 0¡Á2d
[] __call_console_ drivers [kernel] 0¡Á4b
[] call_console_ drivers [kernel] 0xeb
Code: 8b 50 0c 85 d2 74 31 f6 42 0a 02 74 04 89 44 24
08 31 f6 0f
<0> Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing 






  Hard panics using kernel debugger (KDB)

  •  If only a partial trace is available and the supporting information is not sufficient to isolate root cause,
  •  it may be useful to use KDB. KDB is a tool that is compiled into the kernel that causes the kernel to break into a shell rather than lock up when a panic occurs.
  •  This enables you to collect additional information about the panic, which is often useful in determining root cause. 

Some important things to note about using KDB: 

  1. If this is a potential Dialogic issue, technicalsupport should be contacted prior to the to use of KDB Must use base kernel i.e. 2.4.18 kernel insteadof 2.4.18-5 from RedHat.
  2. This is because KDB is only available for the base kernels, and not the builds created by RedHat. While this does create a slight deviation from the original configuration, it usually does not interfere with root cause analysis. 
  3. Need different Dialogic drivers compiled to handle the specific kernel.

No comments:

Post a Comment