<div dir="ltr">I'm curious if tools like thread sanitizer and thread analyzer can detect invalid accesses due to using std::memory_order? <div><br></div><div>Why I'm asking is that, to me, std::memory_order bugs is not the same with normal synchronization bugs, normal synchronization bugs are due to write the wrong code (to access a critical region out of a lock guard for example), but memory_order bugs are due to generate wrong optimized code (still invalid access, but isn't write by programmer directly).</div><div><br></div><div>So can tools like thread sanitizer and thread analyzer can handle this?</div></div>