[jdk21u-dev] RFR: 8319137: release _object in ObjectMonitor dtor to avoid races [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Jan 2 18:12:07 UTC 2024
> Transplanted from https://github.com/openjdk/jdk21u/pull/401
>
> This effectively reverts [JDK-8256302](https://bugs.openjdk.org/browse/JDK-8256302), which introduced race condition in JDK 21. The patch does not apply cleanly for two reasons:
> 1. Deleted `release_object()` has a different form in JDK 21 due to slight WeakHandle API change. This is not relevant for this patch, just a backporting conflict. I removed `release_object()` by hand.
> 2. Without [JDK-8319896](https://bugs.openjdk.org/browse/JDK-8319896) we cannot do `JavaThread::cast` in the incoming changeset, because we can be called by a non-Java thread. I suspect JDK-8319896 would come with its own bugtail, so I would prefer not to backport it now. I have replaced the code back to original pre- JDK 21 form in a separate commit: [Modifications to fit JDK 21](https://github.com/openjdk/jdk21u-dev/commit/65251865632a5624fec70527b7bc1f4dd1d0d637)
>
> Additional testing:
> - [x] MacOS AArch64 server fastdebug, `runtime/Monitor` passes
> - [x] Linux AArch64 server fastdebug, `tier1 tier2 tier3 tier4`
> - [x] Linux x86_64 server fastdebug, `tier1 tier2 tier3 tier4`
Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Merge branch 'master' into JDK-8319137-revert-object-release
- Modifications to fit JDK 21
- Backport c39d001c7a1ae9eb322a7bb621a03e18c9bf02a1
-------------
Changes:
- all: https://git.openjdk.org/jdk21u-dev/pull/12/files
- new: https://git.openjdk.org/jdk21u-dev/pull/12/files/65251865..56e9a2c4
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=12&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=12&range=00-01
Stats: 15150 lines in 417 files changed: 6962 ins; 2579 del; 5609 mod
Patch: https://git.openjdk.org/jdk21u-dev/pull/12.diff
Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/12/head:pull/12
PR: https://git.openjdk.org/jdk21u-dev/pull/12
More information about the jdk-updates-dev
mailing list