News for hackers. Stuff that matters.
Re:Heisenbug by gardarh on Sunday February 25, 2018 @08:15AM (#16458780)
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 by jug on Sunday February 25, 2018 @08:20AM (#16458802)
A variant of that one led to quite a security bug for Apple: https://blog.codecentric.de/en/2014/02/curly-braces/