Repository navigation
fix(android): symbolicate managed exceptions from NativeAOT apps - #5916
Open
charlesroddie wants to merge 2 commits into
Open
charlesroddie wants to merge 2 commits into
charlesroddie wants to merge 2 commits into
Conversation
Managed exceptions from NativeAOT apps on Android carried image_addr and instruction_addr but no debug_meta, so Sentry could not symbolicate them. Load the module list sentry-native already builds, through the bound NDK NativeModuleListLoader, keyed by image address like the Cocoa path. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Also skip modules whose address can't be parsed instead of discarding the whole list, and call the static module list loader directly. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
charlesroddie
marked this pull request as ready for review
November 11, 2026 10:13
charlesroddie
requested review from
jamescrosswell and
ric-oliv
as code owners
November 11, 2026 10:13
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Managed exceptions from NativeAOT apps on Android can't be symbolicated.
DebugStackTrace.TryCreateNativeAOTFrameleft_nativeDebugImagesempty on Android, so frames carryimage_addrandinstruction_addrbut the event has nodebug_meta. Sentry marks every frameunknown_image, even when the matching debug file is uploaded.Observed with Sentry .NET 6.12.1, .NET 11, NativeAOT, arm64 Android 10:
debug_metais null on the managed event, while the same app's native crash event (from sentry-native) lists the app's.sowith its GNU build-id ascode_idanddebug_status: found. Resolving the managed frames' offsets against the uploaded debug file locally gives correct functions with file and line.Fix
On Android, fill
_nativeDebugImagesfrom the module list sentry-native already builds, via the boundio.sentry.ndk.NativeModuleListLoader. Entries are keyed by image address and used exactly like the Cocoa andSentry.Nativepaths, and carrytype(elf),image_addr,image_size,code_id,debug_id,code_fileanddebug_fileas sentry-native reports them.Sentry.Native.C.LoadDebugImages(the NDK caches its module list too).options.Native.EnableNdkis false, since the NDK libraries aren't loaded then.Testing
NativeDebugImagesTests: conversion from the NDK'sDebugImage(Android only).DebugStackTraceTests: a NativeAOT frame inside a loaded native image adds that image to the event; none is added with the NDK disabled (Android only).The Android targets of
SentryandSentry.Testsbuild, andDebugStackTraceTestspass onnet10.0. The Android-only tests have not been run: I had no emulator available, so they rely on the CI device tests.🤖 Generated with Claude Code