Repository navigation
Conversation
Swift-compiled Nitro code references two iOS 18-only libc++ symbols when built with Xcode 27, so dyld aborts at launch on iOS < 18 (#433, margelo/nitro#1652). Define fallbacks for deployment targets below 18 so the references resolve inside the app. Dynamic frameworks still need a Podfile setting, documented in the README.
There was a problem hiding this comment.
🟡 Changes recommended
Reentrant std::make_exception_ptr calls can overwrite the backport’s thread-local metadata and abort the outer capture, affecting arbitrary exception types because the backport replaces generic libc++ entry points.
1 open issue
What changed in this PR
This PR addresses launch crashes on iOS 17 and older when Rive’s React Native integration is built with Xcode 27, caused by Nitro references to newer libc++ exception symbols.
Changes:
- Adds fallback implementations for two libc++ exception entry points for deployment targets below iOS 18.
- Documents a Podfile workaround for dynamic frameworks.
- Adds a reproducer that repeatedly checks native promise rejections.
| File | Description |
|---|---|
| README.md | Documents the dynamic-framework crash and Podfile workaround. |
| ios/LibcxxExceptionPtrBackport.mm | Provides exception-pointer fallbacks for older iOS deployment targets. |
| example/src/reproducers/Issue433ExceptionPtr.tsx | Exercises native error conversion and counts expected and unexpected results. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The 16-slot array can evict a still-live entry during recursive std::make_exception_ptr calls, causing std::abort() when the outer capture completes even if no constructor throws.
1 open issue
1 resolved since last review
Review effort: Balanced
The backport is only needed while the Nitro peer range allows releases without margelo/nitro#1824.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Apps built with Xcode 27 abort at launch on iOS < 18 with
dyld: Symbol not found: __ZNSt13exception_ptr31__from_native_exception_pointerEPv(#433, margelo/nitro#1652). Swift's explicit module builds compile libc++ for the SDK version instead of the deployment target, sostd::make_exception_ptrin Swift-compiled Nitro code (NitroModules and our generated specs) referencesstd::exception_ptr::__from_native_exception_pointerand__cxa_init_primary_exception, which only exist in the iOS 18+ system libc++.ios/LibcxxExceptionPtrBackport.mmdefines both for deployment targets below 18, building the exception the way libc++ itself does for iOS < 18 (throw, thenstd::current_exception), so the references resolve inside the app. Withuse_frameworks! :dynamicthe reference lives in NitroModules.framework, which our pod can't reach, so the README documents a Podfile setting for that case.Verified with Xcode 27.1 on an iOS 17.5 simulator: the unfixed example crashes at launch; with the fix it launches and the new
Issue #433 exception_ptrreproducer rejects ~3,000 native promises with 0 unexpected results, for static libraries anduse_frameworks! :static.:dynamicplus the README setting also passes. The fixed build still runs on iOS 26.5.The backport is temporary: once the
react-native-nitro-modulespeer range starts at a release with margelo/nitro#1824 (expected 0.37.2),scripts/__tests__/libcxx-backport-removal.test.tsfails and points at what to delete (the.mm, its README note and the test).