Skip to content

Upstream Hermes patches for Android SIGABRT crash fix #85860

Closed

Description

@Julesssss

Context

PR #84708 fixes an Android SIGABRT crash (pthread_kill on invalid pthread_t in hermes-sampling thread) that occurs when Sentry Hermes profiling is enabled. Two patches were applied locally to React Native's Hermes source:

  1. Patch 030 — JNI copy-paste bug: HermesSamplingProfiler.cpp maps the JNI disable method to enable instead of disable, corrupting sampling thread state when Sentry stops profiling.
  2. Patch 031 — pthread_kill → tgkill on Android: Bionic libc's pthread_kill calls abort() on invalid pthread_t (unlike glibc which returns ESRCH). The Hermes sampling profiler sends SIGPROF at ~100Hz, so if a runtime thread exits during profiling the stale handle triggers SIGABRT. The patch uses the tgkill syscall which safely returns ESRCH.

Both are applied via a doLast Gradle hook on unzipHermes since that task overwrites source patches.

Solution

  • First lets fix witch patch
  • Then lets try and get an upstream fix

Related

Issue OwnerCurrent Issue Owner: @elirangoshen

Activity

  1. self-assigned this
    on Mar 19, 2026
  2. elirangoshen commented on Mar 20, 2026

    @elirangoshen
    Contributor

    Update: opened pr react/react-native#56174

  3. elirangoshen commented on Mar 20, 2026

    @elirangoshen
    Contributor

    And they merged it already

    react/react-native@7f2a58e

  4. Julesssss commented on Mar 23, 2026

    @Julesssss
    ContributorAuthor

    And they merged it already

    Nice! So we just have to await that RN release I guess.

  5. Julesssss commented on Mar 27, 2026

    @Julesssss
    ContributorAuthor

    The fix has been made, this is now just a cleanup issue.

    I'm going to close this and created a follow up issue here to await the ReactNative release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions