Community

Torvalds Blows Stack Over Buggy New Kernel

Linux creator Linus Torvalds this week apologized for including in the just-released Linux 4.8 kernel a bug fix that crashed it.

“I’m really sorry I applied that last series from Andrew just before doing the 4.8 release because they cause problems, and now it is in 4.8 (and that buggy crap is marked for stable too),” he wrote in a message to the Linux kernel mailing list. “In particular, I just got this — kernel BUG at ./include/linux/swap.h:276 — and the end result was a dead kernel.”

The bug the dev was trying to fix has existed since Linux 3.15, “but the fix is clearly worse than the bug … since that original bug has never killed my machine,” Torvalds wrote.

The message became increasingly acrimonious as Torvalds displayed the temper for which he’s notorious.

No Excuse

“I should have reacted to the damn added BUG_ON() lines. I suspect I will have to finally just remove the idiotic BUG_ON() concept once and for all, because there is NO F*CKING EXCUSE to knowingly kill the kernel. Why the hell was that not a warning?” he fumed.

Torvalds acknowledged he was “grumpy,” adding that “this went in very late in the release candidates, and I had higher expectations of things coming in through Andrew.”

The reference presumably was to Andrew Morton, one of the Linux kernel’s lead developers.

“Adding random BUG_ON()s to code that clearly hasn’t had sufficient testing is *not* acceptable, and it’s definitely not acceptable to send that to me after rc8 unless it has gotten a *lot* of testing, which it clearly must not have had,” Torvalds continued.

“I’ve ranted against people using BUG_ON() for debugging in the past. Why the f*ck does this still happen? And Andrew – please stop taking those kinds of patches! Lookie here:

lwn.net/Articles/13183/

so excuse me for being upset that people still do this sh*t almost 15 years later,” Torvalds concluded.

The Bug Fix That Wasn’t

It was the addition of the BUG_ON() line that killed the kernel.

BUG() and BUG_ON() are used as debugging help when something goes very wrong in the kernel.

BUG() and BUG_ON() are the same instruction; the former is used in older kernels, and the latter from the 2.6 kernel on.

The instruction is an invalid one, which leads the CPU to throw an invalid opcode exception.

When a BUG_ON() assertion fails, or the code takes a branch with BUG() in it, the kernel will print out the contents of the registers and a stack process — then the current process will die.

“This type of situation, while rare, is common enough in smaller and less visible projects, where testing processes and protocol are typically less sophisticated than those used by Linus and his team,” noted Al Hilwa, a research program director at IDC.

The Grinch Who Rules Linux

Linux has grown dramatically over the 25 years of its existence, but its creator apparently hasn’t seen the need to alter his trademark style of communication with its core developers.

Software development “remains a highly detailed and error-prone process, especially at these lowest levels of systems. Kernel work is [the equivalent of] brain surgery, and it’s not a surprise that it’s still not foolproof,” Hilwa told LinuxInsider.

“Almost all engineers get grumpy about things like this,” he said. “It’s just that this team operates in the open, which is generally a wonderful thing — but we get to see real human emotions in action.”

Richard Adhikari

Richard Adhikari has been an ECT News Network reporter since 2008. His areas of focus include cybersecurity, mobile technologies, CRM, databases, software development, mainframe and mid-range computing, and application development. He has written and edited for numerous publications, including Information Week and Computerworld. He is the author of two books on client/server technology. Email Richard.

1 Comment

  • This is the downside of open source projects. This is almost entirely done by dedicated volunteers and then you have Torvalds complaining about the bugs. Has a new kernel ever not been buggy at first? I was mostly told if you want a stable Linux install stay at least one or more kernel releases behind. If you look at what Dell does with Ubuntu that is their general consensus too. The real issue is lack of user feedback because you have many less testers than say a Windows or even Mac OS beta.

Leave a Comment

Please sign in to post or reply to a comment. New users create a free account.

More by Richard Adhikari
More in Community

LinuxInsider Channels