Skip to content

[NativeAOT] Lock up at process shutdown on Windows when process has many threads #74678

Description

@VSadov

The lock up is more likely to happen with ServerGC configuration on a manycore machine.

The reason seems to be that at some stage of the process shutdown all threads except the main one get terminated regardless of what they do. With large number of attached threads (BGC threads are attached), it becomes fairly likely that one will be terminated while holding TSL spinlock.

Subsequently, when it is time for the main thread to detach, it blocks on the spinlock.
This scenario comes up frequently when, as a matter of stress testing, running library tests with ServerGC in a loop.

The issue seems to be specific to Windows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions