Mountain Biking Helps Squash Bugs
Dr.Milius writes "Henning Brauer of the OpenBSD project recently made an interesting post to the openbsd-tech mailing list about how a mountain bike ride helped him relate two baffling bugs in their new BGP and NTP daemons. It turns out they were both off-by-one errors that were easy to fix but notoriously difficult to spot. Always great when the experts show us how it's done."
This is something well known to work. It's not the bike riding, it's the act of "taking a break from the problem." Think back to the origins of "Eureka!"
I, for example, will often go grab a Coke, talk to people, etc, and somewhere along the line, by _not_ focussing so hard on the problem, I come up with the answer.
Error 407 - No creative sig found
As for not using C, I've read that Theo de Raadt likes the compiler and language that is used in Plan 9. Can't use it due to license problems, though.
Most likely the C-dialect compiler that Plan 9 uses. But the AT&T license is too restrictive for Plan 9 code to be imported into BSD, as far as I know.
There are debugging tools out there which reliably find these bugs in C/C++ and FORTRAN. For example:
purify (not free)
valgrind (free)
Tools such as these help to find problems, while avoiding the inefficiency of array bounds checking on each access.
You can use use C++ STL vectors with at() when you want bounds checking or use a direct index when you don't. Thus you can keep the backwards compatability with C and have the choice of sacrificing safety for speed when you need it.
Mel: http://www.catb.org/jargon/html/story-of-mel.html
No debugging tools there, if any tools at all.
Sam ty sig.
Yes I have. I only use them when I am debugging. Then I don't need to implement array bounds checking on the "production" version of the code.
Yes! This can make tweaking your overall algorithm or approach so much easier as well, if these wrapper functions are there, and well defined in their actions. You can never have *too short* a function!
VOS/Interreality project: www.interreality.org