Skip to content

Double Retrace for ProGuard Symbolication #1744

@Angelodaniel

Description

@Angelodaniel

Problem

Customer is developing an SDK and an App which utilizes this SDK. These are separate projects, published on a different cadence and both use ProGuard for obfuscation.

The SDK is obfuscated during the build and published to their maven repository as a set of modules. We are currently not uploading the SDK's ProGuard mapping files to Sentry.
The App then consumes the SDK as a dependency from the maven repository. We are uploading the ProGuard mapping file for the application to Sentry.

When an issue occurs, we get the application-specific references deobfuscated correctly. However, SDK frames remain minified and this is what we would like to address.

Users have confirmed that calling retrace twice locally works correctly:

  1. First call with the application mapping file
  2. Second call with the SDK library mapping file

However, on Sentry side, only the application mapping file is being used for retracing, even though SDK library mapping UUIDs are provided through the custom event processor. We expected Sentry to iterate through all listed mapping files to de-obfuscate the respective stacktrace, similar to the local double retrace process.

They've tried merging the files but this gives the incorrect line numbers still, even though it's already an improvement.

Proposed Solution

Implement double retrace (chaining multiple ProGuard mappings) that applies each ProGuard mapping in sequence:

  1. Apply the application ProGuard mapping to deobfuscate the frame
  2. Take the deobfuscated result and apply the SDK library ProGuard mapping
  3. Continue until all mapping files (application + SDK libraries) have been applied or no further deobfuscation is possible

Add a chain_proguard_mappings: bool parameter to SymbolicateJvmStacktraces (default: false for backward compatibility).

Benefits

  1. Accurate Line Numbers: Correct line numbers for SDK frames in app stack traces
  2. Complete Deobfuscation: Full symbolication including inline functions
  3. Reduced Manual Work: Eliminates need for manual double retrace
  4. Better Debugging: More accurate stack traces for issue resolution
  5. Expected Behavior: Matches the working local double retrace process
  6. SDK Development: Enables proper debugging for SDK developers when issues occur in consuming applications

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions