Live data from Hacker News

Heisenbug

en.wikipedia.org

11–20 of 34 posts

Re: Heisenbug

#11
One of the first heisenbugs I encountered was IE8's console.log.

That object/function was only defined when the developer tools were open. Otherwise you would get an exception (but of course you couldn't see that exception in any place).

Daily effect was funny: When you forgot a console.log in your code your page JS would hang. When you tried to debug it by opening the developer tools everything worked- and you started to doubt your sanity pretty soon.

I wasted hours of my life with that.

Re: Heisenbug

#13
These (and bugs of other types) can make fantastic war stories for interviews. I have a few such stories from my own experience that I am practiced in telling; they're a really good opportunity to showcase your technical chops in puzzling situations, and also show that you're a personable character able to communicate effectively on technical issues, and an opportunity to demonstrate real enthusiasm and engagement.

The hook "Tell me about an interesting bug you had to fix" or similar is absolute gold; if you've got a good one lined up, you can dazzle with your diagnostic procedure and explain what you tried and thought of and discounted, showing a wide range of technical expertise and more general investigative procedure. Tell it well and lead them through it, and they will start coming up with ideas and suggestions, making themselves part of the discussion. Ideally, they'll even tell you about something similar they once had to deal with. By the end of the five minute story-telling, you're more than just interviewer-interviewee.

I plan ahead for these; I have three interesting (well, as interesting as these things get) crazy bug stories ready to go, delivery practiced, and I'll pick one based on other factors of the interview. They're also good for non-interviews; meeting someone at a conference or when working with another company - it's an interesting conversation that the other person can feel involved in and enjoy listening to, and by the end of it you're in their mind as a competent person, good at the job, who is also engaging and communicative and fun to chat to. Because it's true! If you've got interesting material, and you can deliver it well and engagingly, you are all those things. It's not even a trick!

If you don't plan ahead, you're planning to fail (is the kind of aphorism that makes me want to punch someone but I grudgingly accept is true).

Re: Heisenbug

#15

One of the first heisenbugs I encountered was IE8's console.log. That object/function was only defined when the developer tools were open. Otherwise you would get an exception (but of course you couldn't see that exception in any place). Daily effect was funny: When you forgot a console.log in your code your page JS would hang. When you tried to debug it by opening the developer tools everything worked- and you start…

But... how on earth did that escape QA? I mean surely even whoever was developing IE8's developer tools would have had accidentally forgotten a console.log() or two during development, surely?

Re: Heisenbug

#16
post #2

Obligatory: https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161 I wonder if at one point we'll end up with a crisis that will make us see excessive complexity as a bug on its own.

Great bug. Disappointing that they all consider it a bug in `file` though, rather than an insane design where printing a document relies on parsing the output of `file`!! Madness.

Re: Heisenbug

#19
Reminds me of the time I decided to always start using braces for if statements. I was figuring out why this line didn't work:

  if(condition)
     doSomething()
And naturally the obvious thing do to was to add a debugging statement:

  if(condition)
    logSomething()
    doSomething()
And if I remember correctly all of a sudden the bug didn't exist anymore for the condition I was reviewing. Took me a while to figure out what was going on. Lesson learned: Just always use braces.

Re: Heisenbug

#20
post #19

Reminds me of the time I decided to always start using braces for if statements. I was figuring out why this line didn't work: if(condition) doSomething() And naturally the obvious thing do to was to add a debugging statement: if(condition) logSomething() doSomething() And if I remember correctly all of a sudden the bug didn't exist anymore for the condition I was reviewing. Took me a while to figure out what was goi…

A variant of that one led to quite a security bug for Apple: https://blog.codecentric.de/en/2014/02/curly-braces/
Post reply on HN