Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Apr 24, 2024

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
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants