Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the word for this:

* My code doesn't work and I can't find the bug even after over an hour

* I add a few lines of <whatever code>. Now it works!

* Now, just for comparison, I remove all the code I just added (or, at least I think I reverted back to previous state). But now it still works.

???



That could probably be called a Heisenbug[0]: A bug that disappears or alters its behavior when one attempts to probe or isolate it.

Though it depends on the cause - as others in this comment chain said, if it's just that the file isn't actually being updated between tests, but adding a new line forces an update/recompile/etc., I'm not sure what you'd call it.

[0] http://www.catb.org/~esr/jargon/html/H/heisenbug.html


Once I added a comment and my bug went away. That was when I went home for the day.


There's the alternative:

* The program works flawlessly

* Somebody finds a bug on the code that is executed in a test

* The relevant test now fails consistently

Both are probably because you changed something on the environment when you looked at the code.


Another common cause is that the code you were looking at wasn't actually the code you were running. Between "I added this line and then I removed this same line, and now it works", the executable might have been recompiled.


hot reloading can cause weird behaviors like this in particular


I get that a lot, just have to restart that Docker desktop to push the saved changes to volume.


Clock skew?

Makefile (or a similar build system which uses timestamps) + a problem with wall clock -> stale files.


Choose an editor with autosave to fix this one.


Now you have two problems.


DevOps


cache?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: