https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118455
llualpu <lluis.alemany.puig at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #6 from llualpu <lluis.alemany.puig at gmail dot com> --- Well, the things one can learn... Yes, usually use -D_GLIBCXX_DEBUG in my programs. I've never used -D_GLIBCXX_ASSERTIONS before. The story behind this post is that the code is originally written by a student who was getting a little too creative with his coding, and eventually wrote code with that OOB access. Since the code was too complex, I trimmed it down a bit and that's what I posted. I thought it was interesting that enabling/disabling the synchronization would make the program crash (or not) and it occurred to me and another professor that a bug (not in the code posted, but in the executable generated or something) could be causing the difference in behavior. I was not very convinced of this since C++ does not guarantee much in the context of UB, but... we both thought it would be best to let you folks know about this and let you decide. I'm closing this now, since I'm getting comments that this is not a bug.