RFR: 8369250: Assess and remedy any unsafe usage of the Semaphore used by NonJavaThread::List [v2]

David Holmes dholmes at openjdk.org
Tue Oct 7 21:23:55 UTC 2025


> The `NonJavaThread::List` has a statically allocated instance which contains a `SingleWriterSynchronizer`, which contains a `Semaphore`. The `VMThread` can try to remove itself from the list after the static destructors have executed, leading to an assertion failure for the `Semaphore` but potentially it could crash as the `List` itself gets deallocated..  Simplest fix is to change the `List` instance to a `DeferredStatic` such that it is never destroyed.
> 
> Testing:
>  - tiers 1-3 (sanity)
> 
> Thanks.

David Holmes has updated the pull request incrementally with one additional commit since the last revision:

  Return class List definition to cpp file per Stefan and Kim's requests

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27664/files
  - new: https://git.openjdk.org/jdk/pull/27664/files/7c56f76f..ac664896

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27664&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27664&range=00-01

  Stats: 26 lines in 2 files changed: 14 ins; 11 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/27664.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27664/head:pull/27664

PR: https://git.openjdk.org/jdk/pull/27664


More information about the hotspot-runtime-dev mailing list