Repository navigation
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D71635967 |
cortinico
force-pushed
the
export-D71635967
branch
from
April 2, 2025 10:07
3620aad to
a0bb29c
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D71635967 |
cortinico
force-pushed
the
export-D71635967
branch
from
April 3, 2025 09:33
a0bb29c to
04d44a5
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D71635967 |
cortinico
force-pushed
the
export-D71635967
branch
from
April 3, 2025 09:36
04d44a5 to
f34cced
Compare
cortinico
force-pushed
the
export-D71635967
branch
from
April 3, 2025 10:19
f34cced to
21ac84b
Compare
Summary: Pull Request resolved: react#50437 Currently we do have `NativeArray`, `NativeMap` being tightly coupled with the old arch (i.e. everything inside `libreactnativejni.so`). Those classes however are primitives used also by the New Arch and they should be accessible even without the bridge infra. I've noticed this dependency while working on the Legacy Arch warnings. Here I'm refactoring those primitives to live in a separate `libreactnativejni_common` module that can be loaded indipendently. Changelog: [Internal] [Changed] - Decouple NativeMap and NativeArray from `reactnativejni` Reviewed By: javache, mdvacca Differential Revision: D71635967
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D71635967 |
cortinico
force-pushed
the
export-D71635967
branch
from
April 3, 2025 10:22
21ac84b to
4464d26
Compare
Contributor
|
This pull request has been merged in 1786912. |
Collaborator
|
This pull request was successfully merged by @cortinico in 1786912 When will my fix make it into a release? | How to file a pick request? |
This was referenced Nov 8, 2026
meta-codesync Bot
pushed a commit
that referenced
this pull request
Nov 10, 2026
## Summary: Part of #59728. Context in #59729 (comment) (problem 1). glog's logcat sink is installed in the `JNI_OnLoad` of `reactnativejni`. Since #50437, the New Architecture loads that library lazily: on the first transform prop or network inspector use, and on `main` also on the first touch event. Until then, glog writes only to stderr, so warnings and fatal errors logged during startup never reach logcat. Since Android 7.0, `liblog` sets the tombstone's abort message from fatal log writes, so those fatal errors also crash with a bare `SIGABRT`. This calls `gloginit::initialize()` from `rninstance`'s `JNI_OnLoad`. `ReactInstance` loads `rninstance` before the runtime, Fabric and TurboModules are created. `gloginit::initialize()` runs once per process, so the call in `reactnativejni` stays for the legacy architecture. ## Changelog: [ANDROID] [FIXED] - Send glog output during startup to logcat on the New Architecture ## Test Plan: Tested with [rn-hermes-fatal-handler-repro](https://github.com/kraenhansen/rn-hermes-fatal-handler-repro), which triggers a Hermes fatal error with the reason `Max heap size was exceeded`. I cherry-picked this commit onto 0.88.1, built `./gradlew :packages:react-native:ReactAndroid:assembleRelease`, swapped the arm64 libraries into the reproducer's stock-template APK, and ran it 3 times per build on an arm64 API 37 emulator. All runs were consistent. | Build | Crash | glog warnings in logcat | Fatal reason in logcat | Abort message in tombstone | | --- | --- | --- | --- | --- | | 0.88.1 | `SIGSEGV` | No | No | No | | 0.88.1 + this PR | `SIGSEGV` | Yes | No | No | | 0.88.1 + #59729 | `SIGABRT` | No | No | No | | 0.88.1 + #59729 + this PR | `SIGABRT` | Yes | Yes | Yes | With this PR and #59729: ```text W ReactNativeJNI: Codegen component descriptors were not configured from JNI_OnLoad W ReactNativeJNI: ReactInstance: evaluateJavaScript() with JS bundle F ReactNativeJNI: OOM: error_code(value = 1, category = vm_allocate_category, message = Max heap size was exceeded) F DEBUG : Abort message: 'OOM: error_code(value = 1, category = vm_allocate_category, message = Max heap size was exceeded)' ``` Nothing was logged twice, including with a transform on the root view, where `reactnativejni` also loads. I didn't run this on API levels below 37. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Differential Revision: D130915975 Pull Request resolved: #59861
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.
Summary:
Currently we do have
NativeArray,NativeMapbeing tightly coupled with the old arch (i.e. everything insidelibreactnativejni.so).Those classes however are primitives used also by the New Arch and they should be accessible even without the bridge infra.
I've noticed this dependency while working on the Legacy Arch warnings.
Here I'm refactoring those primitives to live in a separate
libreactnativejni_commonmodule that can be loaded indipendently.Changelog:
[Internal] [Changed] - Decouple NativeMap and NativeArray from
reactnativejniDifferential Revision: D71635967