Skip to content

Android: module list merges an APK-loaded library with a neighbouring mapping (wrong image_addr, inflated image_size) #2261

Closed

Description

@Scryptolog1st

Description

On Android, the module list in debug_meta.images sometimes reports an APK-loaded library with a wrong image_addr and a much larger image_size, seemingly merging a small neighbouring same-file mapping with the real library. Servers that require a frame's image_addr to match an image exactly then cannot symbolicate frames in that library.

Observed with sentry.native.android.react-native 0.16.5 (@sentry/react-native 8.25.0, sentry-android 8.55.0, tombstone integration enabled), Samsung SM-S938U, Android 17. Native libraries are stored uncompressed and loaded directly from base.apk.

Two identical controlled native crashes in the same build, same device, minutes apart:

libreactnative.so entries in debug_meta.images (same debug ID) Tombstone frame base
Run 1 (OK) 0x76e2d9b000, size 6,348,800 (6.3 MB) and a separate 0x76df7dc000, size 90,112 0x76e2d9b000
Run 2 (wrong) single entry 0x76dd5ee000, size 59,338,752 (59.3 MB) 0x76e0877000

In run 2 the real library (base 0x76e0877000, 6.3 MB, per the tombstone) lies inside the reported 59.3 MB range, but no image starts at the frame base. In run 1 the small 90 KB same-debug-ID mapping is listed separately and the library entry is correct. It looks like the module finder sometimes joins that small mapping with the real library even though they are not contiguous parts of one ELF load. It may be related to the segment-merging change in #1588, but I haven't confirmed that.

When does the problem happen

  • During build
  • During run-time
  • When capturing a hard crash

Environment

  • OS: Android 17 (arm64), Samsung SM-S938U
  • SDK: @sentry/react-native 8.25.0 → sentry-android 8.55.0 → sentry-native 0.16.5 (inproc, sentry.native.android.react-native)
  • Libraries loaded directly from base.apk (uncompressed native libs)

Steps To Reproduce

  1. Android app with native libraries loaded from the APK (extractNativeLibs=false), React Native 0.83.
  2. Trigger a native crash (we used a controlled SIGSEGV in an app library) several times, relaunching to send each event.
  3. Compare the debug_meta.images entries for a large APK-loaded library (here libreactnative.so) with the tombstone frame image_addr for the same library. Occasionally the image entry starts lower and is several times larger than the library.

Only seen once in two runs so far, so it's intermittent.

Log output

No SDK debug log captured for these runs.

Activity

  1. linear-code commented on Oct 27, 2026

    @linear-code
  2. added
    Bug
    on Oct 28, 2026
  3. added 2 commits that reference this issue on Oct 29, 2026
    5a6b661
    ed74e23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidBug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions