Math Is Hard
2 days ago
- #VAX Architecture
- #Exception Handling
- #Kernel Development
- Kernel developers must handle platform-specific details, including processor architecture shortcomings.
- The VAX exception model distinguishes between traps (non-recoverable) and faults (recoverable) like page faults.
- A bug in OpenBSD on VAX caused SIGFPE loops when the signal was ignored, requiring the kernel to skip the faulting instruction.
- Fixed in 2002 by manually advancing the program counter via instruction disassembly in the kernel.
- The issue arose from VAX hardware evolution: early models treated all arithmetic exceptions as traps, but later changes introduced fault behavior.
- The fix was complex due to variable-length VAX instructions and lack of hardware support for next instruction address.
- Historical context suggests Digital prioritized VMS over BSD, contributing to delayed awareness of the issue.