Then again (not to be morbid or anything), any disaster, somebody always manages to find a way to die. For example, "It's hot out today" = "20 dead." somehow.

Yeah, that's true. People die every day. Still, it sucks to see businesses and neighborhoods you once frequented become ash and rubble. I checked in with some of my friends who still live there, and the ones who got back to me say they're okay. Still waiting to hear from a few others though.

Those are difficult to reason about. When the seemingly "impossible" occurs. When you're certain that a block of code must be reached, but the debugger shows it skipped over. I think there's circuitry in our brains that make us susceptible to the notion of "supernatural" occurrences. When these "paradoxes" occur the logical thing is to realize that our assumptions are wrong and reassess our understanding of the program, but often we just scratch our heads and think "WTF, this can't happen, even though it does!" instead. These are the moments where telling just about anybody else about it will immediately solve the problem: either you'll realize, hold on, maybe my assumption is wrong, or the other person will ask questions trying to understand what you're talking about that force you to discover it by mistake.

Those are difficult to reason about. When the seemingly "impossible" occurs. When you're certain that a block of code must be reached, but the debugger shows it skipped over. I think there's circuitry in our brains that make us susceptible to the notion of "supernatural" occurrences. When these "paradoxes" occur the logical thing is to realize that our assumptions are wrong and reassess our understanding of the program, but often we just scratch our heads and think "WTF, this can't happen, even though it does!" instead. These are the moments where telling just about anybody else about it will immediately solve the problem: either you'll realize, hold on, maybe my assumption is wrong, or the other person will ask questions trying to understand what you're talking about that force you to discover it by mistake.

Wrong. All processor manufactures have just implemented their instruction set incorrectly resulting in your software misbehaving.

As a result you as a developer are stuck making compromises for their petty mistakes and oversightsWhen you discuss it with someone, all they're doing is telling you from their experience how they got around the processor manufacturing defects.

I suspect this bug could have been found very quickly with the help of a debugger - just step through from the beginning and see what it does. If you don't have a debugger set up, then get one set up

Yeah, that definitely seems like a case for the step functionality of a debugger if you're going in blind and have no idea why.

Also, both many static analyzers and whatever Visual Studio's IDE is, would have caught that. VS would have said "warning: this code can never be reached." (Actually, don't many compilers say that with -Wall?)

And many linters/static analyzers will actually read things like variable names and their initial values and say "Are you sure this is what you meant?". Like creating an integer but calling it test_float.

To all those suggesting I use a debugger - I do! -Wall does NOT warn about while(false).

But somethings are harder to step through when you have an interactive program.

In this case, I was spawning a new thread that creates a window and draws to it, but the window kept closing as soon as it was opened. Which made me think it was getting a close event. Or the thread was signaled to stop for some reason. I thought for sure it was one of the loop's break conditions getting triggered.