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 deadlock when compiled AOT #9928

Closed
FrayxRulez opened this issue Aug 28, 2024 · 2 comments
Closed

GC deadlock when compiled AOT #9928

FrayxRulez opened this issue Aug 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@FrayxRulez
Copy link

Describe the bug

I'm not sure what's the root cause of the issue, but I'm finding it very hard to investigate from my side.
I ported my app from UWP to WinUI 3, mostly because I'm curious about AOT performances.
I started by porting it to 1.5, and once done I moved to 1.6 preview 2.
I did all the fixes needed by AOT compilation and app works smoothly when launched from Visual Studio (still, as packaged, but this way AOT is only emulated as far as I understand)

The problems start when I actually publish a MSIX package and the code is actually compiled AOT.
The app works, as in, it starts and everything seems to be quite smooth, until the UI thread gets completely stuck.

I know that threading model changes from UWP to WinUI, and that reentrancy protection is gone, but I'm not sure whether this is the root cause of the issue or not and I'm not sure about how to verify this.
Also, if this was the case, I'd expect the freeze to occur whether the app is being compiled AOT or not.

The deadlock seems to happen very randomly (at times I can use the app for minutes, other times just for a couple of seconds, and it doesn't seem to be connected to any specific action) but it always happen on GC waiting for collection to be completed.

I hope that this is enough to investigate the issue:

In case, I can provide a full dump as well, but I'd prefer to share it privately.

Steps to reproduce the bug

  • Launch the MSIX
  • Use the app for a while

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.6 Preview 2: 1.6.240821007-preview2

Windows version

No response

Additional context

No response

@FrayxRulez FrayxRulez added the bug Something isn't working label Aug 28, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 28, 2024
@hez2010
Copy link

hez2010 commented Aug 28, 2024

It's a known issue of the .NET runtime, see https://github.com/microsoft/CsWinRT/blob/master/docs/aot-trimming.md#known-issues-when-publishing-for-aot for details.
The fix is on the way: dotnet/runtime#104583

@FrayxRulez
Copy link
Author

Had the feeling that this was caused by the runtime, but I was told to open the issue here. Thanks for pointing out the cause, completely missed that readme!

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage Issue needs to be triaged by the area owners label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@FrayxRulez @hez2010 @codendone and others