Math Is Hard – OpenBSD Stories

· math · Source ↗

TLDR

  • OpenBSD developer retrospective on arithmetic correctness pitfalls encountered in kernel and systems code, where math edge cases bite hard.

Key Takeaways

  • The title signals a recurring theme in low-level OpenBSD work: arithmetic that looks straightforward turns out to have silent failure modes.
  • Kernel-level math bugs carry higher stakes than application-level ones, with fewer safety nets between wrong arithmetic and system misbehavior.
  • “Stories” framing suggests multiple concrete incidents rather than a single bug writeup, likely covering integer overflow, signed/unsigned mismatch, or floating-point fault handling.
  • OpenBSD’s culture of auditing and correctness makes it a productive source for these kinds of hard-won edge-case lessons.

Hacker News Comment Review

  • Commenters pushed back gently on kernel mystique: the consensus was that kernel programming is approachable but demands mastery of hardware specs and manuals that app programmers rarely touch.
  • A thread on VMS arithmetic fault handling emerged, specifically whether VMS programs could mask SIGFPE-equivalent faults on VAX, pointing to how different OS lineages made incompatible tradeoffs on arithmetic fault recovery.
  • One commenter used this as a springboard to lament the absence of post-UNIX OS innovation, arguing the 1990s avalanche of new OS research never materialized into lasting alternatives.

Notable Comments

  • @somat: Asks whether VMS programs ever had a path to recover from arithmetic faults, or if masking SIGFPE-equivalent signals was simply not supported on VAX VMS.
  • @globalnode: “kernel programming isnt that much harder than app programming, just more manuals to read and hardware to understand.”

Original | Discuss on HN