Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Bug Operating Systems Programming BSD IT Technology

Mountain Biking Helps Squash Bugs 82

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 discussion has been archived. No new comments can be posted.

Mountain Biking Helps Squash Bugs

Comments Filter:
  • Bake Cookies! (Score:4, Interesting)

    by maskedbishounen ( 772174 ) on Sunday September 12, 2004 @08:11PM (#10231012)
    On the food aspect, whenever I run into coding problems, I go bake cookies. Helps if you have a near by oven and supply of dough, of course, but it gives you a good 30 minutes to stop and focus on something else. I usually end up pacing around while they bake, looking out the windows, looking around the kitchen, and more oft than not have a viable solution in addition to some fresh cookies when I go back to coding.
  • by cpeterso ( 19082 ) on Monday September 13, 2004 @02:11AM (#10232908) Homepage

    I often find that the bugs that are most difficult to find are the easiest to fix. They are often some tiny corner case in one line of code that someone never thought of.

    In the last product I worked on, we had a killer crash bug that different developers spent WEEKS investigating it, giving up, and then "hot potatoing" the bug to another developer. About two months later, I finally fixed the bug. A BSTR allocated using SysAllocString() should have been freed using SysFreeString(), but it was being "freed" using COM's CoTaskMemFree(). This would corrupt COM's heap causing random COM crashes in unrelated code much later! :(
  • by Detritus ( 11846 ) on Monday September 13, 2004 @07:20AM (#10233882) Homepage
    This class of bug, and some others, can be prevented if the free routine checks the to-be-freed memory chunk for validity. I've done this in some embedded systems by setting a hidden magic number in each memory chunk that is allocated. The free routine checks for the magic number before it touches it. If the magic number isn't there, it generates an alarm message and returns an error code to the caller. Unique magic numbers can be used for each class of buffer, and to indicate whether the buffer is free or in-use.
  • by jeif1k ( 809151 ) on Monday September 13, 2004 @07:56AM (#10234039)
    The C dialect in Plan 9 is not very different from ANSI C; it doesn't address safety or security issues. Alef, on the other hand, looks pretty similar to C, but I believe is considerably safer than C.

An authority is a person who can tell you more about something than you really care to know.

Working...