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

feat(dotnet): add native AOT example #23

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxbrunet
Copy link
Member

@maxbrunet maxbrunet commented Nov 22, 2022

Continuing with my enthusiasm for traditionally jitted languages moving to native compilation for better integration with containers

This a new feature added in .NET 7: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/

@maxbrunet
Copy link
Member Author

maxbrunet commented Nov 22, 2022

Similarly to GraalVM (#17), symbolication does not currently work:

image

Debug info are not stripped by default on Linux: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/#native-debug-information

The feature is all new and the documentation around it appears light and I do not know my around the .NET documentation well enough. I am unable to confirm if the frame/stack pointer is preserved and if there is a build flag for it. DWARF unwinding does not help either.

@brancz
Copy link
Member

brancz commented Nov 24, 2022

The docs page does say

Limited diagnostic support (debugging and profiling).

To me this looks like there are just no debuginfos in this binary to symbolize. What does nm <binary> output?

At first sight I would say either framepointers are there or dwarf unwinding is working, as the memory addresses look roughly like they could be correct and have a stack depth higher than one. (not an explanation for Maxime or the rest of the maintainers, but anyone who may be reading who's unfamiliar: if the unwinding is broken in some way we typically see a very very high memory address and maximum 1-2 stack depth)

@maxbrunet
Copy link
Member Author

nm output: https://gist.github.com/maxbrunet/207417f6fe17f037e8c684e6876b16fe

For anyone who wants to reproduce:

make -C dotnet build-aot
docker create --name dotnet-aot-example parca-demo:dotnet-aot
docker cp dotnet-aot-example:/bin/demo .
docker rm dotnet-aot-example
nm demo

@maxbrunet maxbrunet force-pushed the feat/dotnet/native-aot branch from a789897 to 56be813 Compare December 2, 2022 18:13
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