I’ve resurrected an app that was fine in iOS, and now, it compiles and links, but crashes with EXC_BADACCESS at the first use on a set or get on an Atomic <uint64_t>.
There’s code in there that will use the OSAtomicAdd64Barrier stuff in iOS3.2 and earlier, but I was kind of assuming that if GCC didn’t complain when compiling a 64-bit built-in op for ARM, then it’s be reasonable to expect it to actually work, rather than just emitting some broken assembly that crashes!
If you look in the atomics code, there’s this bit:
(Although TBH this will get fixed anyway, as we’ll soon be replacing the old implementation of the Atomic class with std::atomic on platforms where it’s available, and iOS is certainly one of them)
I am really just storing / loading a Atomic as member variable of my global controller object so it should be pretty trivial to reproduce (it’s definitely not a dangling pointer / lifetime issue)
The code runs fine on all platforms (OS X, Windows, Linux & iOS 9+). I just noticed it when I tested it on my old iPhone running iOS 8.41 (on my iPad Pro with iOS 9 everything is smooth).