←back to thread

303 points FigurativeVoid | 1 comments | | HN request time: 0s | source
Show context
CleverLikeAnOx ◴[] No.41841884[source]
An old timer I worked with during my first internship called these kinds of issues "the law of coincidental failures" and I took it to heart.

I try a lot of obvious things when debugging to ascertain the truth. Like, does undoing my entire change fix the bug?

replies(3): >>41842049 #>>41845072 #>>41849661 #
K0balt ◴[] No.41842049[source]
Yeah, good times. I just recently had one that was a really strong misdirection, ended up being 2 simultaneous other, non related things that conspired to make it look convincingly like my code was not doing what it was supposed to. I even wrote tests to see if I had found a corner-case compiler bug or some broken library code. I was half way through opening an issue on the library when the real culprit became apparent. It was actually a subtle bug in the testing setup combined with me errantly defining a hardware interface on an ancient protocol as an HREG instead of an IREG, which just so happened to work fine until it created a callback loop inside the library through some kind of stack smashing or wayward pointer. I was really starting to doubt my sanity on this one.
replies(2): >>41842318 #>>41843970 #
foobarian ◴[] No.41843970[source]
> corner-case compiler bug

They say never to blame the compiler, and indeed it's pretty much never the compiler. But DNS on the other hand... :-)

replies(2): >>41846811 #>>41854228 #
1. K0balt ◴[] No.41854228[source]
Yeah, it’s basically never the compiler. That’s how you know you are truly desperate… when you think you’ve eliminated everything else lol.