Fix: Android crash std::__ndk1::default_delete<T>::operator() [abi:ne180000]#83792
Fix: Android crash std::__ndk1::default_delete<T>::operator() [abi:ne180000]#83792linhvovan29546 wants to merge 2 commits intoExpensify:mainfrom
Conversation
|
|
|
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e55de3d7a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| + const currentIndex = index++; | ||
| + remoteFunctionCache.set(currentIndex, value); | ||
| + const clone = WorkletsModule.createSerializableFunction(value, currentIndex); |
There was a problem hiding this comment.
Evict remote-function cache entries after serialization
This change stores every cloned callback in a global Map (remoteFunctionCache.set(...)) but never removes entries, so each unique remote function is kept strongly reachable for the lifetime of the app. In flows that repeatedly create new closures (for example, re-created callbacks during screen updates), JS heap usage will grow unbounded and can eventually degrade performance or trigger OOMs; previously these references were released by SerializableRemoteFunction cleanup on destruction.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is an acknowledged trade-off. Cleaning up entries from ~SerializableRemoteFunction is what caused the SIGSEGV crash in the first place, it's better to have a bounded memory overhead than a crash.
Explanation of Change
This PR applies a patch to fix the issue
std::__ndk1::default_delete<T>::operator() [abi:ne180000].Thanks to @tjzel for the help creating the patch.
Fixed Issues
$ #82146
PROPOSAL: N/A
Tests
Test 1:
Test 2:
Offline tests
Same as test above
QA Steps
Same as test above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-02-28.at.18.48.32.mov
Android: mWeb Chrome
Screen.Recording.2026-02-28.at.18.54.26.mov
iOS: Native
Screen.Recording.2026-02-28.at.19.16.08.mov
iOS: mWeb Safari
Screen.Recording.2026-02-28.at.17.58.52.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-28.at.17.56.26.mov