feat: Support reading .NET 11 Android assembly stores - #5577
Open
jamescrosswell wants to merge 7 commits into
Open
jamescrosswell wants to merge 7 commits into
jamescrosswell wants to merge 7 commits into
Conversation
The index entry layout was inferred from the ABI bitness (plus a compile-time TFM check for the ignore flag). CoreCLR v4 stores use 32-bit CRC32 name hashes on every ABI, so on 64-bit ABIs the reader read the index 4 bytes per entry too far and failed in Prepare(). The entry size is now index_size / index_entry_count, and anything other than the two v3/v4 layouts is rejected as corrupt. With this, .NET 11 APKs are readable, so the net11 APK tests are re-enabled. Refs #5454 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/assemblystore-zstd #5577 +/- ##
===========================================================
+ Coverage 74.79% 74.82% +0.03%
===========================================================
Files 515 515
Lines 18902 18913 +11
Branches 3689 3693 +4
===========================================================
+ Hits 14138 14152 +14
+ Misses 3887 3885 -2
+ Partials 877 876 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamescrosswell
added this pull request to stack #5581
September 15, 2026 03:49
On .NET 11 (CoreCLR) Android, assemblies loaded from the assembly store report Module.FullyQualifiedName as <Unknown>, so DebugStackTrace bailed out before calling the assembly reader and events had no debug images. When an assembly reader is configured, fall back to Module.ScopeName, which is the file name the store is indexed by. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…sizing Also trims comments. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Stacked on #5575 (itself stacked on #5574) — this PR's diff is only the index-entry sizing change. Together the three PRs make .NET 11 Android APKs readable for symbolication.
Closes #5454
Summary
StoreReader.Prepare()inferred the index entry layout from the ABI bitness (64-bit hash on 64-bit ABIs), plus a compile-time#if NET10_0_OR_GREATERfor theignorebyte. But upstream's generator picks the hash width by runtime: CoreCLR writes 32-bit CRC32 name hashes on every ABI, MonoVM writes xxHash sized by bitness (AssemblyStoreGenerator.cs). A .NET 11 x86_64 store has 60 entries in 540 bytes — 9 bytes each — so we read past the index andPrepare()threwEndOfStreamException.index_size / index_entry_count, as upstream does. Only the two v3/v4 layouts (9 and 13 bytes) are accepted; anything else, or a size that doesn't divide evenly, throws as a corrupt index. Upstream's v2 layouts are intentionally not ported (v2 support was dropped in feat: add support for .NET 11 preview 7 #5529).#if NET10_0_OR_GREATERbranch is gone.Module.FullyQualifiedNameis<Unknown>for assemblies loaded from the store, soDebugStackTracereturned before ever calling the assembly reader and events had nodebug_meta. When an assembly reader is configured it now falls back toModule.ScopeName(the file name the store is indexed by). Modules that do have a location still passFullyQualifiedName, so Mono behaviour is unchanged.ATTRIBUTION.txtnow records the v3 and v4 upstream sync points, not just the original baseline.Tests
net11.0APK tests inAndroidAssemblyReaderTestsare re-enabled — 29 run onnet11.0(previously 9); the 8 still skipped are the Mono AOT permutations .NET 11 can't produce.CreatesCorrectArchiveReadernow expects anAndroidAssemblyStoreReaderon .NET 11: theAndroidUseAssemblyStore=falseAPK contains onlylibassembly-store.so, because the CoreCLR host has no non-store fallback since dotnet/android#12033.StoreReaderTestsgains a CoreCLR-style v4 64-bit store with 32-bit hashes, plus corrupt-index cases (the 12-byte v2 layout and a non-divisible index size).Example
Symbolicated stack trace from a .NET 11 app
Notes
Sentry.Samples.Android(Release,net11.0-android37.0, arm64 emulator, API 37): the SDK reads the app assembly from the Zstandard-compressed v4 store, the captured event carries ape_dotnetdebug image with the PDB's debug ID, frames haveaddr_mode/function_id, and the matching PDB is uploaded by the build.AndroidLinkMode=full(which the Android sample sets) the trimmer rewrites app assemblies, and the Android SDK forcesTrimmerRemoveSymbols=truein Release, so the packaged assemblies have no debug ID to report. That's independent of this PR and of .NET 11._assembly_storesymbol item was dropped from Port upstream AssemblyStore reader changes: v4/CoreCLR format, _assembly_store symbol, index-entry sizing (next major) #5454 as unnecessary — see this comment.🤖 Generated with Claude Code