Skip to content

Conversation

@andrew-kulikov
Copy link
Contributor

Fixes #122096

Copilot AI review requested due to automatic review settings December 2, 2025 15:47
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a potential deadlock bug in the Mono AOT runtime by adding a missing unlock operation when table_size == 0 in the mono_aot_get_class_from_name function.

Key changes:

  • Added braces around the early return when table_size == 0
  • Added amodule_unlock(amodule) call before returning FALSE to match the locking pattern used in all other exit paths

@andrew-kulikov
Copy link
Contributor Author

@BrzVlad It looks like the failed llvmfullaot test is a known issue and not related to this PR, so I believe it should be safe to merge.

@steveisok steveisok enabled auto-merge (squash) December 3, 2025 20:27
@kg
Copy link
Member

kg commented Dec 3, 2025

Thank you for your contribution!

@BrzVlad
Copy link
Member

BrzVlad commented Dec 5, 2025

/ba-g unrelated fullaotllvm failure

@steveisok steveisok merged commit ea413ca into dotnet:main Dec 5, 2025
84 of 86 checks passed
@andrew-kulikov
Copy link
Contributor Author

Thank you all! I was also wondering if it would be possible to backport this change to .NET 10, as it would be very helpful for us to have this in place before the .NET 11 release.

@steveisok
Copy link
Member

Thank you all! I was also wondering if it would be possible to backport this change to .NET 10, as it would be very helpful for us to have this in place before the .NET 11 release.

I'm not opposed to backporting. @BrzVlad what do you think?

@BrzVlad
Copy link
Member

BrzVlad commented Dec 5, 2025

Yes I'll backport to .net9 and .net10 since it is a low risk change. The fix should be available in January for both releases.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Codegen-AOT-mono community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mono][AOT] Deadlock in mono_aot_get_class_from_name when AOT assembly contains more than 65,000 classes

4 participants