3 ms·
Security folks depend on this for correctness checks - OpenBSD in particular continues to supports Alpha (memory access reordering, alignment requirements) and
by zdw 3y ago
Security folks depend on this for correctness checks - OpenBSD in particular continues to supports Alpha (memory access reordering, alignment requirements) and Sparc64 (big endian, register windows), as well as the usual suspects, which frequently finds bugs that wouldn't be found on platforms without those "unusual" characteristics.
- xxpor 3y agoSpecifically on memory ordering bugs though, philosophically speaking, are they actually bugs if the condition is impossible to hit on a given platform? From an OpenBSD perspective, I can see it being valuable to know that it means the code can be safely ported to any random arch that comes out in the future, but for more commercial software, I really can't see that being worth the time worrying about.
- nyanpasu64 3y agoI think compilers are free to reorder code at compile time assuming single-threaded execution, exposing the same bugs that memory ordering exposes at runtime. I'm not sure if MSVC does this or not.
- xxpor 3y agoThere are a lot of details, but essentially yes. To solve that, see the compiler barriers section in https://www.kernel.org/doc/Documentation/memory-barriers.txt https://www.kernel.org/doc/Documentation/memory-barriers.txt