Ask HN: Share your simple, time consuming bugs

1 points by zackham ↗ HN
I love debugging. It is an art: crudely so when we litter our code with desperate, sometimes vulgar trace statements; elegantly so when we employ careful step-through debugging.

Sometimes though, the bugs get the upper hand for longer than any of us would like to admit.

I think it would be possibly helpful and probably interesting to everyone, to see what kind of bugs have made HN readers believe that their machine acted out of disdain for the programmer attempting to assert control.

3 comments

[ 3.3 ms ] story [ 16.5 ms ] thread
I'll start this off with my favorite one that got me for hours the first time many years ago when I was learning SQL, and still bites me occasionally when I don't have my guard up:

Working with MySQL columns that have the same name as a keyword. My favorites: order, table, and the less-known but equally painful, interval.

mysql> SELECT first_name, last_name, interval FROM users; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM users' at line 1

I once had a bug with Apache Rivet, where Tcl was linked to one version of the 'stat' struct, and Apache to another, meaning that, on occasion, the wrong size thing would get written to the wrong place and overwrite some memory that would, at some later point, cause an error. It was a bitch to debug.
Awesome. Bugs that lay dormant and cause problems at a later time can take a looooong time to figure out