Yeah, I was going to mention race conditions as soon as I saw the parent comment. Though I’d guess most cases where the debugger “fixes” the issue while print statements don’t are also race conditions, just the race isn’t tight enough that that extra IO time changes the result.
Best way to be thorough with concurrency testing IMO involves using synchronization to deliberately check the results of each potential race going either way. Of course, this is an exponential problem if you really want to be thorough (like some races could be based on thread 1 getting one specific instruction in between two specific instructions in thread 2, or maybe a race involves more than 2 threads, which would make it exponentially grow the exponential problem).
But a trick for print statement debugging race conditions is to keep your message short. Even better if you can just send a dword to some fast logger asynchronously (though be careful to not introduce more race conditions with this!).
This is one of the reasons why concurrency is hard even for those who understand it well.
It’s also a tactic of bullshitters to say a whole bunch of stuff in series, just put something out there and quickly move on to the next thing, making it sound like they have a lot of substance but hoping the quick change doesn’t give anyone much of a chance to pull on any of the threads of what they said or look close enough to realize that there is little to no substance behind any of it.
Ancient Aliens and Alex Jones both also use that.
And it’s a pain in the ass to unravel because people who don’t want to look more closely and just want to believe think there’s a list of things that need to be disproven if you wait and let the speaker finish or don’t question him about it directly because the believers don’t feel like they have the expertise to rebut counterpoints (so shelve them instead of discarding) and instead just want to go down the list. Which is fair, though it would be nice if they applied that same skepticism to that list of points in the first place.
But this seems like an effective counter for that strategy. Just pick an item on the list that doesn’t sound right and keep pulling on that thread with the person that said it on the first place rather than the disciples blindly following. Then they’ll see it’s not just their lack of expertise getting in the way of arguing back against counterpoints, it’s the whole thing lacking any real substance at all.