Repository navigation
Report Hermes fatal errors on the New Architecture - #59729
Draft
kraenhansen wants to merge 1 commit into
Draft
kraenhansen wants to merge 1 commit into
kraenhansen wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 31, 2026
Draft
This branch has not been deployed
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:
Fixes #59728.
hermesFatalHandler, which logs the reason for a Hermes fatal error and records it as the abort message, is only installed byHermesExecutorHolderon the legacy path. On the New Architecture nothing sets a handler, so Hermes writes the reason to stderr, which doesn't reach logcat, and crashes with its deliberate null write. The result is aSIGSEGVwith no reason.This installs the same handler from
JHermesInstance::initHybrid, once per process. It's kept separate from the handler inreactexecutor/OnLoad.cppso that the legacy code can be removed on its own.Changelog:
[ANDROID] [FIXED] - Report the reason for Hermes fatal errors in logcat and tombstones on the New Architecture
Test Plan:
Used the reproducer from the issue, https://github.com/kraenhansen/rn-hermes-fatal-handler-repro, on an arm64 API 37 emulator. It's a stock 0.88.1 release app that exhausts a small-heap runtime after startup. The same change was applied to
v0.88.1,ReactAndroidwas built from source, and the resultinglibhermestooling.sowas swapped into the APK. The change itself wasn't built onmain.Before:
After, in 3 of 3 runs, with the app setting no handler:
Note that fatal errors now end in
SIGABRTrather thanSIGSEGV, matching the legacy path, which may change how they group in crash reporters. An app that sets its own handler beforeHermesInstanceis created would be replaced, because Hermes has a single handler and no getter.🤖 Generated with Claude Code