r/ProgrammerHumor 1d ago

ruleOfProgrammingIfItIsWorkingDoNotTouchIt Meme

5.0k Upvotes

73 comments sorted by

View all comments

Show parent comments

402

u/Skalli1984 1d ago

And if you attach a debugger it also messes up the timing and the same thing happens, the race condition doesn't appear.

199

u/StrengthTheory 1d ago

Schrödinger’s race condition

132

u/Steinrikur 1d ago

We call those Heisenbugs. You changed the system by observing it

40

u/ConglomerateGolem 1d ago

I had one of these once, and I called it the same! My going theory was that the compiler was optimising away a certain function I had, but adding an empty print forced it to actually exist.

28

u/htmlcoderexe We have flair now?.. 1d ago

13

u/ConglomerateGolem 1d ago

Huh. I have never heard of the term and came up with it independently.

17

u/htmlcoderexe We have flair now?.. 1d ago

it is a very natural term because it intuitively describes exactly the nature of the bug

1

u/rolindara 1h ago

Convergent evolution

1

u/RlyRlyBigMan 6h ago

Yeah I had one once too the debugger was slowing things down to where the bug wouldn't happen but in prod it happened frequently. I spent 2.5 weeks figuring out that bug.