Language Selection

English French German Italian Portuguese Spanish

Understanding a Kernel OOPS

Filed under
Linux
HowTos

Understanding a kernel panic and doing forensics to catch the bug is considered a hacker‘s job. This is one of those complex tasks that requires a sound knowledge of the architecture you are working on, and the internals of the Linux kernel. Depending the on the type of error detected by the kernel, panics in the Linux kernel are classified as hard panics (Aiee!) and soft panics (Oops!). This article explains a sample Linux kernel oops, and helps to create a simple oops and debug it. It is mainly intended for developers getting into kernel development, who need to debug the panics that the kernel throws at them. Knowledge of the Linux kernel, and C programming, is assumed.

An oops is what the kernel throws at us when it finds something faulty, or an exception, in the kernel code. Oopses are somewhat like the segfaults of user-space. An oops dumps its message on the console; it contains processor status, and CPU registers when the fault occurred. The offending process which triggered this oops gets killed without releasing locks or cleaning up structures. The system may not even resume its normal operations sometimes; this is called an unstable state. Once an oops has occurred, the system cannot be trusted any further.

Let’s try to generate an oops message with sample code, and try to understand the dump.

Setting up the machine to capture an oops

The running kernel should be compiled with CONFIG_DEBUG_INFO, and syslogd should be running. To generate and understand an oops message, let’s throw together a sample kernel module, oops.c:

rest here




More in Tux Machines

Linux and Linux Foundation

KDE and GNOME

Debian Family

  • Devuan GNU/Linux 1.0.0 "Jessie" Just Around the Corner, Release Candidate Out
    It's been five almost five months since the developers behind the Debian-based Devuan GNU/Linux operating system launched the second Beta version towards the first stable release of the OS, and they now announced the Release Candidate. The Devuan project continues its vision of providing a libre Debian fork without using the systemd init system, and the Release Candidate (RC) version brings the GNU/Linux distribution closer to a final release. The interesting fact is that this RC appears to be stable enough to be used for production work.
  • Budgie 10.3 Released, Here’s How to Install it on Ubuntu
    A new version of the Budgie desktop is available to install on Ubuntu. Budgie 10.3 adds a new Alt+Tab switcher, and brings a stack of bug fixes to the table.
  • Ubuntu 17.10 Codename Released "Artful Aardvark"
  • openHAB
    Partners Canonical, openHAB Foundation and Azul Systems have collaborated hard to drive development of the new openHAB 2.0 smart-home platform as a snap package. An alternative to Apple Homekit and Samsung SmartThings, openHAB from openHAB Foundation is completely free and open source, and acts as a control hub for home IoT setups.

Development News