iOS 16 simulator/runtime crash caused by std::pmr usage in BoundedPriorityQueue.hpp
Environment
- react-native-audio-api: 0.12.2 (also reproduced on nightly)
- Expo SDK: 54
- React Native: 0.81.x
- Xcode: 26.3
- iOS simulator runtime: iOS 16.4
- Architecture: arm64
Crash
App crashes immediately at launch on iOS 16 simulator with:
txt dyld: Symbol not found: __ZNSt3__13pmr15memory_resourceD2Ev Referenced from: MyAppName.debug.dylib Expected in: .../iOS 16.4.simruntime/.../usr/lib/libc++.1.dylib
Demangled:
txt std::__1::pmr::memory_resource::~memory_resource()
This is a dyld launch crash before JS executes.
Investigation
Initially I suspected FFmpeg / bundled static libs (related to #987), but even after using:
disableFFmpeg: true,
disableStaticExternalLibs: true,
the crash still occurred.
The actual source appears to be:
common/cpp/audioapi/utils/BoundedPriorityQueue.hpp
which currently uses:
#include <memory_resource> std::pmr::multiset std::pmr::monotonic_buffer_resource std::pmr::unsynchronized_pool_resource
Workaround / Patch
Replacing the PMR containers/resources with standard STL containers fixes the issue completely on iOS 16 simulator.
react-native-audio-api+0.12.2.patch
After this patch:
- app launches correctly on iOS 16 simulator
- no dyld crash
- no need to disable FFmpeg/static external libs
Question
Is std::pmr intended to be supported on iOS 15/16 runtimes?
It looks like current builds require newer libc++ runtime support than what is available in iOS 16 runtimes.
Would you consider:
- removing PMR usage,
- gating it behind newer deployment targets,
- or providing a fallback STL implementation for older iOS runtimes?
iOS 16 simulator/runtime crash caused by std::pmr usage in BoundedPriorityQueue.hpp
Environment
Crash
App crashes immediately at launch on iOS 16 simulator with:
Demangled:
This is a dyld launch crash before JS executes.
Investigation
Initially I suspected FFmpeg / bundled static libs (related to #987), but even after using:
the crash still occurred.
The actual source appears to be:
which currently uses:
Workaround / Patch
Replacing the PMR containers/resources with standard STL containers fixes the issue completely on iOS 16 simulator.
react-native-audio-api+0.12.2.patch
After this patch:
Question
Is
std::pmrintended to be supported on iOS 15/16 runtimes?It looks like current builds require newer libc++ runtime support than what is available in iOS 16 runtimes.
Would you consider: