A fun bug story about crashes that only happened on Wednesdays:
After several weeks of frustration, where entire days devoted to experimentation had produced no results, I ended up basically adding printf statements to every single line between receiving the event from the serial port and writing it in the database… and in the process, as I revisited every line of that code, a sinking realization dawned on me.