conv.

All stories
TechQuiet 4d · day 6

Alan Grow documents decade of kill command bugs in Ubuntu LTS releases

A single outage traced to a parsing flaw that misparsed negative process group IDs as -1, killing all but init—a bug pattern repeated across six Ubuntu versions.

What to know

  • A single kill command with a negative process group ID was misparsed by procps's getopt implementation, resulting in -1 being sent as the pid—which Unix interprets as a signal to all processes except init, nearly crashing the machine.
  • The root cause—getopt truncating unrecognized options to a single character—shipped in the same form across six Ubuntu LTS releases (14, 16, 18, 22, 24) over a decade, suggesting systematic gaps in option parsing testing.
  • The bug occurred because negative pids used for process group signaling were misinterpreted as unrecognized options, exposing a friction between Unix convention and the getopt standard library approach.

The dispute Whether the root cause is getopt's design philosophy or the absence of regression testing discipline. · positions read across 20 posts and comments

some voices

Getopt design is fundamentally at fault for this family of bugs.

  • “I do regard getopt dogma as the real root cause of the outage.”

    dreugeworst · Reddit ↗
some voices

The bug persists because option parsing tests were never added after the initial fixes.

  • “I would also blame the fact that apparently option parsing tests weren't added to the project even after fixing these bugs”

    dreugeworst · Reddit ↗

Alan Grow Endcrawl engineer and investigatorprocps maintainers Maintainers of /bin/kill in Ubuntu

How it unfolded 1 development · click the chart to see its coverage postscomments

Peak 3 pieces in two hours at Nov 3, 7 AM; 27 pieces over 6 days (7 posts · 20 comments) Nov 2, 3 PM — 2 pieces · 2 posts — Hacker News 1, Lobsters 1Nov 2, 5 PM — 2 pieces · 2 comments — Lobsters 2Nov 2, 7 PM — 1 piece · 1 post — Reddit 1Nov 2, 9 PM — 1 piece · 1 comment — Lobsters 1Nov 2, 11 PM — 1 piece · 1 comment — Lobsters 1Nov 3, 1 AM — 1 piece · 1 post — Hacker News 1Nov 3, 3 AM — 2 pieces · 2 comments — Lobsters 1, Reddit 1Nov 3, 5 AM — 1 piece · 1 comment — Lobsters 1Nov 3, 7 AM — 3 pieces · 3 comments — Lobsters 3Nov 3, 9 AM — 3 pieces · 3 comments — Lobsters 3Nov 3, 11 AM — 1 piece · 1 comment — Lobsters 1Nov 3, 1 PM — 3 pieces · 1 post · 2 comments — Lobsters 2, Hacker News 1Nov 3, 3 PM — quietNov 3, 5 PM — quietNov 3, 7 PM — 1 piece · 1 comment — Lobsters 1Nov 3, 9 PM — quietNov 3, 11 PM — quietNov 4, 1 AM — quietNov 4, 3 AM — 2 pieces · 2 comments — Lobsters 2Nov 4, 5 AM — quietNov 4, 7 AM — quietNov 4, 9 AM — quietNov 4, 11 AM — 1 piece · 1 comment — Lobsters 1Nov 4, 1 PM — 1 piece · 1 post — Mastodon 1Nov 4, 3 PM — 1 piece · 1 post — Hacker News 1Nov 4, 5 PM — quietNov 4, 7 PM — quietNov 4, 9 PM — quietNov 4, 11 PM — quietNov 5, 1 AM — quietNov 5, 3 AM — quietNov 5, 5 AM — quietNov 5, 7 AM — quietNov 5, 9 AM — quietNov 5, 11 AM — quietNov 5, 1 PM — quietNov 5, 3 PM — quietNov 5, 5 PM — quietNov 5, 7 PM — quietNov 5, 9 PM — quietNov 5, 11 PM — quietNov 6, 1 AM — quietNov 6, 3 AM — quietNov 6, 5 AM — quietNov 6, 7 AM — quietNov 6, 9 AM — quietNov 6, 11 AM — quietNov 6, 1 PM — quietNov 6, 3 PM — quietNov 6, 5 PM — quietNov 6, 7 PM — quietNov 6, 9 PM — quietNov 6, 11 PM — quietYesterday, 1 AM — quietYesterday, 3 AM — quietYesterday, 5 AM — quietYesterday, 7 AM — quietYesterday, 9 AM — quietYesterday, 11 AM — quietYesterday, 1 PM — quietYesterday, 3 PM — quietYesterday, 5 PM — quietYesterday, 7 PM — quietYesterday, 9 PM — quietYesterday, 11 PM — quietToday, 1 AM — quietToday, 3 AM — quietToday, 5 AM — quietToday, 7 AM — quietToday, 9 AM — quiet 1
Nov 3Nov 4Nov 5Nov 6yesterdaynow · 11:26 AM ET
  1. 1

    Community identifies getopt dogma and lack of testing as systemic issues

    Commenters identify the underlying problem: reliance on getopt for option parsing and the absence of regression tests for option parsing after previous fixes were applied.

    “I do regard getopt dogma as the real root cause of the outage. I would also blame the fact that apparently option parsing tests weren't added to the project even after fixing these bugs…”
    — dreugeworst
    • Oh dear, this is the kind of slapstick that’s so painfully cringe it’s just sad. I was a bit surprised by the early history: my guess would have been that killing a negative PID was introduced with the rest of the process group / job control features in BSD in the early 1980s. So I had a look in the CSRG archives: * userland kill(1) gained support…

      fanfhistorical,linux,unix5d ago35▲view on Lobsters ↗
    2 more of the top 3 · 20 posts in this stretch
    • I do regard getopt dogma as the real root cause of the outage. I would also blame the fact that apparently option parsing tests weren't added to the project even after fixing these bugs

      dreugeworstr/programming5d agoview on r/programming ↗
    • I thought this was a great article. I appreciate the length they went to digging into the topic and contextualized it with historical facts. Like I didn’t know process groups were a thing and have been a thing since 1986. So much more to learn about. Thanks for sharing.

      wonkhistorical,linux,unix5d ago16▲view on Lobsters ↗
    all of them →
  2. background

    Alan Grow publishes detailed post mortem and recommendations — Grow publishes 'A Decade of Kill Bugs' documenting the outage, root cause analysis, and the historical pattern of the same bug across six Ubuntu versions. The post circulates on Lobsters, Hacker News, and Reddit.

  3. background

    Same bug pattern found across multiple Ubuntu LTS versions — The root cause analysis uncovered that the same kill command bug shipped in Ubuntu 14, 16, 18, 22, and 24 LTS releases, representing a decade-long pattern of the same vulnerability.

  4. background

    Root cause identified: getopt parsing truncates negative PID to single character — Investigation revealed that procps 4.0.4's kill implementation mishandles unrecognized options. The getopt() function places only the first character after the dash into optopt, so -1490947 becomes character comparison resulting in pid -1, which Unix interprets as a signal to all processes except init.

  5. background

    Kill command with negative PID misparsing triggers Endcrawl outage — Alan Grow attempted to cancel a process group render using a negative process group identifier (pgid) but the kill command misparsed the argument, killing nearly all processes on the machine except init. A second outage followed shortly after.

What people are saying 17 voices from 1 site · best of 20 · verbatim

Still unanswered
  • Why were option parsing tests not added to procps after the initial bug fixes?
  • Should Ubuntu or procps maintainers have caught this pattern across six releases?