Skip to content

Deadlock in loader lock (CoreCLR) from background GC in XAML apps #114182

Closed
@Sergio0694

Description

@Sergio0694

Description

We're hitting random hangs in the Microsoft Store in debug builds on CoreCLR.

Context from @hoyosjs:

"This is a loader lock deadlock
[...]

  • Thread 3 tries to do a GC from the added pressure, which tries to start the background GC thread.
  • BG thread (and a ton of others) fail to start - they are stuck in LdrpInitializeThread on LdrpAcquireLoaderLock
  • They can't start bc thread 16 has the lock (LdrShutdownThread) and it's doing TLS destruction. Part of it must happen in COOP GC. Transitioning to coop means it waits for the original GC...

Crash dump (MSFT only): loader_hang_dmp.zip

Reproduction Steps

It just happens when using the app for a while.

Configuration

  • .NET 9.0.202

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-GC-coreclrneeds-author-actionAn issue or pull request that requires more info or actions from the author.partner-impactThis issue impacts a partner who needs to be kept updated

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions