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

Red Hat: ‘Hybrid Cloud’, University of Alabama, Red Hat Upgrades Ansible and Expectations

Ubuntu GNOME Shell in Artful: Day 14

One of the latest thing we wanted to work on as we highlighted on our previous posts is the notification for new emails or download experience on the Shell. We already do ship the KStatusNotifier extension for application indicator, but need a way to signal the user (even if you are not looking at the screen when this happens) for new emails, IM or download/copy progress. Andrea stepped up on this and worked with Dash to Dock upstream to implement the unity API for this. Working with them, as usual, was pleasing and we got the green flag that it’s going to merge to master, with possibly some tweaks, which will make this work available to every Dash to Dock users! It means that after this update, Thunderbird is handily showing the number of unread emails you have in your inbox, thanks to thunderbird-gnome-support that we seeded back with Sébastien. Read more

Download latest Linux-based LibreELEC Krypton -- Kodi addons like Exodus and Covenant will work

The Kodi media center is facing a lot of scrutiny in the media lately. Some people feel that the negative coverage is "fake news." It is important to remember that Kodi is not illegal. With that said, it can be made so with piracy-related addons. Since Kodi is open source, even if the developers removed the ability to install addons, other people could easily fork the code to add it back. Pandora's box cannot be closed. Many people that use Kodi do so with a dedicated Linux-based operating system, such as the excellent LibreELEC. You see, these distros exist only to run the open source media center, meaning there are no resources wasted on unnecessary things. Today, LibreELEC (Krypton) v8.1.2 BETA sees release. You can install it immediately, and don't worry -- your addons like Exodus and Covenant will work fine. Read more