BSDCan2008 - Final - we hope

BSDCan 2008
The Technical BSD Conference

Speakers
John Baldwin
Schedule
Day Talks - 2 (2008-05-17)
Room B
Start time 15:00
Duration 01:00
Info
ID 70
Event type lecture
Track Hacking
Language en
Feedback

Introduction to Debugging the FreeBSD Kernel

Just like every other piece of software, the FreeBSD kernel has bugs. Debugging a kernel is a bit different from debugging a userland program as there is nothing underneath the kernel to provide debugging facilities such as ptrace() or procfs. This paper will give a brief overview of some of the tools available for investigating bugs in the FreeBSD kernel. It will cover the in-kernel debugger DDB and the external debugger kgdb which is used to perform post-mortem analysis on kernel crash dumps.

Introduction to Debugging the FreeBSD Kernel

  • Basic crash messages, what a crash looks like
    • typical panic() invocation
    • page fault example
  • "live" debugging with DDB
    • stack traces
    • ps
    • deadlock examples
    • show lockchain
    • show sleepchain
    • Adding new DDB commands
  • KGDB
    • inspecting processes and threads
    • working with kernel modules
    • using scripts to extend
  • examining crashdumps using utilities
    • ps, netstat, etc.
  • debugging strategies
    • kernel crashes
    • system hangs