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

Mesa News

  • Mesa 13 Lands In Fedora 25
    While it was disappointing that Fedora 25 shipped with Mesa 12.0, the Mesa 13.0 version has now been sent down as a stable release update.
  • Stable Mesa PPA Offers Latest Drivers on Ubuntu
    Games company Feral Interactive’s call for a PPA be set up to offer the latest Stable Mesa drivers on Ubuntu has been semi-answered. Emphasis on semi, there. As noted by Gaming on Linux, a new stable Mesa PPA is now available — hurrah — but it is not “official” in the way that the stress-tested Nvidia drivers PPA is — boo.
  • Ubuntu now has a community-built PPA for stable versions of Mesa
    Feral Interactive's call for a stable Mesa PPA has already made progress, as there's now a stable PPA available for Mesa. Paulo Dias "Padoka" has setup another PPA here: https://launchpad.net/~paulo-miguel-dias/+archive/ubuntu/pkppa Note: This is a community-run PPA, so it's possible it may someday go out of date and/or have issues at times. This is likely a stop-gap measure until something more official is done. It currently hosts Mesa 13.0.2 and LLVM 3.9 along with RADV and ANV the AMD and Intel open source Vulkan drivers.

ROSA Desktop Fresh R8 Plasma 5: is it near-perfect?

ROSA is a Linux distribution forked some time ago from Mandriva Linux by a team of Russian developers, Rosa Lab, or officially LLC NTC-IT ROSA. I reviewed their distributions several times: ROSA KDE R7, ROSA Desktop 2012 and even interviewed the ROSA team. The most recent release of ROSA is now ROSA Desktop Fresh R8, which is available in several flavours: MATE, GNOME 3, KDE 4 and Plasma 5. I decided to try the Plasma 5 edition of this distribution, especially as my interest to Plasma increased after the good impression Kubuntu 16.10 left on me. There are links to the ISO images available on the ROSA download page, and I used it to get my own version of this Linux distribution. The size of ROSA Desktop Fresh R8 Plasma 5 64-bit image is 1.9 Gb. The dd command helped me to "burn" the image to the USB stick. So, the USB drive is attached to my Toshiba Satellite L500-19X laptop. Reboot. Choose to boot from USB. Let's go! Read more

Korora 25 Unleashed, Best KDE Distro, Notorious B.U.G.

Fedora-based Korora 25 was released Wednesday in 64-bit versions. Users are urged to upgrade. Elsewhere, Jack Wallen was seriously impressed by Fedora 25 and blogger DarkDuck said ROSA R8 is "near-perfect." Bruce Byfield discussed obstacles to Linux security just as a new kernel vulnerability comes to light. Dedoimedo declared the best KDE distro of 2016 and FOSSBYTES has 10 reasons to use Ubuntu. Read more

OnePlus 3T review: One of the best Android phones gets a little better

OnePlus has never been one to play by the rules. Back when it made its entrance into the crowded smartphone market with the One, it set itself apart by selling a premium handset at a mid-tier price and offering invitation-only purchases instead of the standard preorders. The 3T very much fits with this rebellious nature. Essentially a refreshed version of the 6-month-old OnePlus 3, the new phone undermines another smartphone constant: the yearly update. iPhone users are familiar with the concept of the mid-cycle model—a handset that keeps the same enclosure but beefs up features and internal components. But there’s always been a special hook with Apple’s S phones, a reason for current owners to rush out and buy the new model. The 3T could be seen as OnePlus’ attempt to mimic the success Apple has had with the formula (and in fact, the company says it picked T for the new phone’s surname simply because it’s a letter higher than S). Read more