fix(android): symbolicate APK-embedded tombstone frames - #5992
Merged
supervacuus merged 4 commits intoAug 25, 2026
Conversation
supervacuus
requested review from
0xadam-brown,
adinauer,
markushi,
romtsn and
runningcode
as code owners
August 25, 2026 11:30
📲 Install BuildsAndroid
|
supervacuus
deleted the
fix/android/symbolicate-APK-embedded-tombstone-frames
branch
August 25, 2026 14:29
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.
📜 Description
Fix tombstone symbolication for native libraries loaded directly from uncompressed APK entries.
The parser now accepts ELF mappings with build IDs at nonzero APK offsets, distinguishes multiple ELFs sharing the same APK path, validates mapping continuations using the tombstone page size, and sets frame
image_addrfrompc - rel_pc.Correction during review:
PT_LOADvirtual addresses and file offsets can diverge by one segment-alignment unit at each boundary. Meaning continuations must be validated relative to the previous mapping rather than the module start, so we don't accumulate drift (across multi-segment ELFs).💡 Motivation and Context
TombstoneParserrequiredmapping.offset == 0, excluding ELFs mapped from inside an APK. This removed their debug images when tombstone data replaced the original native event metadata, resulting inunknown_image.But Android's
libunwindstackalready resolved the ELF and supplied its build ID, so Java doesn't need to reopen or parse the APK (as the Native SDK module loader does).Fixes #5986.
💚 How did you test it?
I added the following test cases (names taken directly from the test module):
creates images for multiple ELF files embedded in same APK: verifies distinct build IDs produce distinct images despite sharingbase.apk.coalesces multiple ELF continuations aligned for 16 KiB pages: covers an ELF with threePT_LOADmappings and verifies that per-segment alignment drift does not accumulate.does not include a different embedded ELF without build ID in previous image: prevents unrelated APK mappings from expanding the previous image.sets image address on frame for ELF embedded in APK: verifiesimage_addris derived frompc - rel_pc.parses APK embedded ELF from full tombstone fixture: validates an Android 15 tombstone produced by a non-legacy packaging build (but only the relevant diffs to the default fixture are asserted and not a full snapshot test which would just duplicate most of the existing tests). Now also verifies complete module sizes for 16KiB-aligned ELFs captured on a 4KiB device.Ran the tombstone tests.
Also "manually" compared the resulting envelopes when running from a non-legacy packaged sample build against the tombstone integration and the ndk integration (both now have the debug images for the APK, whereas previously they didn't).
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps