Except when they don’t. I’m debugging something right now that runs fine under debugging conditions and crashes with a segfault in real life. It’s not randomized memory (messed with that), it’s likely some race where the timing is changed by the debugger.
runs fine under debugging conditions and crashes with a segfault in real life
There's your clue right there...
Yes. Did you read what I wrote?
AdressSanitizer is an absolute gamechanger and should amost always spare you the effort of the nightmare debugging of undefined behaviour.