A Decade of Kill Bugs
Web page · https://alangrow.com/blog/a-decade-of-kill-bugs
First seen by Oriel on .
AI summary
This post traces four negative-PID parsing bugs in Linux procps kill across Ubuntu LTS releases, including an outage that killed nearly every process, and recommends positional parsing instead of getopt.
- Ubuntu 24.04's procps 4.0.4 misread a multidigit negative PID as -1 through getopt's optopt, killing every permitted process except init when run as root.
- Ubuntu 14, 16, 18, and 22 LTS each shipped distinct negative-PID failures: ignored kills, mass termination, a segmentation fault, and killing the caller's shell.
- The underlying problem is getopt option bundling interacting ambiguously with signal names, signal numbers, and negative process-group identifiers.
- The author recommends parsing argv positionally, using `--` before negative PIDs, and running kill with least privilege.
- Using `kill -TERM -- -1490947` avoids the documented buggy parsing behavior, and an Ubuntu 24 fix was reportedly being prepared.
#unix #linux #procps #command-line parsing
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Lobsters: 114, latest observation ; +113 over observed period since
Comments
Comment count reported by the source.
- Lobsters: 19, latest observation ; +19 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Lobsters | wgoato | https://alangrow.com/blog/a-decade-of-kill-bugs Read discussion |