I am creating an xcframework for a static library for iOS, but I am encountering a perplexing issue with Xcode 16.3.
When I build an xcframework using C++ in one project and import it into another project, the application runs with corrupted memory. In the framework project, I use os_unfair_lock, but when attempting to lock, the app crashes due to a state error. This suggests that memory corruption is occurring.
When the xcframework is built with Xcode 16.2, a proper binary is generated, and the app runs without any problems. Since I do not want to disclose the source code, I am trying to construct a minimal project that reproduces the issue, but so far I have not been successful.
Fundamentally, I feel that the compiler in Xcode 16.3 cannot be trusted.