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

GC events appear to be broken with NativeAOT #82318

Closed
mrvoorhe opened this issue Feb 17, 2023 · 4 comments
Closed

GC events appear to be broken with NativeAOT #82318

mrvoorhe opened this issue Feb 17, 2023 · 4 comments

Comments

@mrvoorhe
Copy link
Contributor

Description

When I switched IL2CPP to be compiled with NativeAOT, our GC event tracking logic stopped working. I pulled the code out into a repro project and as far as I can tell the GC events are no longer firing with NativeAOT.

Reproduction Steps

  1. Check out the repro project here https://github.com/mrvoorhe/NativeAOTGCEventsRepro

  2. dotnet publish

  3. GCEventsTest\bin\Debug\net7.0\win-x64\publish\GCEventsTest.exe

Expected behavior

Got Event Source
Got Event Source
Hello, World!
Got Event Source
GC - Gen 0
GC End - Gen - 0
GC - Gen 1
GC End - Gen - 1
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 2
GC End - Gen - 2
Done
Got Event Source

Actual behavior

Hello, World!
Done

Regression?

No response

Known Workarounds

No response

Configuration

7.0.100

Windows 11

x64

It is specific to NativeAOT. I did not test NativeAOT on Linux.

Other information

I found this a little interesting, not sure if it really is.

Once you add <PublishAot>true</PublishAot> to your csproj, running dotnet run will produce the bad output

Hello, World!
Done

Add <EventSourceSupport>true</EventSourceSupport> to the project and run dotnet run again, and you get the expected output.

Got Event Source
Got Event Source
Hello, World!
Got Event Source
GC - Gen 0
GC End - Gen - 0
GC - Gen 1
GC End - Gen - 1
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
Done
Got Event Source
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 17, 2023
@ghost
Copy link

ghost commented Feb 17, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

When I switched IL2CPP to be compiled with NativeAOT, our GC event tracking logic stopped working. I pulled the code out into a repro project and as far as I can tell the GC events are no longer firing with NativeAOT.

Reproduction Steps

  1. Check out the repro project here https://github.com/mrvoorhe/NativeAOTGCEventsRepro

  2. dotnet publish

  3. GCEventsTest\bin\Debug\net7.0\win-x64\publish\GCEventsTest.exe

Expected behavior

Got Event Source
Got Event Source
Hello, World!
Got Event Source
GC - Gen 0
GC End - Gen - 0
GC - Gen 1
GC End - Gen - 1
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 2
GC End - Gen - 2
Done
Got Event Source

Actual behavior

Hello, World!
Done

Regression?

No response

Known Workarounds

No response

Configuration

7.0.100

Windows 11

x64

It is specific to NativeAOT. I did not test NativeAOT on Linux.

Other information

I found this a little interesting, not sure if it really is.

Once you add <PublishAot>true</PublishAot> to your csproj, running dotnet run will produce the bad output

Hello, World!
Done

Add <EventSourceSupport>true</EventSourceSupport> to the project and run dotnet run again, and you get the expected output.

Got Event Source
Got Event Source
Hello, World!
Got Event Source
GC - Gen 0
GC End - Gen - 0
GC - Gen 1
GC End - Gen - 1
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
GC - Gen 0
GC End - Gen - 0
Done
Got Event Source
Author: mrvoorhe
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@jkotas
Copy link
Member

jkotas commented Feb 17, 2023

cc @LakshanF

@jkotas
Copy link
Member

jkotas commented Feb 17, 2023

EventSource and EventPipe tracing is not enabled for NativeAOT in .NET 7. It is being worked on for .NET 8: #79241

@MichalStrehovsky MichalStrehovsky added this to the 8.0.0 milestone Feb 20, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Feb 20, 2023
@agocke agocke added this to AppModel Mar 6, 2023
@agocke
Copy link
Member

agocke commented Jun 12, 2023

Closing as dup of #79241

@agocke agocke closed this as completed Jun 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

4 participants