Skip to content

Deobfuscate ANR profile stack frames #5510

@linear-code

Description

@linear-code

Description

ANR profile stack frames are shown obfuscated in the Sentry flamegraph UI, even when customers have uploaded ProGuard/R8 mapping files via the sentry-android-gradle-plugin. This makes ANR profiles significantly less useful — most production Android apps are obfuscated.

Root cause

Two gaps compound each other:

  1. SDK doesn't populate debug_meta: The ANR ProfileChunk built by ApplicationExitInfoEventProcessor leaves debug_meta null. Without a ProGuard mapping UUID, Symbolicator has nothing to look up. The UUID is already available at runtime — DefaultAndroidEventProcessor reads it from assets/sentry-debug-meta.properties and attaches it to error events — but it isn't wired into the ANR chunk path.
  2. Wrong symbolication route: platform = "java" routes the chunk through the JVM symbol-resolution pipeline, which doesn't know how to consume ProGuard mapping files. Android events and Android continuous profiles (platform = "android") already use the correct Android pipeline.

Coupling note

Fixing the billing issue (issue 1 — the platform string flip to "android") is a prerequisite, as it routes the chunk to the Android symbolication pipeline. debug_meta population is still required even after the platform is fixed. Both changes should ship together.

Proposed fix

  • SDK (sentry-java): In ApplicationExitInfoEventProcessor.captureAnrProfile, populate debug_meta.images with the ProGuard DebugImage (type "proguard", UUID from assets/sentry-debug-meta.properties). The same source is already wired for error events via DefaultAndroidEventProcessor.
  • Vroom (getsentry/vroom): Route Android JVM profile chunks through the Symbolicator JVM endpoint post-platform-fix. The ANR chunk frames produced by StackTraceConverter use module (className), function (methodName), filename, lineno — exactly the shape Symbolicator's JVM path expects.
  • Ensure the profiling UI degrades gracefully on symbolication failure (mapping file missing or mismatched), showing the obfuscated frame as a fallback rather than dropping it — otherwise the event panel and profile panel show inconsistent stacks for the same ANR.

Difficulty

Medium

Repos affected

sentry-java (primary), getsentry/vroom (server-side coordination required)

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions