Skip to content

Merge upstream AOT improvements into the Sentry Ben.Demystifier#5

Merged
jamescrosswell merged 11 commits intomainfrom
native-aot
Apr 24, 2024
Merged

Merge upstream AOT improvements into the Sentry Ben.Demystifier#5
jamescrosswell merged 11 commits intomainfrom
native-aot

Conversation

@jamescrosswell
Copy link
Collaborator

Patched our fork of Ben.Demystifier from upstream:
benaadams#222

See getsentry/sentry-dotnet#3282

jamescrosswell and others added 6 commits November 2, 2023 10:48
Applied fix from #4 in our local fork of the module.
In the end, someone will need to do the work to enable the AOT/trim/single file safety analyzers and [address all the warnings](https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries/), but this is enough to have a golden path that makes `sample/StackTrace` project produce the same results under native AOT as under JIT.

Necessary fixes:

* `GetMethodBody` under AOT throws. This will not return anything useful under Mono with ILStrip either. The code simply needs to deal with it.
* Runtime reflection stack doesn't guarantee referential equality of `MemberInfo`s (except for `TypeInfo`). This is also true on JIT-based runtimes, but there's even less caching on native AOT. Use operator `==`.
* The reflection to read `TupleElementNamesAttribute` is trim-unfriendly and cannot be analyzed. Replace with no-reflection.
* Some fallout from the previous point because the nullable annotations on the thing returned by reflection were wrong.
@jamescrosswell jamescrosswell changed the title Native aot Merge upstream AOT improvements into the Sentry Ben.Demystifier Apr 24, 2024
@jamescrosswell jamescrosswell merged commit 19cffb9 into main Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants