Skip to content

Debug image cache never refreshes when no address matches #6682

Closed as not planned

Description

@sentry-junior

DebugImagesLoader (sentry-android-ndk) caches the native module list once per process and never reloads it. If that first list misses a library, such as Flutter's libapp.so, loadDebugImagesForAddresses returns null for every later lookup in that process. Hybrid SDK events then go out without debug_meta, and their native frames can't be symbolicated.

Root cause

  • DebugImagesLoader.debugImages is a static field. It is filled by the first loadDebugImages() and only reset by clearDebugImages(), which nothing in the SDK calls.
  • sentry-native's sentry_get_modules_list() caches its /proc/self/maps read behind g_initialized. It is only reset by sentry_init or sentry_clear_modulecache().
  • loadDebugImagesForAddresses returns null both when no image matches and when the address set is empty. Callers can't tell a miss from a failure, so fallbacks like ?.ifEmpty { ... } never run.
  • Unconfirmed (low confidence): why the first read can miss a library that is already loaded. One possibility is that /proc/self/maps changes while load_modules reads it in 4 KB chunks.

Proposal

When loadDebugImagesForAddresses matches no address, call clearDebugImages() and reload once, rate-limited. clearDebugImages() already calls sentry_clear_modulecache(), so this refreshes both caches.

Related

via Gino Buenaflor.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 19, 2026

    @linear-code
  2. self-assigned this
    on Nov 19, 2026
  3. buenaflor commented on Nov 19, 2026

    @buenaflor
    Contributor

    Closing this, since getsentry/sentry-dart#4194 fixes the symptom and is out in sentry-flutter 10.6.0. Dart now adds the libapp.so image itself when the native list misses it.

    so this issue is not needed.

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions