Skip to content

libsentry-tm-perf-logger.so is not 16 KB page aligned after upgrading from 8.16.0 to 8.17.0 #6394

Closed

Description

@tomekzaw

What React Native libraries do you use?

Expo (mobile only), Expo Router, Hermes, RN New Architecture, React Navigation

Are you using sentry.io or on-premise?

sentry.io (SaS)

Are you using any other error monitoring solution alongside Sentry?

No

@sentry/react-native SDK Version

8.16.0 (old), 8.17.0 (new). The issue started right after the upgrade.

How does your development environment look like?

System:
  OS: macOS 26.5.2
  CPU: (15) arm64 Apple M5 Pro
Binaries:
  Node: 24.16.0
  npm: 11.16.0
SDKs:
  Android SDK: build-tools 37.0.0
npmPackages:
  expo: 57.0.1
  react: 19.2.3
  react-native: 0.86.0
Android:
  newArchEnabled: true
  hermesEnabled: true

Emulator: Pixel 10 Pro AVD with the 16 KB page size system image (sdk_gphone16k_arm64, Android 17, API 37, arm64-v8a).

Sentry.init()

Sentry.init({
  dsn: "https://...@o...ingest.de.sentry.io/...",
  enabled: !__DEV__,
  environment: "production",
  enableTombstone: true,
  integrations: [navigationIntegration],
});

Steps to Reproduce

  1. Upgrade @sentry/react-native from 8.16.0 to 8.17.0 in a New Architecture app
  2. Build and install the app on an Android emulator with a 16 KB page size image
  3. Launch the app

Expected Result

No compatibility warning, all native libraries are 16 KB page aligned (as they were with 8.16.0).

Actual Result

On every app start, Android shows the "Android App Compatibility" dialog saying the app is not 16 KB compatible and will run in page size compatible mode. It unhelpfully lists every library with "Unknown error", but I pulled the APK and checked the ELF headers of all 32 libs myself. Exactly one is misaligned, and it is the new one introduced in 8.17.0 by the Turbo Module performance tracking feature (#6307):

lib/arm64-v8a/libsentry-tm-perf-logger.so   LOAD align: 4096 (all other libs: 16384)

Logcat at install time:

NativeLibraryHelper: Setting page size compat mode PAGE_SIZE_APP_COMPAT_FLAG_ELF_NOT_ALIGNED
AppWarnings: Showing PageSizeMismatchDialog for package pl.tomekzaw.odjazdowykrk

The library is built from source in the consuming app by android/src/main/jni/CMakeLists.txt, which does not pass -Wl,-z,max-page-size=16384. RN 0.86 / Expo SDK 57 builds with NDK 27, where the linker still defaults to 4 KB alignment (16 KB only became the default in NDK r28), so the resulting .so breaks 16 KB compliance for the whole app. This will presumably also fail Google Play's 16 KB requirement, not just show the emulator dialog.

The usual fix would be adding this to the CMakeLists:

target_link_options(sentry-tm-perf-logger PRIVATE "-Wl,-z,max-page-size=16384")

Screenshot from the emulator:

Android App Compatibility dialog listing libraries that are not 16 KB aligned

Activity

  1. linear-code commented on Jul 2, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 2, 2026
  3. efstathiosntonas commented on Jul 3, 2026

    @efstathiosntonas

    on arm64-v8a apk:

    Image
  4. efstathiosntonas commented on Jul 3, 2026

    @efstathiosntonas

    @sentry__react-native@8.17.0.patch

    diff --git a/android/src/main/jni/CMakeLists.txt b/android/src/main/jni/CMakeLists.txt
    index 4f5e5403b2d15a9e2449ad3ea2478bff03cae1eb..5c4ea0e0a86e5a357d8816f71e8620257e4ea57a 100644
    --- a/android/src/main/jni/CMakeLists.txt
    +++ b/android/src/main/jni/CMakeLists.txt
    @@ -62,6 +62,17 @@ target_link_libraries(
             ReactAndroid::reactnative
     )
     
    +# Force 16 KB ELF LOAD segment alignment. NDK's linker still defaults to
    +# 4 KB (16 KB only became default in NDK r28); every other .so bundled by
    +# RN/AGP is already 16 KB aligned, but this target isn't unless told to be,
    +# which trips Android 15+'s 16 KB page-size compatibility check.
    +# https://github.com/getsentry/sentry-react-native/issues/6394
    +target_link_options(
    +    sentry-tm-perf-logger
    +    PRIVATE
    +        "-Wl,-z,max-page-size=16384"
    +)
    +
     # Note: we deliberately do NOT pass `-Wl,--strip-all` (or similar) here.
     # Android Gradle Plugin's `StripDebugSymbolsTask` already strips the .so for
     # the packaged APK while preserving the unstripped artefact under
  5. antonis commented on Jul 3, 2026

    @antonis
    Contributor

    Thank you for reporting @tomekzaw and for the suggestion @efstathiosntonas 🙇
    We are working on a fix in #6396. We will iterate here when it is release.

  6. self-assigned this
    on Jul 3, 2026
  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 3, 2026
  8. tomekzaw commented on Jul 3, 2026

    @tomekzaw
    Author

    @antonis Thank you for the quick fix! 🙏

  9. antonis commented on Jul 3, 2026

    @antonis
    Contributor

    Thank you for helping out with this and sorry for interrupting your workflow. A patch release will be available soon.

  10. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6396, which was included in the 8.17.1 release.

  11. added a commit that references this issue on Jul 3, 2026
    ade5420
  12. efstathiosntonas commented on Jul 3, 2026

    @efstathiosntonas

    φχαριστουμε Αντωνη 😄

  13. antonis commented on Jul 3, 2026

    @antonis
    Contributor

    Παρακαλώ :) 🇬🇷

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

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions