2 ms·
I don't know if it was the hardest bug I've ever tracked down, but I really enjoyed discovering that HP-UX executables have an attribute bit that controls wheth
by twoodfin 13y ago
I don't know if it was the hardest bug I've ever tracked down, but I really enjoyed discovering that HP-UX executables have an attribute bit that controls whether or not they'll segfault upon dereferencing a null pointer. If I'm not mistaken, the non-faulting behavior was the default in their toolchain.
Turns out that HP was also shipping a build of Kerberos/GSS libraries that actually relied on this behavior to function properly, and since our own project linking in these libraries did the sane thing and enabled the faults, the Kerberos code would crash.
I won't forget debugging through the library assembly code, wondering how the hell it ever worked. Luckily my education had included a good survey of the computer architecture zoo, where surely someone once upon a time had thought it was a great idea to spec a zero page at low memory addresses.
And of course today I know enough to never believe that a platform must segfault on a null pointer dereference. C undefined behavior works in mysterious ways.