HACKER Q&A
📣 hahnchen

Favorite Debugging Story?


Share some of your favorite one’s! I’d love to see systems programming debugging stories.


  👤 eimrine Accepted Answer ✓
On my first programming lesson I could not figure up how to store some content with NULL bytes (such as a webpage) in C++ string and the teacher did not know it either.

👤 dcminter
Off-topic out of the gate, I'll recall that on my very first attempt to write a program in Modula II on our university's Vax, I accidentally inserted a # character at the top of the file. The compiler output wasn't very user friendly, and I was relatively green at interpreting compiler output anyway. So the fact that basically every line of my program was considered a syntax error was deeply baffling to me. It was a long day (and evening) in the lab before I figured that one out. I expect it was character building. Or something.

👤 oliverpk
It sounds really stupid now, but I was working with threads in Java. There are two ways to implement a thread, either implementing the interface runnable or extending the class thread. I originally had a class that implemented runnable with a custom method called getState(). To initialize a thread while using runnable, you have to pass the runnable object to a thread as a constructor parameter. The class thread also has a method called getState() and I spent an embarrassing amount of time wondering why I had totally different values than expected.