From duke at openjdk.org Tue Oct 1 01:18:44 2024 From: duke at openjdk.org (duke) Date: Tue, 1 Oct 2024 01:18:44 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 14:55:33 GMT, Ramkumar Sunderbabu wrote: > Cleaning up nsk.share.Log code after the verbose mode was set always true. > > Tested all the vmTestbase/ tests. @rsunderbabu Your change (at version a346de1ce3387f99bb3f8d63c64b9c6bc1212bcb) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21267#issuecomment-2384589800 From rsunderbabu at openjdk.org Tue Oct 1 01:39:45 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 1 Oct 2024 01:39:45 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode In-Reply-To: References: Message-ID: <0Ta3dThVeJ0U5IaOnG16uyL6dpoIgszgdUOzqe77Fvg=.bac0890f-a77a-4dd3-9b60-c5c6143d097a@github.com> On Mon, 30 Sep 2024 21:07:59 GMT, Chris Plummer wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 287: > >> 285: if (!verbose()) { >> 286: doPrint(message); >> 287: } > > Is this method ever called? Is there a CR to remove it (and any references to it)? These are deprecated methods and are still getting called. The calls need to be replaced with display. I will create a separate CR for this and address because the impact radius of such a change is bigger than this CR. > test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 342: > >> 340: * Redirect log to the given stream >> 341: * Prints errors summary to current stream, cancel current stream >> 342: * and switches to new stream. > > Does it really do all this? It looks to me like it just switches to the new stream. I'm not sure what is meant by "error summary" and cancelling. marked for deprecation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21267#discussion_r1782010079 PR Review Comment: https://git.openjdk.org/jdk/pull/21267#discussion_r1782010577 From dholmes at openjdk.org Tue Oct 1 01:44:40 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 1 Oct 2024 01:44:40 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 14:55:33 GMT, Ramkumar Sunderbabu wrote: > Cleaning up nsk.share.Log code after the verbose mode was set always true. > > Tested all the vmTestbase/ tests. @rsunderbabu this should wait for the second review by @plummercj to be completed before it is integrated. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21267#issuecomment-2384614479 From rsunderbabu at openjdk.org Tue Oct 1 01:52:20 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 1 Oct 2024 01:52:20 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v2] In-Reply-To: References: Message-ID: > Cleaning up nsk.share.Log code after the verbose mode was set always true. > > Tested all the vmTestbase/ tests. Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: Addressed review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21267/files - new: https://git.openjdk.org/jdk/pull/21267/files/a346de1c..097789b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21267&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21267&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21267.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21267/head:pull/21267 PR: https://git.openjdk.org/jdk/pull/21267 From rsunderbabu at openjdk.org Tue Oct 1 01:52:20 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 1 Oct 2024 01:52:20 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 01:42:09 GMT, David Holmes wrote: > @rsunderbabu this should wait for the second review by @plummercj to be completed before it is integrated. Thanks. Thanks for pointing out David. I missed seeing those comments. I have addressed them now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21267#issuecomment-2384620630 From cjplummer at openjdk.org Tue Oct 1 04:07:36 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 1 Oct 2024 04:07:36 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v2] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 01:52:20 GMT, Ramkumar Sunderbabu wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > Addressed review comments test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 40: > 38: > 39: /** > 40: * This class helps to print test-execution trace messages Missing period. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21267#discussion_r1782080651 From cjplummer at openjdk.org Tue Oct 1 04:07:37 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 1 Oct 2024 04:07:37 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v2] In-Reply-To: <0Ta3dThVeJ0U5IaOnG16uyL6dpoIgszgdUOzqe77Fvg=.bac0890f-a77a-4dd3-9b60-c5c6143d097a@github.com> References: <0Ta3dThVeJ0U5IaOnG16uyL6dpoIgszgdUOzqe77Fvg=.bac0890f-a77a-4dd3-9b60-c5c6143d097a@github.com> Message-ID: On Tue, 1 Oct 2024 01:35:54 GMT, Ramkumar Sunderbabu wrote: >> test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 287: >> >>> 285: if (!verbose()) { >>> 286: doPrint(message); >>> 287: } >> >> Is this method ever called? Is there a CR to remove it (and any references to it)? > > These are deprecated methods and are still getting called. The calls need to be replaced with display. I will create a separate CR for this and address because the impact radius of such a change is bigger than this CR. ok >> test/hotspot/jtreg/vmTestbase/nsk/share/Log.java line 342: >> >>> 340: * Redirect log to the given stream >>> 341: * Prints errors summary to current stream, cancel current stream >>> 342: * and switches to new stream. >> >> Does it really do all this? It looks to me like it just switches to the new stream. I'm not sure what is meant by "error summary" and cancelling. > > marked for deprecation. Ok, but unless it is going to be removed by another CR soon, I think the comments should at least reflect what it currently does. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21267#discussion_r1782080971 PR Review Comment: https://git.openjdk.org/jdk/pull/21267#discussion_r1782081564 From rsunderbabu at openjdk.org Tue Oct 1 06:10:38 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 1 Oct 2024 06:10:38 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v2] In-Reply-To: References: Message-ID: <4182tKmfcha4-_wRjzwesK9qFrI8F5HflR45upgCD60=.7dfddadd-5c29-4127-8231-ab5095a9f099@github.com> On Tue, 1 Oct 2024 01:52:20 GMT, Ramkumar Sunderbabu wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > Addressed review comments JDK-8341302 created for addressing deprecated method usage. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21267#issuecomment-2384878446 From rsunderbabu at openjdk.org Tue Oct 1 07:01:17 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 1 Oct 2024 07:01:17 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v3] In-Reply-To: References: Message-ID: > Cleaning up nsk.share.Log code after the verbose mode was set always true. > > Tested all the vmTestbase/ tests. Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: Addressed review comments part2 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21267/files - new: https://git.openjdk.org/jdk/pull/21267/files/097789b2..b895705a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21267&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21267&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21267.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21267/head:pull/21267 PR: https://git.openjdk.org/jdk/pull/21267 From mli at openjdk.org Tue Oct 1 07:29:41 2024 From: mli at openjdk.org (Hamlin Li) Date: Tue, 1 Oct 2024 07:29:41 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v3] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 07:01:17 GMT, Ramkumar Sunderbabu wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > Addressed review comments part2 Marked as reviewed by mli (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21267#pullrequestreview-2339332109 From dholmes at openjdk.org Tue Oct 1 07:35:55 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 1 Oct 2024 07:35:55 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v7] In-Reply-To: References: Message-ID: On Sun, 29 Sep 2024 06:23:34 GMT, Sebastian L?vdahl wrote: >> 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) > > Sebastian L?vdahl 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 eight additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8327114-attach-from-container-to-container > - Clarify PID 1 check with comment > - Adapt code style > - Add test for the elevated privileges case > - Remove unused `SELF_PID_NS` > - Rewrite in line with suggestion from Larry Cable > - Reworked attach logic > - 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) We are seeing a number of test failures after this was integrated. Failing tests: - containers/docker/TestJcmdWithSideCar.java - com/sun/tools/attach/PermissionTest.java - I will file bugs, but the permission test fails because the new code throws a SecurityException when the SecurityManager is enabled: Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/proc/self/ns/mnt" "readlink") at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488) at java.base/java.security.AccessController.checkPermission(AccessController.java:1085) at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411) at java.base/sun.nio.fs.UnixFileSystemProvider.readSymbolicLink(UnixFileSystemProvider.java:554) at java.base/java.nio.file.Files.readSymbolicLink(Files.java:1474) at jdk.attach/sun.tools.attach.VirtualMachineImpl.(VirtualMachineImpl.java:66) ------------- PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2385009640 From aboldtch at openjdk.org Tue Oct 1 08:05:47 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Tue, 1 Oct 2024 08:05:47 GMT Subject: RFR: 8341168: Cleanup dead code after JDK-8322630 [v2] In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 08:15:51 GMT, Axel Boldt-Christmas wrote: >> [JDK-8322630](https://bugs.openjdk.org/browse/JDK-8322630) / #17495 removed the the concept of ICStubs, InlineCache buffers and related safepoints. >> >> There are a handfull of references and auxiliary constructs still in the code, I propose we clean these out. >> >> This removes the unused: >> * Experimental `InlineCacheBufferSize` option >> * `InlineCacheBuffer_lock` mutex >> * `Thread::_missed_ic_stub_refill_verifier` field >> * `VM_ICBufferFull` VM operation > > Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision: > > Add newline Thanks for the reviews. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21255#issuecomment-2385063512 From aboldtch at openjdk.org Tue Oct 1 08:05:48 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Tue, 1 Oct 2024 08:05:48 GMT Subject: Integrated: 8341168: Cleanup dead code after JDK-8322630 In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 07:39:11 GMT, Axel Boldt-Christmas wrote: > [JDK-8322630](https://bugs.openjdk.org/browse/JDK-8322630) / #17495 removed the the concept of ICStubs, InlineCache buffers and related safepoints. > > There are a handfull of references and auxiliary constructs still in the code, I propose we clean these out. > > This removes the unused: > * Experimental `InlineCacheBufferSize` option > * `InlineCacheBuffer_lock` mutex > * `Thread::_missed_ic_stub_refill_verifier` field > * `VM_ICBufferFull` VM operation This pull request has now been integrated. Changeset: ad5ffccf Author: Axel Boldt-Christmas URL: https://git.openjdk.org/jdk/commit/ad5ffccffa89359dac6ad44b9e43242e5bf3e398 Stats: 38 lines in 10 files changed: 0 ins; 34 del; 4 mod 8341168: Cleanup dead code after JDK-8322630 Reviewed-by: stefank, tschatzl, mli, shade ------------- PR: https://git.openjdk.org/jdk/pull/21255 From kevinw at openjdk.org Tue Oct 1 08:53:40 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 1 Oct 2024 08:53:40 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied In-Reply-To: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Mon, 30 Sep 2024 16:11:27 GMT, SendaoYan wrote: > Hi all, > Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). > So this PR add `readlink` permission to make this test work normally. > Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. Yes, agreed the readlink fixes the problem, thanks, looks good. Agree that joining the comment would be good. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21269#pullrequestreview-2339556019 From sgehwolf at openjdk.org Tue Oct 1 09:09:45 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 09:09:45 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v7] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 07:33:16 GMT, David Holmes wrote: > We are seeing a number of test failures after this was integrated. Failing tests: > > * containers/docker/TestJcmdWithSideCar.java What's the failure? > * com/sun/tools/attach/PermissionTest.java > > I will file bugs, but the permission test fails because the new code throws a SecurityException when the SecurityManager is enabled: > > ``` > Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/proc/self/ns/mnt" "readlink") > at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488) > at java.base/java.security.AccessController.checkPermission(AccessController.java:1085) > at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411) > at java.base/sun.nio.fs.UnixFileSystemProvider.readSymbolicLink(UnixFileSystemProvider.java:554) > at java.base/java.nio.file.Files.readSymbolicLink(Files.java:1474) > at jdk.attach/sun.tools.attach.VirtualMachineImpl.(VirtualMachineImpl.java:66) > ``` This is handled here: https://git.openjdk.org/jdk/pull/21269 ------------- PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2385229823 From duke at openjdk.org Tue Oct 1 09:32:52 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Tue, 1 Oct 2024 09:32:52 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v7] In-Reply-To: References: Message-ID: On Sun, 29 Sep 2024 06:23:34 GMT, Sebastian L?vdahl wrote: >> 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) > > Sebastian L?vdahl 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 eight additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8327114-attach-from-container-to-container > - Clarify PID 1 check with comment > - Adapt code style > - Add test for the elevated privileges case > - Remove unused `SELF_PID_NS` > - Rewrite in line with suggestion from Larry Cable > - Reworked attach logic > - 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) Sorry for this. I'm happy to look into the `com/sun/tools/attach/PermissionTest.java` if you can provide more details about the failure (and the environment it fails in). Is this something that should have failed in GHA checks too? ------------- PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2385274397 PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2385279008 From duke at openjdk.org Tue Oct 1 09:35:37 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Tue, 1 Oct 2024 09:35:37 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 In-Reply-To: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Mon, 30 Sep 2024 16:11:27 GMT, SendaoYan wrote: > Hi all, > Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). > So this PR add `readlink` permission to make this test work normally. > Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. Thanks for taking care of fixing this @sendaoYan! ------------- Marked as reviewed by slovdahl at github.com (no known OpenJDK username). PR Review: https://git.openjdk.org/jdk/pull/21269#pullrequestreview-2339663336 From sgehwolf at openjdk.org Tue Oct 1 10:08:44 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 10:08:44 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v7] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 09:29:20 GMT, Sebastian L?vdahl wrote: > Is this something that should have failed in GHA checks too? No. Only tier1 tests run in GHA. ------------- PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2385367053 From zzambers at openjdk.org Tue Oct 1 13:28:44 2024 From: zzambers at openjdk.org (Zdenek Zambersky) Date: Tue, 1 Oct 2024 13:28:44 GMT Subject: RFR: 8336881: [Linux] Support for hierarchical limits for Metrics [v9] In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 12:03:14 GMT, Severin Gehwolf wrote: >> Please review this fix for cgroups-based metrics reporting in the `jdk.internal.platform` package. This fix is supposed to address wrong reporting of certain limits if the limits aren't set at the leaf nodes. >> >> For example, on cg v2, the memory limit interface file is `memory.max`. Consider a cgroup path of `/a/b/c/d`. The current code only reports the limits (via Metrics) correctly if it's set at `/a/b/c/d/memory.max`. However, some systems - like a systemd slice - sets those limits further up the hierarchy. For example at `/a/b/c/memory.max`. `/a/b/c/d/memory.max` might be set to the value `max` (for unlimited), yet `/a/b/c/memory.max` would report the actual limit value (e.g. `1048576000`). >> >> This patch addresses this issue by: >> >> 1. Refactoring the interface lookup code to relevant controllers for cpu/memory. The CgroupSubsystem classes then delegate to those for the lookup. This facilitates having an API for the lookup of an updated limit in step 2. >> 2. Walking the full hierarchy of the cgroup path (if any), looking for a lower limit than at the leaf. Note that it's not possible to raise the limit set at a path closer to the root via the interface file at a further-to-the-leaf-level. The odd case out seems to be `max` values on some systems (which seems to be the default value). >> >> As an optimization this hierarchy walk is skipped on containerized systems (like K8S), where the limits are set in interface files at the leaf nodes of the hierarchy. Therefore there should be no change on those systems. >> >> This patch depends on the Hotspot change implementing the same for the JVM so that `Metrics.isContainerized()` works correctly on affected systems where `-XshowSettings:system` currently reports `System not containerized` due to the missing JVM fix. A test framework for such hierarchical systems has been added in [JDK-8333446](https://bugs.openjdk.org/browse/JDK-8333446). This patch adds a test using that framework among some simpler unit tests. >> >> Thoughts? >> >> Testing: >> >> - [x] GHA >> - [x] Container tests on Linux x86_64 on cg v1 and cg v2 systems >> - [x] Some manual testing using systemd slices > > Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 34 commits: > > - Add exclusive access dirs directive for systemd tests > - Merge branch 'master' into jdk-8336881-metrics-systemd-slice > - Merge branch 'master' into jdk-8336881-metrics-systemd-slice > - Improve systemd slice test for non-root on cg v2 > - Fix unit tests > - Add JVM_HostActiveProcessorCount using JVM api > - Merge branch 'jdk-8322420_cgroup_hierarchy_walk_init' into jdk-8336881-metrics-systemd-slice > - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init > - Merge branch 'jdk-8322420_cgroup_hierarchy_walk_init' into jdk-8336881-metrics-systemd-slice > - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init > - ... and 24 more: https://git.openjdk.org/jdk/compare/475b8943...92426dbf I can confirm that `jdk/internal/platform` tests now pass for me on RHEL-9 (cgroup v2) ------------- PR Comment: https://git.openjdk.org/jdk/pull/20280#issuecomment-2385851987 From syan at openjdk.org Tue Oct 1 15:38:56 2024 From: syan at openjdk.org (SendaoYan) Date: Tue, 1 Oct 2024 15:38:56 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Mon, 30 Sep 2024 17:05:08 GMT, Severin Gehwolf wrote: >> SendaoYan has updated the pull request incrementally with one additional commit since the last revision: >> >> merge two comments enclosed with /* ... */ on two lines > > test/jdk/com/sun/tools/attach/java.policy.allow line 17: > >> 15: >> 16: /* to read configuration file in META-INF/services, and write/delete .attach_pid */ >> 17: /* to read symbol link in /proc/self/ns/mnt */ > > Suggestion: > > /* to read symbolic link of /proc/self/ns/mnt */ > > > Perhaps merge the two comments enclosed with `/* ... */` on two lines? Okey, the two comments has been merged. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21269#discussion_r1783093102 From syan at openjdk.org Tue Oct 1 15:38:56 2024 From: syan at openjdk.org (SendaoYan) Date: Tue, 1 Oct 2024 15:38:56 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: > Hi all, > Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). > So this PR add `readlink` permission to make this test work normally. > Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. SendaoYan has updated the pull request incrementally with one additional commit since the last revision: merge two comments enclosed with /* ... */ on two lines ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21269/files - new: https://git.openjdk.org/jdk/pull/21269/files/f241371e..015d17cb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21269&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21269&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21269.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21269/head:pull/21269 PR: https://git.openjdk.org/jdk/pull/21269 From rkennke at openjdk.org Tue Oct 1 15:48:54 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 1 Oct 2024 15:48:54 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v11] In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 12:38:03 GMT, Roberto Casta?eda Lozano wrote: > test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: I think I would disable the tests for now. Is there a good way to say 'run this when UCOH is off OR UseSSE>3? ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2386370790 From sgehwolf at openjdk.org Tue Oct 1 16:21:44 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 16:21:44 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > merge two comments enclosed with /* ... */ on two lines Marked as reviewed by sgehwolf (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21269#pullrequestreview-2340853189 From sgehwolf at openjdk.org Tue Oct 1 16:26:52 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 16:26:52 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 Message-ID: The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): 1. Shared volumes between attachee and attacher and shared pid namespace 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges 3. Shared pid namespace between attachee and attacher only 4. Shared pid namespace between attachee and attacher, both running with elevated privileges The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: Passed: containers/docker/TestJcmdWithSideCar.java build: 2.08 seconds compile: 2.068 seconds build: 4.842 seconds compile: 4.841 seconds driver: 70.776 seconds Test results: passed: 1 I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: Passed: containers/docker/TestJcmdWithSideCar.java build: 2.169 seconds compile: 2.157 seconds build: 4.964 seconds compile: 4.963 seconds driver: 22.928 seconds Test results: passed: 1 The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! ------------- Commit messages: - Improve runtime of test - 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 Changes: https://git.openjdk.org/jdk/pull/21289/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21289&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341310 Stats: 15 lines in 1 file changed: 11 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21289.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21289/head:pull/21289 PR: https://git.openjdk.org/jdk/pull/21289 From sgehwolf at openjdk.org Tue Oct 1 16:26:52 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 16:26:52 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:16:36 GMT, Severin Gehwolf wrote: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.08 seconds > compile: 2.068 seconds > build: 4.842 seconds > compile: 4.841 seconds > driver: 70.776 seconds > Test results: passed: 1 > > > I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.169 seconds > compile: 2.157 seconds > build: 4.964 seconds > compile: 4.963 seconds > driver: 22.928 seconds > Test results: passed: 1 > > > The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue?... PTAL @slovdahl Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2386454865 From kevinw at openjdk.org Tue Oct 1 16:58:33 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 1 Oct 2024 16:58:33 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:16:36 GMT, Severin Gehwolf wrote: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.08 seconds > compile: 2.068 seconds > build: 4.842 seconds > compile: 4.841 seconds > driver: 70.776 seconds > Test results: passed: 1 > > > I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.169 seconds > compile: 2.157 seconds > build: 4.964 seconds > compile: 4.963 seconds > driver: 22.928 seconds > Test results: passed: 1 > > > The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue?... Thanks for clarifying the different testing combinations and the pointer to the missing one for follow up in JDK-8341349. I can check our testing with this change... ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2386516815 From cjplummer at openjdk.org Tue Oct 1 17:27:42 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 1 Oct 2024 17:27:42 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v3] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 07:01:17 GMT, Ramkumar Sunderbabu wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > Addressed review comments part2 Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21267#pullrequestreview-2340977043 From sgehwolf at openjdk.org Tue Oct 1 18:20:36 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 1 Oct 2024 18:20:36 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:16:36 GMT, Severin Gehwolf wrote: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.08 seconds > compile: 2.068 seconds > build: 4.842 seconds > compile: 4.841 seconds > driver: 70.776 seconds > Test results: passed: 1 > > > I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.169 seconds > compile: 2.157 seconds > build: 4.964 seconds > compile: 4.963 seconds > driver: 22.928 seconds > Test results: passed: 1 > > > The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue?... Thanks, Kevin. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2386669079 From amenkov at openjdk.org Tue Oct 1 18:53:41 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 1 Oct 2024 18:53:41 GMT Subject: Integrated: 8341060: Cleanup statics in HeapDumper In-Reply-To: References: Message-ID: On Fri, 27 Sep 2024 01:28:18 GMT, Alex Menkov wrote: > The fix cleans up static variables/methods in HeapDumper. > See jira for details. > > Testing: > heap dump-related tests (test/hotspot/jtreg/serviceability, test/hotspot/jtreg/compiler/c2/TestReduceAllocationAndHeapDump.java, test/hotspot/jtreg/runtime/ErrorHandling, test/hotspot/jtreg/gc/epsilon, test/jdk/sun/tools/jhsdb, test/jdk/sun/tools/jmap, test/jdk/com/sun/management/HotSpotDiagnosticMXBean) This pull request has now been integrated. Changeset: 03149735 Author: Alex Menkov URL: https://git.openjdk.org/jdk/commit/03149735e59b7d1d409a6e29ee05ae0537e03d53 Stats: 96 lines in 1 file changed: 32 ins; 59 del; 5 mod 8341060: Cleanup statics in HeapDumper Reviewed-by: shade, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/21216 From duke at openjdk.org Tue Oct 1 20:12:50 2024 From: duke at openjdk.org (Larry Cable) Date: Tue, 1 Oct 2024 20:12:50 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v7] In-Reply-To: References: Message-ID: On Sun, 29 Sep 2024 06:23:34 GMT, Sebastian L?vdahl wrote: >> 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) > > Sebastian L?vdahl 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 eight additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8327114-attach-from-container-to-container > - Clarify PID 1 check with comment > - Adapt code style > - Add test for the elevated privileges case > - Remove unused `SELF_PID_NS` > - Rewrite in line with suggestion from Larry Cable > - Reworked attach logic > - 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) I believe we need to wrap the readlink() in an AccessController.doPrivileged() block ... something like this: ` try { targetMountNS = AccessController.doPrivileged( (PrivilegedExceptionAction>) () -> Optional.ofNullable(Files.readSymbolicLink(procPidPath.resolve(NS_MNT))) ); } catch (PrivilegedActionException _) { // ... } ` ------------- PR Comment: https://git.openjdk.org/jdk/pull/19055#issuecomment-2386973409 From dholmes at openjdk.org Tue Oct 1 21:16:37 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 1 Oct 2024 21:16:37 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: <2LRPLbNHs_V1N6eYyblqBmIrVhu_7m5_BUaiA51z4b4=.d6b2c139-6239-4cc4-bfde-b0f3328a2a5a@github.com> On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > merge two comments enclosed with /* ... */ on two lines test/jdk/com/sun/tools/attach/java.policy.allow line 17: > 15: > 16: /* to read configuration file in META-INF/services, write/delete .attach_pid, > 17: and read symbolic link of /proc/self/ns/mnt */ Suggestion: /* * To read configuration file in META-INF/services, write/delete .attach_pid, * and read symbolic link of /proc/self/ns/mnt. */ ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21269#discussion_r1783539848 From cjplummer at openjdk.org Tue Oct 1 22:03:47 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 1 Oct 2024 22:03:47 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent Message-ID: The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. char* translateThreadState(jint flags); char* getThreadName(jthread thread); char* getMethodName(jmethodID method); void printStackTrace(jthread thread); void printThreadInfo(jthread thread); I made use of them while working on a couple of recent bugs and found them very useful. Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. ------------- Commit messages: - Add some useful debugging apis Changes: https://git.openjdk.org/jdk/pull/21299/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21299&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341295 Stats: 188 lines in 2 files changed: 188 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21299/head:pull/21299 PR: https://git.openjdk.org/jdk/pull/21299 From duke at openjdk.org Wed Oct 2 00:52:38 2024 From: duke at openjdk.org (duke) Date: Wed, 2 Oct 2024 00:52:38 GMT Subject: RFR: 8334305: Remove all code for nsk.share.Log verbose mode [v3] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 07:01:17 GMT, Ramkumar Sunderbabu wrote: >> Cleaning up nsk.share.Log code after the verbose mode was set always true. >> >> Tested all the vmTestbase/ tests. > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > Addressed review comments part2 @rsunderbabu Your change (at version b895705afaae6af7a3c6b3f38e92df737afbeb94) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21267#issuecomment-2387372435 From amenkov at openjdk.org Wed Oct 2 01:24:42 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 2 Oct 2024 01:24:42 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 21:58:31 GMT, Chris Plummer wrote: > The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. > > char* translateThreadState(jint flags); > char* getThreadName(jthread thread); > char* getMethodName(jmethodID method); > void printStackTrace(jthread thread); > void printThreadInfo(jthread thread); > > I made use of them while working on a couple of recent bugs and found them very useful. > > Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. src/jdk.jdwp.agent/share/native/libjdwp/util.c line 1715: > 1713: strcpy(tstate, str); > 1714: > 1715: return tstate; Suggestion: return tstate; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21299#discussion_r1783735671 From cjplummer at openjdk.org Wed Oct 2 02:20:48 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 2 Oct 2024 02:20:48 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent [v2] In-Reply-To: References: Message-ID: > The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. > > char* translateThreadState(jint flags); > char* getThreadName(jthread thread); > char* getMethodName(jmethodID method); > void printStackTrace(jthread thread); > void printThreadInfo(jthread thread); > > I made use of them while working on a couple of recent bugs and found them very useful. > > Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: Fix indent ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21299/files - new: https://git.openjdk.org/jdk/pull/21299/files/cbc7cb4f..d9b498bf Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21299&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21299&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21299/head:pull/21299 PR: https://git.openjdk.org/jdk/pull/21299 From dholmes at openjdk.org Wed Oct 2 02:37:41 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 2 Oct 2024 02:37:41 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v7] In-Reply-To: References: Message-ID: <2o8-FUnnVtdpIeoyrvpeBDxee-K252v3ewtZ2gphvWU=.879c4ec1-abca-42ff-9c98-1015c47072aa@github.com> On Thu, 26 Sep 2024 12:29:14 GMT, Robert Toyonaga wrote: >> ### Summary >> This PR just replaces `ThreadCritical` with a lock specific to NMT. `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init. There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests) don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. >> >> Testing: >> - hotspot_nmt >> - gtest:VirtualSpace >> - tier1 > > Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: > > Rename lock and mutex locker. Add back ThreadCritical when protecting mtChunk. Okay I am happy with this now. Thanks. If I heard correctly Thomas is on vacation this month so you may need to proceed with a different second review and follow up when he gets back if there are any problems. I will be on vacation after Friday for 10 days. src/hotspot/share/utilities/vmError.cpp line 723: > 721: // Avoid reentrancy due to mallocs in detailed mode. > 722: MemTracker::reduce_tracking_to_summary(); > 723: // Manually unlock if already holding lock when upon entering error reporting. Suggestion: // Manually unlock if already holding lock upon entering error reporting. ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20852#pullrequestreview-2341807048 PR Review Comment: https://git.openjdk.org/jdk/pull/20852#discussion_r1783770844 From rcastanedalo at openjdk.org Wed Oct 2 08:29:55 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Wed, 2 Oct 2024 08:29:55 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v11] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 15:46:01 GMT, Roman Kennke wrote: > > test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: > > I think I would disable the tests for now. Is there a good way to say 'run this when UCOH is off OR UseSSE>3? I don't think so, due to a [limitation in the IR framework precondition language](https://bugs.openjdk.org/browse/JDK-8294279): `UseCompactObjectHeaders` can only appear within a ["flag precondition"](https://github.com/openjdk/jdk/blob/efe3573b9b4ecec0630fdc1c61c765713a5b68e6/test/hotspot/jtreg/compiler/lib/ir_framework/IR.java#L109) whereas `UseSSE>3` needs to be expressed as a ["CPU feature precondition"](https://github.com/openjdk/jdk/blob/efe3573b9b4ecec0630fdc1c61c765713a5b68e6/test/hotspot/jtreg/compiler/lib/ir_framework/IR.java#L137C14-L137C31) for portability (`UseSSE` is not defined for aarch64), and these two cannot be combined with logical operators. I suggest to disable the IR checks of the failing tests using `applyIf = {"UseCompactObjectHeaders", "false"}` as you did for other similar tests (e.g. `TestMulAddS2I.java`), and document it in [JDK-8340010](https://bugs.openjdk.org/browse/JDK-8340010). Maybe also comment in the tests that the failure happens only with `-XX:UseSSE<=3`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2387906401 From duke at openjdk.org Wed Oct 2 10:25:34 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 2 Oct 2024 10:25:34 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:23:41 GMT, Severin Gehwolf wrote: > PTAL @slovdahl Thanks! @jerboaa Thanks a lot for the thorough investigation here! I was also able to reproduce the failure locally on my Ubuntu 24.04 using `podman` (that runs containers as a regular user): sudo apt install podman make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=podman" ... STDERR: java.lang.RuntimeException: ACCESS_TMP_VIA_PROC_ROOT: Could not find specified process at TestJcmdWithSideCar.testCase01(TestJcmdWithSideCar.java:138) at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:111) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1576) ... ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java >> 1 0 1 0 << ============================== Whereas with `docker` (that runs containers as `root` by default) the test passes: make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker" ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java 1 1 0 0 ============================== With `podman` and the changes in this PR, the test works again. > While at it, I've discovered that the EventGeneratorLoop running container always runs for a fixed time: 30 seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run 60 seconds. Thanks for trying to improve this too, it was quite annoying to have to wait so long for each test run.. ? However, when I'm running the test with `docker` with the changes from this PR (`make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"`) I get a new failure: [docker-failure.log](https://github.com/user-attachments/files/17227971/docker-failure.log). If I revert the test runtime optimization (and keep the disabling part) the test works with `docker` again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2388301598 From rsunderbabu at openjdk.org Wed Oct 2 10:50:39 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 2 Oct 2024 10:50:39 GMT Subject: Integrated: 8334305: Remove all code for nsk.share.Log verbose mode In-Reply-To: References: Message-ID: On Mon, 30 Sep 2024 14:55:33 GMT, Ramkumar Sunderbabu wrote: > Cleaning up nsk.share.Log code after the verbose mode was set always true. > > Tested all the vmTestbase/ tests. This pull request has now been integrated. Changeset: 855c8a7d Author: Ramkumar Sunderbabu URL: https://git.openjdk.org/jdk/commit/855c8a7def21025bc2fc47594f7285a55924c213 Stats: 130 lines in 13 files changed: 0 ins; 100 del; 30 mod 8334305: Remove all code for nsk.share.Log verbose mode Reviewed-by: mli, cjplummer, lmesnik ------------- PR: https://git.openjdk.org/jdk/pull/21267 From sgehwolf at openjdk.org Wed Oct 2 12:08:35 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 12:08:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 10:23:05 GMT, Sebastian L?vdahl wrote: > However, when I'm running the test with `docker` with the changes from this PR (`make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"`) I get a new failure: [docker-failure.log](https://github.com/user-attachments/files/17227971/docker-failure.log). If I revert the test runtime optimization (and keep the disabling part) the test works with `docker` again. Thanks. Fails with: [main-container-process] docker: Error response from daemon: Conflict. The container name "/test-container-main" is already in use by container "258e8ebbbac586ffcc6a7703bcb977bd7b4c203f4badb2ab08e1651ee546c1d6". You have to remove (or rename) that container to be able to reuse that name. [main-container-process] See 'docker run --help'. java.lang.RuntimeException: Timed out while waiting for main() to start at TestJcmdWithSideCar$MainContainer.waitForMainMethodStart(TestJcmdWithSideCar.java:285) at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:110) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1576) We'll have to do `docker rm -i /test-container-main` before we start a new one. I'll fix that later today. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2388475781 From duke at openjdk.org Wed Oct 2 13:28:13 2024 From: duke at openjdk.org (Robert Toyonaga) Date: Wed, 2 Oct 2024 13:28:13 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: > ### Summary > This PR just replaces `ThreadCritical` with a lock specific to NMT. `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init. There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests) don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. > > Testing: > - hotspot_nmt > - gtest:VirtualSpace > - tier1 Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: Update src/hotspot/share/utilities/vmError.cpp Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20852/files - new: https://git.openjdk.org/jdk/pull/20852/files/88e075d1..7ed996e2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20852&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20852&range=06-07 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20852.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20852/head:pull/20852 PR: https://git.openjdk.org/jdk/pull/20852 From duke at openjdk.org Wed Oct 2 13:28:13 2024 From: duke at openjdk.org (Robert Toyonaga) Date: Wed, 2 Oct 2024 13:28:13 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v7] In-Reply-To: <2o8-FUnnVtdpIeoyrvpeBDxee-K252v3ewtZ2gphvWU=.879c4ec1-abca-42ff-9c98-1015c47072aa@github.com> References: <2o8-FUnnVtdpIeoyrvpeBDxee-K252v3ewtZ2gphvWU=.879c4ec1-abca-42ff-9c98-1015c47072aa@github.com> Message-ID: On Wed, 2 Oct 2024 02:34:29 GMT, David Holmes wrote: > Okay I am happy with this now. Thanks. Thank you for the review! > If I heard correctly Thomas is on vacation this month so you may need to proceed with a different second review and follow up when he gets back if there are any problems. I will be on vacation after Friday for 10 days. Okay got it! Thanks for letting me know. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20852#issuecomment-2388637467 From rkennke at openjdk.org Wed Oct 2 15:37:40 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 2 Oct 2024 15:37:40 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v29] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with three additional commits since the last revision: - Revert "Disable TestSplitPacks::test4a, failing on aarch64" This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. - Simplify object init code in interpreter - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/059b1573..aea8f00c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=28 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=27-28 Stats: 47 lines in 6 files changed: 18 ins; 13 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From syan at openjdk.org Wed Oct 2 15:44:58 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 15:44:58 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v3] In-Reply-To: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: > Hi all, > Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). > So this PR add `readlink` permission to make this test work normally. > Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. SendaoYan has updated the pull request incrementally with one additional commit since the last revision: make the comment of java.io.FilePermission look more elegant ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21269/files - new: https://git.openjdk.org/jdk/pull/21269/files/015d17cb..99d6d640 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21269&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21269&range=01-02 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21269.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21269/head:pull/21269 PR: https://git.openjdk.org/jdk/pull/21269 From dcubed at openjdk.org Wed Oct 2 15:44:58 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 2 Oct 2024 15:44:58 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > merge two comments enclosed with /* ... */ on two lines @sendaoYan - This failure is quite noisy in the Oracle CI. We see many failures in Tier[567]. When will you be integrating your fix? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2388992950 From syan at openjdk.org Wed Oct 2 15:44:58 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 15:44:58 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Wed, 2 Oct 2024 15:36:23 GMT, Daniel D. Daugherty wrote: > @sendaoYan - This failure is quite noisy in the Oracle CI. We see many failures in Tier[567]. When will you be integrating your fix? Sorry, these days are statutory holidays in China, so my PR processing is quite slow. I will integrate this PR as soon as possible. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2389001329 From syan at openjdk.org Wed Oct 2 15:44:58 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 15:44:58 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > merge two comments enclosed with /* ... */ on two lines The comment has been changed according the latest review, can anyone review again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2389005889 From syan at openjdk.org Wed Oct 2 15:44:58 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 15:44:58 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: <2LRPLbNHs_V1N6eYyblqBmIrVhu_7m5_BUaiA51z4b4=.d6b2c139-6239-4cc4-bfde-b0f3328a2a5a@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> <2LRPLbNHs_V1N6eYyblqBmIrVhu_7m5_BUaiA51z4b4=.d6b2c139-6239-4cc4-bfde-b0f3328a2a5a@github.com> Message-ID: On Tue, 1 Oct 2024 21:13:35 GMT, David Holmes wrote: >> SendaoYan has updated the pull request incrementally with one additional commit since the last revision: >> >> merge two comments enclosed with /* ... */ on two lines > > test/jdk/com/sun/tools/attach/java.policy.allow line 17: > >> 15: >> 16: /* to read configuration file in META-INF/services, write/delete .attach_pid, >> 17: and read symbolic link of /proc/self/ns/mnt */ > > Suggestion: > > /* > * To read configuration file in META-INF/services, write/delete .attach_pid, > * and read symbolic link of /proc/self/ns/mnt. > */ Thanks for the review. The comment has been changed according your advice. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21269#discussion_r1784795554 From kevinw at openjdk.org Wed Oct 2 16:01:37 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 2 Oct 2024 16:01:37 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v3] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: <1quw7O2R2boEfL4l_aNf4td-s3jXHprrbTt3rikUY14=.a858e530-c8c9-4519-9ae9-972d7abc7cdc@github.com> On Wed, 2 Oct 2024 15:44:58 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > make the comment of java.io.FilePermission look more elegant Looks good, thanks. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21269#pullrequestreview-2343401410 From syan at openjdk.org Wed Oct 2 16:09:40 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 16:09:40 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v3] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Wed, 2 Oct 2024 15:44:58 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > make the comment of java.io.FilePermission look more elegant The latest commit only change the comment. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2389056092 From syan at openjdk.org Wed Oct 2 16:09:41 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 2 Oct 2024 16:09:41 GMT Subject: Integrated: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 In-Reply-To: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Mon, 30 Sep 2024 16:11:27 GMT, SendaoYan wrote: > Hi all, > Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). > So this PR add `readlink` permission to make this test work normally. > Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. This pull request has now been integrated. Changeset: 76283dd2 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/76283dd2701ca4ad5c1c99a66f3e8e3d0fe55d44 Stats: 7 lines in 1 file changed: 3 ins; 2 del; 2 mod 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 Reviewed-by: kevinw, sgehwolf ------------- PR: https://git.openjdk.org/jdk/pull/21269 From sgehwolf at openjdk.org Wed Oct 2 16:50:05 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 16:50:05 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.08 seconds > compile: 2.068 seconds > build: 4.842 seconds > compile: 4.841 seconds > driver: 70.776 seconds > Test results: passed: 1 > > > I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: > > > Passed: containers/docker/TestJcmdWithSideCar.java > build: 2.169 seconds > compile: 2.157 seconds > build: 4.964 seconds > compile: 4.963 seconds > driver: 22.928 seconds > Test results: passed: 1 > > > The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue?... Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: Remove the attachee container if it exists ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21289/files - new: https://git.openjdk.org/jdk/pull/21289/files/5b2f646c..ef7abf24 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21289&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21289&range=00-01 Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21289.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21289/head:pull/21289 PR: https://git.openjdk.org/jdk/pull/21289 From sgehwolf at openjdk.org Wed Oct 2 16:50:05 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 16:50:05 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 12:05:36 GMT, Severin Gehwolf wrote: > We'll have to do `docker rm -i /test-container-main` before we start a new one. I'll fix that later today. Updated in https://github.com/openjdk/jdk/pull/21289/commits/ef7abf249268c30f726bee19dde3337d92c6493d If that doesn't work, I'll remove the test run time optimization. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389138766 From coleenp at openjdk.org Wed Oct 2 17:37:54 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 2 Oct 2024 17:37:54 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v29] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 15:37:40 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with three additional commits since the last revision: > > - Revert "Disable TestSplitPacks::test4a, failing on aarch64" > > This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. > - Simplify object init code in interpreter > - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 Thanks for making this change. I've reviewed runtime, oops and metaspace code. It looks good. ------------- Marked as reviewed by coleenp (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2343632318 From duke at openjdk.org Wed Oct 2 17:53:35 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 2 Oct 2024 17:53:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 16:50:05 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> While at it, I've discovered that the `EventGeneratorLoop` running container always runs for a fixed time: `30` seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run `60` seconds. In my test runs using `-summary:time` it was `70` seconds: >> >> >> Passed: containers/docker/TestJcmdWithSideCar.java >> build: 2.08 seconds >> compile: 2.068 seconds >> build: 4.842 seconds >> compile: 4.841 seconds >> driver: 70.776 seconds >> Test results: passed: 1 >> >> >> I don't think this is needed. We can destroy the process running `EventGeneratorLoop` and then wait for it to exit rather than sitting there and waiting until it is finished (even though we no longer do anything with it). This improvement has been implemented in https://github.com/openjdk/jdk/commit/5b2f646c73b747f6fff364347031074d24e49822 (separate commit). After this, the total runtime of the test reduces to about `22` seconds: >> >> >> Passed: containers/docker/TestJcmdWithSideCar.java >> build: 2.169 seconds >> compile: 2.157 seconds >> build: 4.964 seconds >> compile: 4.963 seconds >> driver: 22.928 seconds >> Test results: passed: 1 >> >> >> The actual test skip of the 4th test case is: https://github.com/openjdk/jdk/commit/95a7cc05f00e94190af583b9f9dbc659c7be879f >> >> Thoughts? Could somebody please run th... > > Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision: > > Remove the attachee container if it exists Right, this turned into a rabbit hole of its own.. ? `make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"` is still failing: Full child process STDOUT was saved to docker-stdout-139602.log [2024-10-02T17:02:06.397293068Z] Waiting for completion for process 139602 [2024-10-02T17:02:06.397362093Z] Waiting for completion finished for process 139602 [COMMAND] docker ps [2024-10-02T17:02:07.771881444Z] Gathering output for process 139723 [ELAPSED: 19 ms] [STDERR] [STDOUT] CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1db392c08e7c jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd "/jdk/bin/java -XX:+?" 5 seconds ago Up 5 seconds test-container-main Full child process STDOUT was saved to docker-stdout-139723.log [2024-10-02T17:02:07.790740367Z] Waiting for completion for process 139723 [2024-10-02T17:02:07.790915466Z] Waiting for completion finished for process 139723 [COMMAND] docker rm test-container-main [2024-10-02T17:02:07.792750591Z] Gathering output for process 139734 [ELAPSED: 15 ms] [STDERR] Error response from daemon: You cannot remove a running container 1db392c08e7cbac3a256597c2ee693fdbbeab3a814cb229c83ac38c0c805f42d. Stop the container before attempting removal or force remove I _think_ the underlying problem is that killing the process from the Java test is not properly propagated to the `EventGeneratorLoop` process running as a Docker container. Among others, I found https://www.kaggle.com/code/residentmario/best-practices-for-propagating-signals-on-docker talking about it. So, in the Docker case the container continues running for the whole 30 seconds even though we called `p.destroy()`. `docker rm` for the next test case will fail because the container is still running. So, I started out by trying this: diff --git test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java index 5132f14d788..4726284cff1 100644 --- test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java +++ test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java @@ -251,8 +251,9 @@ public Process start(final boolean elevated) throws Exception { OutputAnalyzer out = DockerTestUtils.execute(Container.ENGINE_COMMAND, "ps") .shouldHaveExitValue(0); if (out.contains(MAIN_CONTAINER_NAME)) { - DockerTestUtils.execute(Container.ENGINE_COMMAND, "rm", MAIN_CONTAINER_NAME) + DockerTestUtils.execute(Container.ENGINE_COMMAND, "stop", "--time=1", "--signal=SIGKILL", MAIN_CONTAINER_NAME) .shouldHaveExitValue(0); } // start "main" container (the observee) DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop"); ..only to be met by: [main-container-process] docker: Error response from daemon: Conflict. The container name "/test-container-main" is already in use by container "f2754e97e6eecd6b0538e8a8c3d7c12214d16f9f32a9e2fe313c1d9f3258732c". You have to remove (or rename) that container to be able to reuse that name. [main-container-process] See 'docker run --help'. java.lang.RuntimeException: Timed out while waiting for main() to start at TestJcmdWithSideCar$MainContainer.waitForMainMethodStart(TestJcmdWithSideCar.java:293) at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:110) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1576) Because we start containers with `--rm`, they seem to be asynchronously removed _after_ `stop` has finished. Finally, if we wait a little bit after the `stop` command, `make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"` works again. diff --git test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java index 5132f14d788..4726284cff1 100644 --- test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java +++ test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java @@ -251,8 +251,9 @@ public Process start(final boolean elevated) throws Exception { OutputAnalyzer out = DockerTestUtils.execute(Container.ENGINE_COMMAND, "ps") .shouldHaveExitValue(0); if (out.contains(MAIN_CONTAINER_NAME)) { - DockerTestUtils.execute(Container.ENGINE_COMMAND, "rm", MAIN_CONTAINER_NAME) + DockerTestUtils.execute(Container.ENGINE_COMMAND, "stop", "--time=1", "--signal=SIGKILL", MAIN_CONTAINER_NAME) .shouldHaveExitValue(0); + Thread.sleep(1_000L); } // start "main" container (the observee) DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop"); ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389263714 From amenkov at openjdk.org Wed Oct 2 17:54:39 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 2 Oct 2024 17:54:39 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 02:20:48 GMT, Chris Plummer wrote: >> The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. >> >> char* translateThreadState(jint flags); >> char* getThreadName(jthread thread); >> char* getMethodName(jmethodID method); >> void printStackTrace(jthread thread); >> void printThreadInfo(jthread thread); >> >> I made use of them while working on a couple of recent bugs and found them very useful. >> >> Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. > > Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: > > Fix indent Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21299#pullrequestreview-2343661989 From sgehwolf at openjdk.org Wed Oct 2 18:30:37 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 18:30:37 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 17:50:44 GMT, Sebastian L?vdahl wrote: > Right, this turned into a rabbit hole of its own.. ? Thanks. I'll remove this part from the patch as it's orthogonal to the actual issue and would just like to get the test passing again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389419514 From larry.cable at oracle.com Wed Oct 2 18:31:47 2024 From: larry.cable at oracle.com (Laurence Cable) Date: Wed, 2 Oct 2024 11:31:47 -0700 Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: Daniel I plan to push a PR that will fix the attach code later today! - Larry On 10/2/24 8:44 AM, Daniel D. Daugherty wrote: > On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: > >>> Hi all, >>> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >>> So this PR add `readlink` permission to make this test work normally. >>> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. >> SendaoYan has updated the pull request incrementally with one additional commit since the last revision: >> >> merge two comments enclosed with /* ... */ on two lines > @sendaoYan - This failure is quite noisy in the Oracle CI. We see > many failures in Tier[567]. When will you be integrating your fix? > > ------------- > > PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2388992950 From sgehwolf at openjdk.org Wed Oct 2 18:46:07 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 18:46:07 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v3] In-Reply-To: References: Message-ID: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: - Revert "Improve runtime of test" This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. - Revert "Remove the attachee container if it exists" This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21289/files - new: https://git.openjdk.org/jdk/pull/21289/files/ef7abf24..24a4303f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21289&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21289&range=01-02 Stats: 13 lines in 1 file changed: 3 ins; 10 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21289.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21289/head:pull/21289 PR: https://git.openjdk.org/jdk/pull/21289 From sgehwolf at openjdk.org Wed Oct 2 18:46:07 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 2 Oct 2024 18:46:07 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:28:11 GMT, Severin Gehwolf wrote: > > Right, this turned into a rabbit hole of its own.. ? > > Thanks. I'll remove this part from the patch as it's orthogonal to the actual issue and would just like to get the test passing again. Filed https://bugs.openjdk.org/browse/JDK-8341436 to track this separate issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389444807 From duke at openjdk.org Wed Oct 2 18:54:35 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 2 Oct 2024 18:54:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. LGTM ------------- Marked as reviewed by slovdahl at github.com (no known OpenJDK username). PR Review: https://git.openjdk.org/jdk/pull/21289#pullrequestreview-2343841970 From alanb at openjdk.org Wed Oct 2 18:59:09 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 2 Oct 2024 18:59:09 GMT Subject: RFR: 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently Message-ID: This is a test only change. VirtualThreadSchedulerMXBeanTest.testReduceParallelism can fail if getMountedVirtualThreadCount over estimates the number of mounted virtual threads. The change is changed from using getMountedVirtualThreadCount to use an awaitXXX method that will sample the mounted virtual thread count until it reads an expected value. As part of the change, the awaitXXX supporting methods are changed to take a predicate and the trace message. ------------- Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/21310/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21310&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8339979 Stats: 55 lines in 1 file changed: 18 ins; 10 del; 27 mod Patch: https://git.openjdk.org/jdk/pull/21310.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21310/head:pull/21310 PR: https://git.openjdk.org/jdk/pull/21310 From duke at openjdk.org Wed Oct 2 19:03:36 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 2 Oct 2024 19:03:36 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:42:43 GMT, Severin Gehwolf wrote: > Filed https://bugs.openjdk.org/browse/JDK-8341436 to track this separate issue. Do you intend to look into this yourself? If not, I would be happy to pick it up. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389475940 From duke at openjdk.org Wed Oct 2 19:40:35 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 2 Oct 2024 19:40:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. > It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). I spent some time thinking about this, and I'm not sure if it can be solved? The test case that fails with Podman is `ACCESS_TMP_VIA_PROC_ROOT`. That is, we try to attach to another JVM by accessing the target JVM's root filesystem through `/proc/[pid]/root`. But for processes with elevated privileges `/proc/[pid]/root` can only be read by `root`. That is why it works with the default setup of Docker but not Podman. Or am I missing something? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2389535881 From larry.cable at oracle.com Wed Oct 2 20:00:37 2024 From: larry.cable at oracle.com (Laurence Cable) Date: Wed, 2 Oct 2024 13:00:37 -0700 Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v2] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: fix to 8327114 pushed. https://github.com/openjdk/jdk/pull/21312 On 10/2/24 8:44 AM, Daniel D. Daugherty wrote: > On Tue, 1 Oct 2024 15:38:56 GMT, SendaoYan wrote: > >>> Hi all, >>> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >>> So this PR add `readlink` permission to make this test work normally. >>> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. >> SendaoYan has updated the pull request incrementally with one additional commit since the last revision: >> >> merge two comments enclosed with /* ... */ on two lines > @sendaoYan - This failure is quite noisy in the Oracle CI. We see > many failures in Tier[567]. When will you be integrating your fix? > > ------------- > > PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2388992950 From duke at openjdk.org Wed Oct 2 20:02:05 2024 From: duke at openjdk.org (Larry Cable) Date: Wed, 2 Oct 2024 20:02:05 GMT Subject: RFR: JDK-8327114: fix to resolve permissions issue as per: 8341246 Message-ID: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 to resolve an issue detected in: https://bugs.openjdk.org/browse/JDK-8341246 sym link file accesses should be performed as "privileged" actions. ------------- Commit messages: - JDK-8327114: fix to resolve permissions issue as per: 8341246 Changes: https://git.openjdk.org/jdk/pull/21312/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21312&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8327114 Stats: 18 lines in 1 file changed: 12 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/21312.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21312/head:pull/21312 PR: https://git.openjdk.org/jdk/pull/21312 From duke at openjdk.org Wed Oct 2 20:02:05 2024 From: duke at openjdk.org (Larry Cable) Date: Wed, 2 Oct 2024 20:02:05 GMT Subject: RFR: JDK-8327114: fix to resolve permissions issue as per: 8341246 In-Reply-To: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 19:55:29 GMT, Larry Cable wrote: > this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 > > to resolve an issue detected in: > > https://bugs.openjdk.org/browse/JDK-8341246 > > sym link file accesses should be performed as "privileged" actions. @kevinjwalls @slovdahl @jerboaa @sendaoYan @dcubed-ojdk ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2389569445 From duke at openjdk.org Wed Oct 2 21:15:11 2024 From: duke at openjdk.org (Larry Cable) Date: Wed, 2 Oct 2024 21:15:11 GMT Subject: RFR: JDK-8327114: fix to resolve permissions issue as per: 8341246 [v2] In-Reply-To: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: > this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 > > to resolve an issue detected in: > > https://bugs.openjdk.org/browse/JDK-8341246 > > sym link file accesses should be performed as "privileged" actions. Larry Cable has updated the pull request incrementally with one additional commit since the last revision: JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21312/files - new: https://git.openjdk.org/jdk/pull/21312/files/99a9b1b4..881bc574 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21312&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21312&range=00-01 Stats: 21 lines in 1 file changed: 12 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/21312.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21312/head:pull/21312 PR: https://git.openjdk.org/jdk/pull/21312 From sviswanathan at openjdk.org Wed Oct 2 21:31:52 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Wed, 2 Oct 2024 21:31:52 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> Message-ID: On Mon, 30 Sep 2024 17:48:13 GMT, Roman Kennke wrote: >> Wait a second, I've probably not been clear. `UseCompactObjectHeaders` is slated to become *on by default* and then slated to go away. That means that array base offets <= 16 bytes will become the default. The generated code will be something like: >> >> >> if (haystack_len <= 8) { >> // Copy 8 bytes onto stack >> } else if (haystack_len <= 16) { >> // Copy 16 bytes onto stack >> } else { >> // Copy 32 bytes onto stack >> } >> >> >> So that is 2 branches in this prologue code instead of originally 1. >> >> However, I just noticed that what I proposed is not enough. Consider what happens when haystack_len is 17. This would take the last case and copy 32 bytes. But we only have 17+8=25 bytes that we can guarantee to be available for copying. If this happens to be the array at the very beginning of the heap (very rare/unlikely), this would segfault. >> >> I think I need to mull over it some more to come up with a correct fix. > > I changed the header<16 version to be a small loop: https://github.com/rkennke/jdk/commit/bcba264ea5c15581647933db1163ca1dae39b6c5 > > The idea is the same as before, except it's made as a small loop with a maximum of 4 iterations (backward-branches), and it copies 8 bytes at a time, such that 1. it may copy up to 7 bytes that precede the array and 2. doesn't run over the end of the array (which would potentially crash). > > I am not sure if using XMM_TMP1 and XMM_TMP2 there is ok, or if it would encode better to use one of the regular registers.? > > Also, this new implementation could simply replace the old one, instead of being an alternative. I am not sure if if would make any difference performance-wise. @rkennke The small loop looks to me that it will run over the end of the array. Say the haystack_len is 7, the index below would be 0 after the shrq instruction, and the movq(XMM_TMP1, Address(haystack, index, Address::times_8)) in the loop will read 8 bytes i.e. one byte past the end of the array: // num_words (zero-based) = (haystack_len - 1) / 8; __ movq(index, haystack_len); __ subq(index, 1); __ shrq(index, LogBytesPerWord); __ bind(L_loop); __ movq(XMM_TMP1, Address(haystack, index, Address::times_8)); __ movq(Address(rsp, index, Address::times_8), XMM_TMP1); __ subq(index, 1); __ jcc(Assembler::positive, L_loop); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1785269849 From dhanalla at openjdk.org Thu Oct 3 02:23:35 2024 From: dhanalla at openjdk.org (Dhamoder Nalla) Date: Thu, 3 Oct 2024 02:23:35 GMT Subject: RFR: 8337408: Use GetTempPath2 API instead of GetTempPath [v2] In-Reply-To: References: Message-ID: On Thu, 26 Sep 2024 16:17:49 GMT, Chris Plummer wrote: >> Dhamoder Nalla has updated the pull request incrementally with one additional commit since the last revision: >> >> fix missing code > > I don't have a suggestion for maintaining compatibility other than not making the change. Thank you @plummercj, @kevinjwalls, We appreciate your concerns regarding compatibility. However, we implemented this change to enhance security. According to the documentation at https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppatha#remarks, it is recommended to use GetTempPath2. If you believe that compatibility is more critical than the security improvements we've made, we are willing to close the pull request. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20600#issuecomment-2390368801 From dholmes at openjdk.org Thu Oct 3 02:20:39 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 3 Oct 2024 02:20:39 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 13:28:13 GMT, Robert Toyonaga wrote: >> ### Summary >> This PR just replaces `ThreadCritical` with a lock specific to NMT. `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init. There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests) don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. >> >> Testing: >> - hotspot_nmt >> - gtest:VirtualSpace >> - tier1 > > Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: > > Update src/hotspot/share/utilities/vmError.cpp > > Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> Marked as reviewed by dholmes (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20852#pullrequestreview-2344511961 From duke at openjdk.org Thu Oct 3 05:30:40 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Thu, 3 Oct 2024 05:30:40 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 19:01:19 GMT, Sebastian L?vdahl wrote: > > Filed https://bugs.openjdk.org/browse/JDK-8341436 to track this separate issue. > > Do you intend to look into this yourself? If not, I would be happy to pick it up. It finally occurred to my why `p.destroy()` doesn't seem to have any effect: the process the Java test sees is just a short-lived one that calls the Docker daemon. That is, it is _not_ a reference to the container process itself and it cannot stop the container. That needs to go through a `docker stop` call. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2390554034 From sgehwolf at openjdk.org Thu Oct 3 08:03:34 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 08:03:34 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 19:59:31 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > @kevinjwalls @slovdahl @jerboaa @sendaoYan @dcubed-ojdk @larry-cable [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) is fixed. This PR should get integrated with a new bug. It cannot use the same bug unless it's a backport, which this clearly isn't. Also the permission issue is fixed with https://github.com/openjdk/jdk/pull/21269 (integrated). ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2390770485 From sgehwolf at openjdk.org Thu Oct 3 08:06:35 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 08:06:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v2] In-Reply-To: References: Message-ID: On Thu, 3 Oct 2024 05:27:33 GMT, Sebastian L?vdahl wrote: > > Filed https://bugs.openjdk.org/browse/JDK-8341436 to track this separate issue. > > Do you intend to look into this yourself? If not, I would be happy to pick it up. Please go ahead and have a go at this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2390775602 From kevinw at openjdk.org Thu Oct 3 08:42:35 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 3 Oct 2024 08:42:35 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v2] In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 21:15:11 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations I tested and saw the permission problem in the test was fixed by the policy update. But it's correct that it should really have a doPrivileged call, in case this happens with a Security Manager, and there's untrusted code which then calls into attach (with whatever policy permits that to happen...). While SM is planned for removal very soon, it would be good have the doPrivileged in the implementation so any backports can benefit. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2390845932 From alanb at openjdk.org Thu Oct 3 09:03:06 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 3 Oct 2024 09:03:06 GMT Subject: RFR: 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently [v2] In-Reply-To: References: Message-ID: > This is a test only change. VirtualThreadSchedulerMXBeanTest.testReduceParallelism can fail when getMountedVirtualThreadCount over estimates the number of mounted virtual threads. > > The test is changed from using getMountedVirtualThreadCount to sample the result until it reads the expected value. > > As part of the change, the awaitXXX supporting methods are refactored to take a predicate and the trace message. Alan Bateman has updated the pull request incrementally with one additional commit since the last revision: Bring back Gte/Lte methods, reduces changes to one test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21310/files - new: https://git.openjdk.org/jdk/pull/21310/files/d65a371c..be9e8b92 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21310&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21310&range=00-01 Stats: 56 lines in 1 file changed: 43 ins; 2 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/21310.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21310/head:pull/21310 PR: https://git.openjdk.org/jdk/pull/21310 From sgehwolf at openjdk.org Thu Oct 3 09:35:35 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 09:35:35 GMT Subject: RFR: 8327114: Attach in Linux may have wrong behaviour when pid == ns_pid (Kubernetes debug container) [v2] In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: <3SM1_PdGMqnY6gcjdXMN-Ww7aelcKVxKS4Nw_MBxFjQ=.4f53c2a2-02a0-4427-beea-9a9eb5600cfd@github.com> On Wed, 2 Oct 2024 21:15:11 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations Yes, agreed. But we need a new bug for this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2390953016 From kevinw at openjdk.org Thu Oct 3 09:39:36 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 3 Oct 2024 09:39:36 GMT Subject: RFR: 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently [v2] In-Reply-To: References: Message-ID: <2rNASxxRjzZ8FHyAN5cIbhAVUP9QW5SsONv5g_kzEjI=.23451e9c-a648-4d0b-9308-89ef03116806@github.com> On Thu, 3 Oct 2024 09:03:06 GMT, Alan Bateman wrote: >> This is a test only change. VirtualThreadSchedulerMXBeanTest.testReduceParallelism can fail when getMountedVirtualThreadCount over estimates the number of mounted virtual threads. >> >> The test is changed from using getMountedVirtualThreadCount to sample the result until it reads the expected value. >> >> As part of the change, the awaitXXX supporting methods are refactored to take a predicate and the trace message. > > Alan Bateman has updated the pull request incrementally with one additional commit since the last revision: > > Bring back Gte/Lte methods, reduces changes to one test Hi, looks really good. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21310#pullrequestreview-2345117198 From sgehwolf at openjdk.org Thu Oct 3 10:21:35 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 10:21:35 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:56:11 GMT, Kevin Walls wrote: > I can check our testing with this change... @kevinjwalls Any update on this? Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2391044188 From kevinw at openjdk.org Thu Oct 3 10:46:37 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 3 Oct 2024 10:46:37 GMT Subject: RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114 [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. Good timing, I was just writing: Thanks, looks good. Good to delay the additional changes. Would be great if you can change the bug and PR title to something like: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) (Multiple "test fails after..." bugs are confusing to me at least!) With the test as it stands in the repo currently, I am seeing another failure. I don't get this myself with the change in this PR, but that may just be luck. It's on Linux x64, with TMP_MOUNTED_INTO_SIDECAR, where the command: docker run --tty=true --rm --cap-add=SYS_PTRACE --sig-proxy=true --pid=container:test-container-main --cap-add=NET_BIND_SERVICE --user=10668:10668 --volumes-from test-container-main jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd /jdk/bin/jcmd -l ...gets no output, where a good run would show: [STDOUT] 1 EventGeneratorLoop 120 24 jdk.jcmd/sun.tools.jcmd.JCmd -l e.g. [main-container-process] MAIN_METHOD_STARTED, argument is 120 Attach strategy TMP_MOUNTED_INTO_SIDECAR [COMMAND] docker run --tty=true --rm --cap-add=SYS_PTRACE --sig-proxy=true --pid=container:test-container-main --cap-add=NET_BIND_SERVICE --user=10668:10668 --volumes-from test-container-main jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd /jdk/bin/jcmd -l [2024-10-03T04:30:35.273416534Z] Gathering output for process 12125 [ELAPSED: 1068 ms] [STDERR] [STDOUT] Full child process STDOUT was saved to docker-stdout-12125.log [2024-10-03T04:30:36.341378706Z] Waiting for completion for process 12125 [2024-10-03T04:30:36.341534140Z] Waiting for completion finished for process 12125 [COMMAND] docker rmi --force jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd [2024-10-03T04:30:36.349399928Z] Gathering output for process 12260 [ELAPSED: 27 ms] [STDERR] [STDOUT] Untagged: jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd Full child process STDOUT was saved to docker-stdout-12260.log ----------System.err:(16/748)---------- stdout: []; stderr: [] exitValue = 0 java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253) at TestJcmdWithSideCar.testCase01(TestJcmdWithSideCar.java:135) at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:111) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1576) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2391093691 From sgehwolf at openjdk.org Thu Oct 3 12:20:36 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 12:20:36 GMT Subject: RFR: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) [v3] In-Reply-To: References: Message-ID: On Thu, 3 Oct 2024 10:43:56 GMT, Kevin Walls wrote: >> Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: >> >> - Revert "Improve runtime of test" >> >> This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. >> - Revert "Remove the attachee container if it exists" >> >> This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. > > Good timing, I was just writing: > > Thanks, looks good. Good to delay the additional changes. > Would be great if you can change the bug and PR title to something like: > 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) > (Multiple "test fails after..." bugs are confusing to me at least!) > > With the test as it stands in the repo currently, I am seeing another failure. I don't get this myself with the change in this PR, but that may just be luck. > > It's on Linux x64, with TMP_MOUNTED_INTO_SIDECAR, where the command: > > docker run --tty=true --rm --cap-add=SYS_PTRACE --sig-proxy=true --pid=container:test-container-main --cap-add=NET_BIND_SERVICE --user=10668:10668 --volumes-from test-container-main jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd /jdk/bin/jcmd -l > > ...gets no output, where a good run would show: > > [STDOUT] > 1 EventGeneratorLoop 120 > 24 jdk.jcmd/sun.tools.jcmd.JCmd -l > > e.g. > > > [main-container-process] MAIN_METHOD_STARTED, argument is 120 > Attach strategy TMP_MOUNTED_INTO_SIDECAR > [COMMAND] > docker run --tty=true --rm --cap-add=SYS_PTRACE --sig-proxy=true --pid=container:test-container-main --cap-add=NET_BIND_SERVICE --user=10668:10668 --volumes-from test-container-main jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd /jdk/bin/jcmd -l > [2024-10-03T04:30:35.273416534Z] Gathering output for process 12125 > [ELAPSED: 1068 ms] > [STDERR] > > [STDOUT] > > Full child process STDOUT was saved to docker-stdout-12125.log > [2024-10-03T04:30:36.341378706Z] Waiting for completion for process 12125 > [2024-10-03T04:30:36.341534140Z] Waiting for completion finished for process 12125 > [COMMAND] > docker rmi --force jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd > [2024-10-03T04:30:36.349399928Z] Gathering output for process 12260 > [ELAPSED: 27 ms] > [STDERR] > > [STDOUT] > Untagged: jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd > > Full child process STDOUT was saved to docker-stdout-12260.log > ----------System.err:(16/748)---------- > stdout: []; > stderr: [] > exitValue = 0 > > java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr > at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253) > at TestJcmdWithSideCar.testCase01(TestJcmdWithSideCar.java:135) > at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:111) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) > at java.base/java.lang.reflect.Met... @kevinjwalls > Thanks, looks good. Good to delay the additional changes. Would be great if you can change the bug and PR title to something like: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) (Multiple "test fails after..." bugs are confusing to me at least!) OK. Done. > With the test as it stands in the repo currently, I am seeing another failure. I don't get this myself with the change in this PR, but that may just be luck. I'm confused. Are you saying that after this patch in revision https://github.com/openjdk/jdk/pull/21289/commits/24a4303f75fb854098a74ddf6be98a7981a45cc8 there are still failures in Oracle's CI? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2391275788 From kevinw at openjdk.org Thu Oct 3 12:42:36 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 3 Oct 2024 12:42:36 GMT Subject: RFR: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. Marked as reviewed by kevinw (Reviewer). Sorry, was saying that the other failure type, ("'sun.tools.jcmd.JCmd' missing") is happening now in CI. I have not reproduced it with the change in this PR. But, as that "other" failure is happening with "sidecar", skipping ACCESS_TMP_VIA_PROC_ROOT should not fix it? So maybe there is e.g. a chance/timing problem. Either way, this change as it stands is still good, I think we should get it in to minimise the problems. I can monitor and see if the "JCmd missing" problem happens again. ------------- PR Review: https://git.openjdk.org/jdk/pull/21289#pullrequestreview-2345497444 PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2391318529 From sgehwolf at openjdk.org Thu Oct 3 12:58:41 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 12:58:41 GMT Subject: RFR: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2391348632 From sgehwolf at openjdk.org Thu Oct 3 12:58:42 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 3 Oct 2024 12:58:42 GMT Subject: Integrated: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 16:16:36 GMT, Severin Gehwolf wrote: > The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): > > 1. Shared volumes between attachee and attacher and shared pid namespace > 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges > 3. Shared pid namespace between attachee and attacher only > 4. Shared pid namespace between attachee and attacher, both running with elevated privileges > > The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). > > Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! This pull request has now been integrated. Changeset: 21f8ccf4 Author: Severin Gehwolf URL: https://git.openjdk.org/jdk/commit/21f8ccf4a97313593f210f9a07e56d5ff92b7aa5 Stats: 9 lines in 1 file changed: 8 ins; 1 del; 0 mod 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) Reviewed-by: kevinw ------------- PR: https://git.openjdk.org/jdk/pull/21289 From alanb at openjdk.org Thu Oct 3 14:05:40 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 3 Oct 2024 14:05:40 GMT Subject: Integrated: 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:34:53 GMT, Alan Bateman wrote: > This is a test only change. VirtualThreadSchedulerMXBeanTest.testReduceParallelism can fail when getMountedVirtualThreadCount over estimates the number of mounted virtual threads. > > The test is changed from using getMountedVirtualThreadCount to sample the result until it reads the expected value. > > As part of the change, the awaitXXX supporting methods are refactored to take a predicate and the trace message. This pull request has now been integrated. Changeset: eb93e695 Author: Alan Bateman URL: https://git.openjdk.org/jdk/commit/eb93e6952b5d2dbe78cd9680855ac99c69b3dcb2 Stats: 80 lines in 1 file changed: 57 ins; 8 del; 15 mod 8339979: VirtualThreadSchedulerMXBeanTest.testReduceParallelism fails intermittently Reviewed-by: kevinw ------------- PR: https://git.openjdk.org/jdk/pull/21310 From duke at openjdk.org Thu Oct 3 17:22:38 2024 From: duke at openjdk.org (Larry Cable) Date: Thu, 3 Oct 2024 17:22:38 GMT Subject: RFR: 8341482: Attach API access to /proc filesystem should use doPrivileged [v2] In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 21:15:11 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations done wondering if the other filesystem operations in VirtualMachineImpl also need to be wrapped in doPrivileged blocks - since I'm not aware of any issues I'll assume not and patiently wait for the SecurityManager to be consigned to history. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2391933529 PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2391936122 From cjplummer at openjdk.org Thu Oct 3 18:48:42 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 3 Oct 2024 18:48:42 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 02:20:48 GMT, Chris Plummer wrote: >> The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. >> >> char* translateThreadState(jint flags); >> char* getThreadName(jthread thread); >> char* getMethodName(jmethodID method); >> void printStackTrace(jthread thread); >> void printThreadInfo(jthread thread); >> >> I made use of them while working on a couple of recent bugs and found them very useful. >> >> Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. > > Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: > > Fix indent Can I get a 2nd review please? thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21299#issuecomment-2392092514 From coleenp at openjdk.org Thu Oct 3 20:30:56 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Thu, 3 Oct 2024 20:30:56 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v29] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 15:37:40 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with three additional commits since the last revision: > > - Revert "Disable TestSplitPacks::test4a, failing on aarch64" > > This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. > - Simplify object init code in interpreter > - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 I posted a patch for JDK-8341044 for CDSPluginTest.java that was failing in our testing with the Lilliput patch. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2392273233 From duke at openjdk.org Fri Oct 4 05:16:34 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Fri, 4 Oct 2024 05:16:34 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run In-Reply-To: References: Message-ID: On Thu, 3 Oct 2024 19:13:46 GMT, Sebastian L?vdahl wrote: > The fix is twofold. > > 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. > > 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. > > On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. > > Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. > > Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both > `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. > > https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. This was tested with $ head -n 4 /etc/os-release PRETTY_NAME="Ubuntu 24.04.1 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.1 LTS (Noble Numbat)" $ docker --version Docker version 24.0.7, build 24.0.7-0ubuntu4.1 $ podman --version podman version 4.9.3 ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2392837773 From kevinw at openjdk.org Fri Oct 4 08:17:41 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Fri, 4 Oct 2024 08:17:41 GMT Subject: RFR: 8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) [v3] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 18:46:07 GMT, Severin Gehwolf wrote: >> The change of [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) also increased test coverage. In particular, the `TestJcmdWithSideCar.java` test got enhanced to cover these cases (prior to [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114) only case 1 was tested): >> >> 1. Shared volumes between attachee and attacher and shared pid namespace >> 2. Shared volumes between attachee and attacher and shared pid namespace, both running with elevated privileges >> 3. Shared pid namespace between attachee and attacher only >> 4. Shared pid namespace between attachee and attacher, both running with elevated privileges >> >> The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case, `4`, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349). >> >> Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you! > > Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "Improve runtime of test" > > This reverts commit 5b2f646c73b747f6fff364347031074d24e49822. > - Revert "Remove the attachee container if it exists" > > This reverts commit ef7abf249268c30f726bee19dde3337d92c6493d. This change is working, having the intended effect. 8-) I logged https://bugs.openjdk.org/browse/JDK-8341518 to follow up the separate intermittent failure we are seeing: java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr ------------- PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2393111779 From rkennke at openjdk.org Fri Oct 4 10:44:53 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Fri, 4 Oct 2024 10:44:53 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> Message-ID: On Wed, 2 Oct 2024 21:29:28 GMT, Sandhya Viswanathan wrote: >> I changed the header<16 version to be a small loop: https://github.com/rkennke/jdk/commit/bcba264ea5c15581647933db1163ca1dae39b6c5 >> >> The idea is the same as before, except it's made as a small loop with a maximum of 4 iterations (backward-branches), and it copies 8 bytes at a time, such that 1. it may copy up to 7 bytes that precede the array and 2. doesn't run over the end of the array (which would potentially crash). >> >> I am not sure if using XMM_TMP1 and XMM_TMP2 there is ok, or if it would encode better to use one of the regular registers.? >> >> Also, this new implementation could simply replace the old one, instead of being an alternative. I am not sure if if would make any difference performance-wise. > > @rkennke The small loop looks to me that it will run over the end of the array. > Say the haystack_len is 7, the index below would be 0 after the shrq instruction, and the movq(XMM_TMP1, Address(haystack, index, Address::times_8)) in the loop will read 8 bytes i.e. one byte past the end of the array: > // num_words (zero-based) = (haystack_len - 1) / 8; > __ movq(index, haystack_len); > __ subq(index, 1); > __ shrq(index, LogBytesPerWord); > > __ bind(L_loop); > __ movq(XMM_TMP1, Address(haystack, index, Address::times_8)); > __ movq(Address(rsp, index, Address::times_8), XMM_TMP1); > __ subq(index, 1); > __ jcc(Assembler::positive, L_loop); Yes, and that is intentional. Say, haystack_len is 7, then the first block computes the adjustment of the haystack, which is 8 - (7 % 8) = 1. We adjust the haystack pointer one byte down, so that when we copy (multiple of) 8 bytes, we land on the last byte. We do copy a few bytes that are preceding the array, which is part of the object header and guaranteed to be >= 8 bytes. Then we compute the number of words to copy, but make it 0-based. That is '0' is 1 word, '1' is 2 words, etc. It makes the loop nicer. In this example we get 0, which means we copy one word from the adjusted haystack, which is correct. Then comes the actual loop. Afterwards we adjust the haystack pointer so that it points to the first array element that we just copied onto the stack, ignoring the few garbage bytes that we also copied. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1787528501 From rkennke at openjdk.org Fri Oct 4 11:15:37 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Fri, 4 Oct 2024 11:15:37 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 76 commits: - Merge remote-tracking branch 'rkennke/JDK-8305895-v4' into JDK-8305895-v4 - Revert "Disable TestSplitPacks::test4a, failing on aarch64" This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. - Simplify object init code in interpreter - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 - Fix for CDSPluginTest.java - Merge tag 'jdk-24+18' into JDK-8305895-v4 Added tag jdk-24+18 for changeset 19642bd3 - Disable TestSplitPacks::test4a, failing on aarch64 - @robcasloz review comments - Improve CollectedHeap::is_oop() - Allow LM_MONITOR on 32-bit platforms - ... and 66 more: https://git.openjdk.org/jdk/compare/19642bd3...8742f3c1 ------------- Changes: https://git.openjdk.org/jdk/pull/20677/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=29 Stats: 4560 lines in 196 files changed: 3207 ins; 724 del; 629 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From sspitsyn at openjdk.org Fri Oct 4 11:58:37 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 4 Oct 2024 11:58:37 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 02:20:48 GMT, Chris Plummer wrote: >> The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. >> >> char* translateThreadState(jint flags); >> char* getThreadName(jthread thread); >> char* getMethodName(jmethodID method); >> void printStackTrace(jthread thread); >> void printThreadInfo(jthread thread); >> >> I made use of them while working on a couple of recent bugs and found them very useful. >> >> Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. > > Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: > > Fix indent Marked as reviewed by sspitsyn (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21299#pullrequestreview-2347879062 From coleenp at openjdk.org Fri Oct 4 12:53:53 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Fri, 4 Oct 2024 12:53:53 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: On Fri, 4 Oct 2024 11:15:37 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 76 commits: > > - Merge remote-tracking branch 'rkennke/JDK-8305895-v4' into JDK-8305895-v4 > - Revert "Disable TestSplitPacks::test4a, failing on aarch64" > > This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. > - Simplify object init code in interpreter > - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 > - Fix for CDSPluginTest.java > - Merge tag 'jdk-24+18' into JDK-8305895-v4 > > Added tag jdk-24+18 for changeset 19642bd3 > - Disable TestSplitPacks::test4a, failing on aarch64 > - @robcasloz review comments > - Improve CollectedHeap::is_oop() > - Allow LM_MONITOR on 32-bit platforms > - ... and 66 more: https://git.openjdk.org/jdk/compare/19642bd3...8742f3c1 There's another test failure that we're seeing that's similar to this bug in mainline when running with -XX:+UseCompactObjectHeaders on aarch64: https://bugs.openjdk.org/browse/JDK-8340212 ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2393637283 From wkemper at openjdk.org Fri Oct 4 18:21:34 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 4 Oct 2024 18:21:34 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v2] In-Reply-To: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: > This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. William Kemper 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 475 additional commits since the last revision: - Merge branch 'shenandoah/master' into great-genshen-pr-redux - Merge - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane Reviewed-by: kdnilsen - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode Reviewed-by: kdnilsen, ysr - Merge - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle Reviewed-by: kdnilsen - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation Reviewed-by: kdnilsen, shade, ysr - Merge - 8339643: Port JEP 404 to RISC-V Reviewed-by: wkemper, kdnilsen - 8340395: GenShen: Remove unnecessary check on card barrier flag Reviewed-by: ysr - ... and 465 more: https://git.openjdk.org/jdk/compare/143b2cd8...ed16e3ec ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21273/files - new: https://git.openjdk.org/jdk/pull/21273/files/8b25abe0..ed16e3ec Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21273&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21273&range=00-01 Stats: 25330 lines in 433 files changed: 21577 ins; 2314 del; 1439 mod Patch: https://git.openjdk.org/jdk/pull/21273.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21273/head:pull/21273 PR: https://git.openjdk.org/jdk/pull/21273 From cjplummer at openjdk.org Fri Oct 4 20:08:39 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 4 Oct 2024 20:08:39 GMT Subject: RFR: 8341295: Add some useful debugging APIs to the debug agent [v2] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 02:20:48 GMT, Chris Plummer wrote: >> The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. >> >> char* translateThreadState(jint flags); >> char* getThreadName(jthread thread); >> char* getMethodName(jmethodID method); >> void printStackTrace(jthread thread); >> void printThreadInfo(jthread thread); >> >> I made use of them while working on a couple of recent bugs and found them very useful. >> >> Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. > > Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: > > Fix indent Thanks for the reviews Alex and Serguei! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21299#issuecomment-2394490693 From cjplummer at openjdk.org Fri Oct 4 21:19:51 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 4 Oct 2024 21:19:51 GMT Subject: Integrated: 8341295: Add some useful debugging APIs to the debug agent In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 21:58:31 GMT, Chris Plummer wrote: > The following APIs are useful when debugging the debug agent. Calls to them can be added to the code as needed (temporarily) to aid in debugging issues. They were taken from `test/lib/jdk/test/lib/jvmti/jvmti_common.hpp` and modified to better fit the needs and coding style of the debug agent. > > char* translateThreadState(jint flags); > char* getThreadName(jthread thread); > char* getMethodName(jmethodID method); > void printStackTrace(jthread thread); > void printThreadInfo(jthread thread); > > I made use of them while working on a couple of recent bugs and found them very useful. > > Tested by running all debugging tests on all supported platforms, and also running tier2, tier3, and tier5 svc ci test tasks. This pull request has now been integrated. Changeset: 33e4bfdf Author: Chris Plummer URL: https://git.openjdk.org/jdk/commit/33e4bfdf919c44bebcf122818ab92deeb1f1cdce Stats: 188 lines in 2 files changed: 188 ins; 0 del; 0 mod 8341295: Add some useful debugging APIs to the debug agent Reviewed-by: amenkov, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/21299 From syan at openjdk.org Sat Oct 5 03:29:39 2024 From: syan at openjdk.org (SendaoYan) Date: Sat, 5 Oct 2024 03:29:39 GMT Subject: RFR: 8341246: Test com/sun/tools/attach/PermissionTest.java fails access denied after JDK-8327114 [v3] In-Reply-To: References: <_QJIWTQHDLJKjHfmY-PcVwgEYVodnSnN-FrvypFE0ys=.a61f9d5f-0a9e-4fc4-86cb-18c23d24d95f@github.com> Message-ID: On Wed, 2 Oct 2024 15:44:58 GMT, SendaoYan wrote: >> Hi all, >> Test `com/sun/tools/attach/PermissionTest.java` fails access denied after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). This testcase need the `readlink` permission of file `/proc/self/ns/mnt` after [JDK-8327114](https://bugs.openjdk.org/browse/JDK-8327114). >> So this PR add `readlink` permission to make this test work normally. >> Before this PR, test run failed, after this PR, test run success. Test fix only, no risk. > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > make the comment of java.io.FilePermission look more elegant Thanks all for the review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21269#issuecomment-2394883598 From stefank at openjdk.org Mon Oct 7 08:55:59 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 7 Oct 2024 08:55:59 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: On Fri, 4 Oct 2024 11:15:37 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 76 commits: > > - Merge remote-tracking branch 'rkennke/JDK-8305895-v4' into JDK-8305895-v4 > - Revert "Disable TestSplitPacks::test4a, failing on aarch64" > > This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. > - Simplify object init code in interpreter > - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 > - Fix for CDSPluginTest.java > - Merge tag 'jdk-24+18' into JDK-8305895-v4 > > Added tag jdk-24+18 for changeset 19642bd3 > - Disable TestSplitPacks::test4a, failing on aarch64 > - @robcasloz review comments > - Improve CollectedHeap::is_oop() > - Allow LM_MONITOR on 32-bit platforms > - ... and 66 more: https://git.openjdk.org/jdk/compare/19642bd3...8742f3c1 I realize that some of my comments was stuck as drafts and had not been published. I took an extra pass over the gc/ and most of oops/ with the intention to approve those parts. However, I see that the comment about `fill_dense_prefix_end` and `MinObjectAlignment` has not been addressed. I don't know if that change is correct, so it would be good to get that scrutinized. src/hotspot/share/gc/shared/collectedHeap.cpp line 223: > 221: } > 222: > 223: bool klass_is_sane(oop object) { Should at least be static. We might also want to keep reporting errors if a klass pointer is null when we don't have a forwarded object: static bool klass_is_sane(oop object) { if (UseCompactObjectHeaders) { // With compact headers, we can't safely access the Klass* when // the object has been forwarded, because non-full-GC-forwarding // distinction between Full-GC and regular GC forwarding. markWord mark = object->mark(); if (mark.is_forwarded()) { // We can't access the Klass*. We optimistically assume that // it is ok. This happens very rarely. return true; } return Metaspace::contains(mark.klass_without_asserts()); } return Metaspace::contains(object->klass_without_asserts()); } src/hotspot/share/oops/compressedKlass.cpp line 28: > 26: #include "logging/log.hpp" > 27: #include "memory/metaspace.hpp" > 28: #include "oops/klass.hpp" Is this include really needed or could this be reverted klass.hpp? If it is needed is should be moved to after compressedKlass.inline.hpp. src/hotspot/share/oops/compressedKlass.cpp line 31: > 29: #include "oops/compressedKlass.inline.hpp" > 30: #include "runtime/globals.hpp" > 31: #include "runtime/java.hpp" Do you remember why this was added? src/hotspot/share/oops/markWord.cpp line 35: > 33: STATIC_ASSERT(markWord::klass_shift + markWord::klass_bits == 64); > 34: // The hash (preceding nKlass) shall be a direct neighbor but not interleave > 35: STATIC_ASSERT(markWord::klass_shift == markWord::hash_bits + markWord::hash_shift); The code is not consistent in it usage of the name for the klass bits. Here it says `nKlass` in the comment, but the fields are named `klass`. Maybe just change the comment to says `(preceding klass bits)`. Note that the term `nklass` is not prevalent in the code base, but with this patch its starting to get a foot hold. It might be good to figure out what we do want to call these in field names and variables to at least a little bit more consistency in the code base. Currently we have `nklass`, `nKlass` `nk`, `narrow_klass`. In other places we have functions that are named `set_narrow_klass`, but the field is called `nklass` and other places call it `nk`. It would be good to stay consistent with the naming. FWIW, nklass has very little precedence in the code, so cleaning that away might be easiest.thing is to clean out all usages of nklass, because it isn't a src/hotspot/share/oops/markWord.inline.hpp line 35: > 33: assert(UseCompactObjectHeaders, "only used with compact object headers"); > 34: const narrowKlass nk = value() >> klass_shift; > 35: return narrowKlass(value() >> klass_shift); This sets up an unused variable. ```suggestion const narrowKlass nk = value() >> klass_shift; return narrowKlass(value() >> klass_shift); ------------- PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2331450326 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1777180846 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789757910 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789759027 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789787634 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789790323 From stefank at openjdk.org Mon Oct 7 08:55:59 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 7 Oct 2024 08:55:59 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Thu, 19 Sep 2024 05:36:41 GMT, Stefan Karlsson wrote: >> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 787: >> >>> 785: // The gap is always equal to min-fill-size, so nothing to do. >>> 786: return; >>> 787: } >> >> Reading the comment, it is not obvious that this is correct if you set MinObjectAlignment to something larger than the default value: >> >> void PSParallelCompact::fill_dense_prefix_end(SpaceId id) { >> // Comparing two sizes to decide if filling is required: >> // >> // The size of the filler (min-obj-size) is 2 heap words with the default >> // MinObjAlignment, since both markword and klass take 1 heap word. >> // >> // The size of the gap (if any) right before dense-prefix-end is >> // MinObjAlignment. >> // >> // Need to fill in the gap only if it's smaller than min-obj-size, and the >> // filler obj will extend to next region. >> >> // Note: If min-fill-size decreases to 1, this whole method becomes redundant. >> if (UseCompactObjectHeaders) { >> // The gap is always equal to min-fill-size, so nothing to do. >> return; >> } >> assert(CollectedHeap::min_fill_size() >= 2, "inv"); > > Style note: The added code is inserted between a comment and the code that the comment refers to. It would be nice to tidy this up. Did you figure out if the code above is correct w.r.t. `MinObjectAlignment=16`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789797050 From stefank at openjdk.org Mon Oct 7 08:55:59 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 7 Oct 2024 08:55:59 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v9] In-Reply-To: References: <6Rant6SjxpFIHHWNthWc_plOdnGpWPvqj3rxRe144po=.bcdbad7a-e93a-41a3-b958-6ae602c7e083@github.com> <2w9H6VAbxm7BgSGRwKAxbI56bG-k4bE_ZDviGrBF36o=.3d4cb47f-0f84-479a-a809-6d0186dfad2d@github.com> Message-ID: On Fri, 27 Sep 2024 16:31:55 GMT, Yudi Zheng wrote: >> This is my current work-in-progress code: >> https://github.com/stefank/jdk/compare/pull/20677...stefank:jdk:lilliput_remove_prototype_header_wip_2 >> >> I've made some large rewrites and I'm currently running it through functional testing. > > If @stefank 's patch does not go in this PR, could you please export `Klass::_prototype_header` to JVMCI? Thanks! > > diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp > index 9d1b8a1cb9f..e462025074f 100644 > --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp > +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp > @@ -278,6 +278,7 @@ > nonstatic_field(Klass, _bitmap, uintx) \ > nonstatic_field(Klass, _hash_slot, uint8_t) \ > nonstatic_field(Klass, _misc_flags._flags, u1) \ > + nonstatic_field(Klass, _prototype_header, markWord) \ > \ > nonstatic_field(LocalVariableTableElement, start_bci, u2) \ > nonstatic_field(LocalVariableTableElement, length, u2) \ My patch will not be included in this PR. After JEP 450 has been delivered we'll reconsider if we want that patch or not. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1778950736 From duke at openjdk.org Mon Oct 7 09:10:52 2024 From: duke at openjdk.org (=?UTF-8?B?QW50w7Nu?= Seoane) Date: Mon, 7 Oct 2024 09:10:52 GMT Subject: RFR: 8340363: Tag-specific default decorators for UnifiedLogging [v4] In-Reply-To: References: <4VEAQafvKlq5O7kpfHcfI9RBfV83zcIwTFe1RyUiKMs=.2af26609-4594-4f98-841c-ca7a56d23271@github.com> Message-ID: <-VhlbMrk05I4TJjr4U_ejcmX02d8ywyaUyQlv8diCHE=.ccd4b85a-3cd4-4f04-95a0-ae9dd59a8c0f@github.com> On Tue, 24 Sep 2024 16:43:57 GMT, Ant?n Seoane wrote: >> Hi all, >> >> Currently, the Unified Logging framework defaults to three decorators (uptime, level, tags) whenever the user does not specify otherwise through `-Xlog`. This can result in cumbersome input whenever a specific user that relies on a particular tag(s) has some predefined needs. For example, C2 developers rarely need decorations, and having to manually specify this every time results inconvenient. >> >> To address this, this PR enables the possibility of adding tag-specific default decorators to UL. These defaults are in no way overriding user input -- they will only act whenever `-Xlog` has no decorators supplied and there is a positive match with the pre-specified defaults. Such a match is based on the following: >> >> - Inclusion: if `-Xlog:jit+compilation` is provided, a default for `jit` may be applied. >> - Specificity: if, for the above line, there is a more specific default for `jit+compilation` the latter shall be applied. Upon equal specificity cases, both defaults will be applied. >> - Additionally, defaults may target a specific log level. >> >> Decorators are also associated with an output file, so an output device may only have one set of decorators. For this reason, if different `LogSelection`s trigger defaults, none is to be applied. >> >> In summary, these defaults may be seen as a "tailored" or "flavoured" version of the existing "uptime-level-tags" current defaults. >> >> Please consider this PR, and thanks! > > Ant?n Seoane has updated the pull request incrementally with one additional commit since the last revision: > > Removed whitespace After some review and discussion, I am closing this PR and opening a new (simplified) version of this that aligns with the needed use cases in [8341622: Tag-specific disabled default decorators for UnifiedLogging](https://github.com/openjdk/jdk/pull/21383). ------------- PR Comment: https://git.openjdk.org/jdk/pull/20988#issuecomment-2396352901 From duke at openjdk.org Mon Oct 7 09:10:52 2024 From: duke at openjdk.org (=?UTF-8?B?QW50w7Nu?= Seoane) Date: Mon, 7 Oct 2024 09:10:52 GMT Subject: Withdrawn: 8340363: Tag-specific default decorators for UnifiedLogging In-Reply-To: <4VEAQafvKlq5O7kpfHcfI9RBfV83zcIwTFe1RyUiKMs=.2af26609-4594-4f98-841c-ca7a56d23271@github.com> References: <4VEAQafvKlq5O7kpfHcfI9RBfV83zcIwTFe1RyUiKMs=.2af26609-4594-4f98-841c-ca7a56d23271@github.com> Message-ID: <6FI0_lFOFEAktdR8fDEyglCSi_mL_zZv8QJdDvTJ5L8=.e0a68b15-9677-48df-8b0a-f263b2357bc5@github.com> On Fri, 13 Sep 2024 09:03:55 GMT, Ant?n Seoane wrote: > Hi all, > > Currently, the Unified Logging framework defaults to three decorators (uptime, level, tags) whenever the user does not specify otherwise through `-Xlog`. This can result in cumbersome input whenever a specific user that relies on a particular tag(s) has some predefined needs. For example, C2 developers rarely need decorations, and having to manually specify this every time results inconvenient. > > To address this, this PR enables the possibility of adding tag-specific default decorators to UL. These defaults are in no way overriding user input -- they will only act whenever `-Xlog` has no decorators supplied and there is a positive match with the pre-specified defaults. Such a match is based on the following: > > - Inclusion: if `-Xlog:jit+compilation` is provided, a default for `jit` may be applied. > - Specificity: if, for the above line, there is a more specific default for `jit+compilation` the latter shall be applied. Upon equal specificity cases, both defaults will be applied. > - Additionally, defaults may target a specific log level. > > Decorators are also associated with an output file, so an output device may only have one set of decorators. For this reason, if different `LogSelection`s trigger defaults, none is to be applied. > > In summary, these defaults may be seen as a "tailored" or "flavoured" version of the existing "uptime-level-tags" current defaults. > > Please consider this PR, and thanks! This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20988 From rkennke at openjdk.org Mon Oct 7 10:52:53 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 10:52:53 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Mon, 7 Oct 2024 08:49:58 GMT, Stefan Karlsson wrote: >> Style note: The added code is inserted between a comment and the code that the comment refers to. It would be nice to tidy this up. > > Did you figure out if the code above is correct w.r.t. `MinObjectAlignment=16`? When MinObjectAlignment=16, then that method does nothing anyway: if (MinObjAlignment > 1) { return; } I think what it really means to say is if (MinObjAlignment >= CollectedHeap::min_fill_size()) { return; } That's also what the comment says: "The size of the gap (if any) right before dense-prefix-end is MinObjAlignment. Need to fill in the gap only if it's smaller than min-obj-size, and the filler obj will extend to next region." If I interpret that correctly, we need to deal with the situation only when MinObjAlignment < min_fill_size, because the filler object would extend to the next region, and we need to adjust the next region and mark-bitmap for that extra word. @albertnetymk might want to confirm. I'll move the if (UCOH) block down a little bit to right before if (MinObjAlignment) block. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789983561 From rkennke at openjdk.org Mon Oct 7 11:03:55 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 11:03:55 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 08:25:55 GMT, Stefan Karlsson wrote: >> Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 76 commits: >> >> - Merge remote-tracking branch 'rkennke/JDK-8305895-v4' into JDK-8305895-v4 >> - Revert "Disable TestSplitPacks::test4a, failing on aarch64" >> >> This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. >> - Simplify object init code in interpreter >> - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 >> - Fix for CDSPluginTest.java >> - Merge tag 'jdk-24+18' into JDK-8305895-v4 >> >> Added tag jdk-24+18 for changeset 19642bd3 >> - Disable TestSplitPacks::test4a, failing on aarch64 >> - @robcasloz review comments >> - Improve CollectedHeap::is_oop() >> - Allow LM_MONITOR on 32-bit platforms >> - ... and 66 more: https://git.openjdk.org/jdk/compare/19642bd3...8742f3c1 > > src/hotspot/share/oops/compressedKlass.cpp line 28: > >> 26: #include "logging/log.hpp" >> 27: #include "memory/metaspace.hpp" >> 28: #include "oops/klass.hpp" > > Is this include really needed or could this be reverted klass.hpp? If it is needed is should be moved to after compressedKlass.inline.hpp. I don't think it's needed. I'll remove it. > src/hotspot/share/oops/compressedKlass.cpp line 31: > >> 29: #include "oops/compressedKlass.inline.hpp" >> 30: #include "runtime/globals.hpp" >> 31: #include "runtime/java.hpp" > > Do you remember why this was added? Looks like this is for vm_exit_during_initialization(). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789996985 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1789999402 From stefank at openjdk.org Mon Oct 7 11:43:00 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 7 Oct 2024 11:43:00 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 11:00:54 GMT, Roman Kennke wrote: >> src/hotspot/share/oops/compressedKlass.cpp line 31: >> >>> 29: #include "oops/compressedKlass.inline.hpp" >>> 30: #include "runtime/globals.hpp" >>> 31: #include "runtime/java.hpp" >> >> Do you remember why this was added? > > Looks like this is for vm_exit_during_initialization(). I see. Thanks. (What a funny header file that is) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1790060417 From stefank at openjdk.org Mon Oct 7 11:51:54 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 7 Oct 2024 11:51:54 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Mon, 7 Oct 2024 10:49:39 GMT, Roman Kennke wrote: >> Did you figure out if the code above is correct w.r.t. `MinObjectAlignment=16`? > > When MinObjectAlignment=16, then that method does nothing anyway: > > > if (MinObjAlignment > 1) { > return; > } > > > > I think what it really means to say is > > if (MinObjAlignment >= CollectedHeap::min_fill_size()) { > return; > } > > > > That's also what the comment says: "The size of the gap (if any) right before dense-prefix-end is MinObjAlignment. Need to fill in the gap only if it's smaller than min-obj-size, and the filler obj will extend to next region." > > If I interpret that correctly, we need to deal with the situation only when MinObjAlignment < min_fill_size, because the filler object would extend to the next region, and we need to adjust the next region and mark-bitmap for that extra word. @albertnetymk might want to confirm. > > I'll move the if (UCOH) block down a little bit to right before if (MinObjAlignment) block. After re-reading this again I agree with what you're writing. If you make the change to use: if (MinObjAlignment >= CollectedHeap::min_fill_size()) { return; } do you even have to check for UCOH in this function? I also wonder if you could tweak the comment now that this is not true when UCOH is on: // The size of the filler (min-obj-size) is 2 heap words with the default // MinObjAlignment, since both markword and klass take 1 heap word. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1790074043 From jbechberger at openjdk.org Mon Oct 7 11:54:04 2024 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Mon, 7 Oct 2024 11:54:04 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent Message-ID: Remove the support for on-demand debugging via the onjcmd option. ------------- Commit messages: - Remove added empty line - Fix AgentEvent test - Remove onjcmd Changes: https://git.openjdk.org/jdk/pull/21387/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21387&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8336401 Stats: 241 lines in 5 files changed: 0 ins; 239 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21387.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21387/head:pull/21387 PR: https://git.openjdk.org/jdk/pull/21387 From kevinw at openjdk.org Mon Oct 7 12:00:37 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 7 Oct 2024 12:00:37 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run In-Reply-To: References: Message-ID: <88IVcbLd9mJnbF_d2UZSSdcJPf50KTXhliVo7cUjU8M=.6596df82-eaf1-4830-b439-e72cb7e4fda2@github.com> On Thu, 3 Oct 2024 19:13:46 GMT, Sebastian L?vdahl wrote: > The fix is twofold. > > 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. > > 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. > > On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. > > Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. > > Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both > `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. > > https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. Hi, I think this looks good. Having main container name be unique is good. Do you just add "elevated-" + elevated here, it would be great to add even a random ID in there as well, as we can have multiple tests running on the same machine at times... The other problem ( https://bugs.openjdk.org/browse/JDK-8341518 ) seems to be EventGeneratorLoop terminating too early, we have some logs where it's gone after 10 or 12 seconds, not 120. It should maybe check a wall-clock time to ensure it lives long enough. I can do that separately unless you think it makes sense to include it here, I don't think it will conflict. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2396725847 From rkennke at openjdk.org Mon Oct 7 12:48:43 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 12:48:43 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v31] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: @stefank review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/8742f3c1..572f1ac0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=30 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=29-30 Stats: 20 lines in 6 files changed: 4 ins; 8 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Mon Oct 7 13:24:26 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 13:24:26 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v32] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Remove unused variable ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/572f1ac0..60401086 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=31 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=30-31 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Mon Oct 7 13:32:41 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 13:32:41 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v2] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 4 Oct 2024 18:21:34 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper 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 475 additional commits since the last revision: > > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - Merge > - 8339643: Port JEP 404 to RISC-V > > Reviewed-by: wkemper, kdnilsen > - 8340395: GenShen: Remove unnecessary check on card barrier flag > > Reviewed-by: ysr > - ... and 465 more: https://git.openjdk.org/jdk/compare/e155dc3e...ed16e3ec There seems to be something missing: /home/runner/work/jdk/jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp: In member function ?oop ShenandoahHeap::try_evacuate_object(oop, Thread*, ShenandoahHeapRegion*, ShenandoahAffiliation)?: /home/runner/work/jdk/jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp:1276:3: error: ?_evac_tracker? was not declared in this scope; did you mean ?_mmu_tracker?? 1276 | _evac_tracker->begin_evacuation(thread, size * HeapWordSize); | ^~~~~~~~~~~~~ | _mmu_tracker /home/runner/work/jdk/jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp: In member function ?virtual void ShenandoahHeap::print_tracing_info() const?: /home/runner/work/jdk/jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp:1534:5: error: ?evac_tracker? was not declared in this scope; did you mean ?mmu_tracker?? 1534 | evac_tracker()->print_global_on(&ls); | ^~~~~~~~~~~~ | mmu_tracker ------------- PR Comment: https://git.openjdk.org/jdk/pull/21273#issuecomment-2396941518 From rkennke at openjdk.org Mon Oct 7 13:55:17 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 13:55:17 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v33] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Rename nklass/nKlass ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/60401086..1ab20774 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=32 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=31-32 Stats: 14 lines in 6 files changed: 0 ins; 0 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Mon Oct 7 13:55:18 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 13:55:18 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v30] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 08:44:16 GMT, Stefan Karlsson wrote: >> Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 76 commits: >> >> - Merge remote-tracking branch 'rkennke/JDK-8305895-v4' into JDK-8305895-v4 >> - Revert "Disable TestSplitPacks::test4a, failing on aarch64" >> >> This reverts commit 059b1573db26d1d2902ca6dadc8413f445234c2a. >> - Simplify object init code in interpreter >> - Disable some vectorization tests that fail with +UCOH and UseSSE<=3 >> - Fix for CDSPluginTest.java >> - Merge tag 'jdk-24+18' into JDK-8305895-v4 >> >> Added tag jdk-24+18 for changeset 19642bd3 >> - Disable TestSplitPacks::test4a, failing on aarch64 >> - @robcasloz review comments >> - Improve CollectedHeap::is_oop() >> - Allow LM_MONITOR on 32-bit platforms >> - ... and 66 more: https://git.openjdk.org/jdk/compare/19642bd3...8742f3c1 > > src/hotspot/share/oops/markWord.cpp line 35: > >> 33: STATIC_ASSERT(markWord::klass_shift + markWord::klass_bits == 64); >> 34: // The hash (preceding nKlass) shall be a direct neighbor but not interleave >> 35: STATIC_ASSERT(markWord::klass_shift == markWord::hash_bits + markWord::hash_shift); > > The code is not consistent in it usage of the name for the klass bits. Here it says `nKlass` in the comment, but the fields are named `klass`. Maybe just change the comment to says `(preceding klass bits)`. > > Note that the term `nklass` is not prevalent in the code base, but with this patch its starting to get a foot hold. It might be good to figure out what we do want to call these in field names and variables to at least a little bit more consistency in the code base. Currently we have `nklass`, `nKlass` `nk`, `narrow_klass`. > > In other places we have functions that are named `set_narrow_klass`, but the field is called `nklass` and other places call it `nk`. It would be good to stay consistent with the naming. FWIW, nklass has very little precedence in the code, so cleaning that away might be easiest.thing is to clean out all usages of nklass, because it isn't a I renamed all occurrences of nklass and nKlass in shared code to something more useful. I left load_nklass* stuff in aarch64 and x86 code alone for now. Let me know if that addresses your concern. https://github.com/openjdk/jdk/pull/20677/commits/1ab207746e4c4baaa6da162d7c1535c75342fa2e ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1790270819 From rkennke at openjdk.org Mon Oct 7 14:28:40 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 7 Oct 2024 14:28:40 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v34] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Some more review comments/cleanups ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/1ab20774..17f8eb54 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=33 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=32-33 Stats: 8 lines in 5 files changed: 3 ins; 3 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From cjplummer at openjdk.org Mon Oct 7 16:20:36 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Mon, 7 Oct 2024 16:20:36 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent In-Reply-To: References: Message-ID: <4vmUQq_JI__RMxhSejCEjtYHtCWgNgALCygYx0fwXyM=.5e8bca4d-1ef6-4016-abd6-ef0e4dd38adc@github.com> On Mon, 7 Oct 2024 11:47:12 GMT, Johannes Bechberger wrote: > Remove the support for on-demand debugging via the onjcmd option. test/jdk/jdk/jfr/event/runtime/TestAgentEvent.java line 68: > 66: * testJavaDynamic > 67: * > 68: * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 This use of port 5005 could possibly conflict with other tests running in parallel that were already dynamically assigned this port. Is there a reason it can't remain "any"? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21387#discussion_r1790525765 From rsunderbabu at openjdk.org Mon Oct 7 16:40:14 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Mon, 7 Oct 2024 16:40:14 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging Message-ID: JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. Testing: tier1,tier2,tier3 tier6-comp,tier8-comp ------------- Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/21392/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21392&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341588 Stats: 7 lines in 3 files changed: 3 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21392.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21392/head:pull/21392 PR: https://git.openjdk.org/jdk/pull/21392 From kevinw at openjdk.org Mon Oct 7 16:57:35 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 7 Oct 2024 16:57:35 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 15:28:19 GMT, Ramkumar Sunderbabu wrote: > JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. > > Testing: > tier1,tier2,tier3 > tier6-comp,tier8-comp Looks good, let's try it! ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21392#pullrequestreview-2352488029 From jbechberger at openjdk.org Mon Oct 7 18:53:41 2024 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Mon, 7 Oct 2024 18:53:41 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent In-Reply-To: <4vmUQq_JI__RMxhSejCEjtYHtCWgNgALCygYx0fwXyM=.5e8bca4d-1ef6-4016-abd6-ef0e4dd38adc@github.com> References: <4vmUQq_JI__RMxhSejCEjtYHtCWgNgALCygYx0fwXyM=.5e8bca4d-1ef6-4016-abd6-ef0e4dd38adc@github.com> Message-ID: On Mon, 7 Oct 2024 16:17:59 GMT, Chris Plummer wrote: >> Remove the support for on-demand debugging via the onjcmd option. > > test/jdk/jdk/jfr/event/runtime/TestAgentEvent.java line 68: > >> 66: * testJavaDynamic >> 67: * >> 68: * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 > > This use of port 5005 could possibly conflict with other tests running in parallel that were already dynamically assigned this port. Is there a reason it can't remain "any"? Good catch, I'll try using `any` tomorrow. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21387#discussion_r1790719642 From duke at openjdk.org Mon Oct 7 19:23:58 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Mon, 7 Oct 2024 19:23:58 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v2] In-Reply-To: References: Message-ID: > The fix is twofold. > > 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. > > 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. > > On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. > > Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. > > Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both > `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. > > https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: Append random integer to container name ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21331/files - new: https://git.openjdk.org/jdk/pull/21331/files/448455c2..b7e0480c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21331&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21331&range=00-01 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21331.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21331/head:pull/21331 PR: https://git.openjdk.org/jdk/pull/21331 From duke at openjdk.org Mon Oct 7 19:23:58 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Mon, 7 Oct 2024 19:23:58 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run In-Reply-To: <88IVcbLd9mJnbF_d2UZSSdcJPf50KTXhliVo7cUjU8M=.6596df82-eaf1-4830-b439-e72cb7e4fda2@github.com> References: <88IVcbLd9mJnbF_d2UZSSdcJPf50KTXhliVo7cUjU8M=.6596df82-eaf1-4830-b439-e72cb7e4fda2@github.com> Message-ID: On Mon, 7 Oct 2024 11:57:39 GMT, Kevin Walls wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Hi, I think this looks good. > Having main container name be unique is good. Do you just add "elevated-" + elevated here, it would be great to add even a random ID in there as well, as we can have multiple tests running on the same machine at times... > > The other problem ( https://bugs.openjdk.org/browse/JDK-8341518 ) seems to be EventGeneratorLoop terminating too early, we have some logs where it's gone after 10 or 12 seconds, not 120. It should maybe check a wall-clock time to ensure it lives long enough. I can do that separately unless you think it makes sense to include it here, I don't think it will conflict. Thanks for taking a look, @kevinjwalls! > Having main container name be unique is good. Do you just add "elevated-" + elevated here, it would be great to add even a random ID in there as well, as we can have multiple tests running on the same machine at times... Sounds good. The thought did cross my mind, but I decided to skip it anyway. Adding it in b7e0480c421c77cf240e2ce2c24a810dd65908f6. > The other problem ( https://bugs.openjdk.org/browse/JDK-8341518 ) seems to be EventGeneratorLoop terminating too early, we have some logs where it's gone after 10 or 12 seconds, not 120. It should maybe check a wall-clock time to ensure it lives long enough. I can do that separately unless you think it makes sense to include it here, I don't think it will conflict. Interesting! What could possibly interrupt `EventGeneratorLoop`? I don't mind adding it here, I'll take a look. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2397704133 From duke at openjdk.org Mon Oct 7 19:37:51 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Mon, 7 Oct 2024 19:37:51 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: > The fix is twofold. > > 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. > > 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. > > On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. > > Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. > > Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both > `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. > > https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: Have EventGeneratorLoop end after a more predictable duration ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21331/files - new: https://git.openjdk.org/jdk/pull/21331/files/b7e0480c..cdf92697 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21331&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21331&range=01-02 Stats: 10 lines in 1 file changed: 7 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21331.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21331/head:pull/21331 PR: https://git.openjdk.org/jdk/pull/21331 From kevinw at openjdk.org Mon Oct 7 19:42:35 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 7 Oct 2024 19:42:35 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run In-Reply-To: References: <88IVcbLd9mJnbF_d2UZSSdcJPf50KTXhliVo7cUjU8M=.6596df82-eaf1-4830-b439-e72cb7e4fda2@github.com> Message-ID: On Mon, 7 Oct 2024 19:20:38 GMT, Sebastian L?vdahl wrote: > Interesting! What could possibly interrupt `EventGeneratorLoop`? It's a good question, but I don't know exactly... We do see interrupted exceptions in testing sometimes, and we might have various tests running on the same system at the same time. The tests which attach or otherwise poke around and look at other processes can be part of the problem, but I don't have a particular test in mind. So I'm thinking we can be defensive... ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2397739522 From duke at openjdk.org Mon Oct 7 19:42:37 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Mon, 7 Oct 2024 19:42:37 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration test/hotspot/jtreg/containers/docker/EventGeneratorLoop.java line 58: > 56: ev.msg = "Hello"; > 57: ev.count = count++; > 58: ev.commit(); @kevinjwalls what do you think? I chose `System.nanoTime()` instead of `System.currentTimeMillis()` to get an even more predictable duration. Before this change, `EventGeneratorLoop` was guaranteed to post the same number of events as the input argument. It no longer is, but AFAICT no current test uses the events it posts either. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21331#discussion_r1790777201 From kevinw at openjdk.org Mon Oct 7 19:46:37 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 7 Oct 2024 19:46:37 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration Thanks yes that looks good to me. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21331#pullrequestreview-2352796003 From duke at openjdk.org Mon Oct 7 19:49:36 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Mon, 7 Oct 2024 19:49:36 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration Thanks for the quick check! Let's hope this solves JDK-8341518 too. Should I add JDK-8341518 to this PR so it gets closed as well? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2397753746 From kevinw at openjdk.org Mon Oct 7 19:53:37 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 7 Oct 2024 19:53:37 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration Don't worry I'll close 8341518 as a duplicate. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2397760581 From duke at openjdk.org Mon Oct 7 19:56:35 2024 From: duke at openjdk.org (duke) Date: Mon, 7 Oct 2024 19:56:35 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration @slovdahl Your change (at version cdf92697b4e9bf6c47138db38e9c2cd22ddf558f) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2397766398 From sspitsyn at openjdk.org Mon Oct 7 22:32:55 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Mon, 7 Oct 2024 22:32:55 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 22:03:36 GMT, Serguei Spitsyn wrote: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed The frames which are in VTMS transition should not be visible to the JVMTI agents including debug agent because the thread identity can be incorrect. The JVMTI events are not posted when `java_thread->is_in_VTMS_transition() == true`. All the JVMTI functions returning stack related info do skip frames that are in transition. The hiding mechanism is using the annotation `@JvmtiMountTransition` to mark the `notifyJvmti*` methods and the bit `java_thread->is_in_VTMS_transition()`. It occurred that the methods `yield()` and `yield0()` can be present in stack trace of an unmounted virtual threads. The bit `java_thread->is_in_VTMS_transition() ` is not set in such a case. The fix is to add the annotation `@JvmtiMountTransition` to the methods `yield()` and `yield0()` and correct the frames skipping mechanism to account for such frames as well. The update also includes: - fix in one of the `JvmtiHandshake::execute()` functions which is needed for better stability and safety - tweak in the test which expects frames with `yield()` and `yield0()` methods to be present at the top ------------- PR Comment: https://git.openjdk.org/jdk/pull/21397#issuecomment-2398025342 From sspitsyn at openjdk.org Mon Oct 7 22:32:55 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Mon, 7 Oct 2024 22:32:55 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods Message-ID: This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. Please, see a fix description in the first comment. Testing: - Verified with new test `vthread/CheckHiddenFrames` - Mach5 tiers 1-6 are passed ------------- Commit messages: - fix one more place with trailing spaces - fix trailing spaces - add new test coverage with vthread/CheckHiddenFrames - 8341273: JVMTI is not properly hiding some continuation related methods Changes: https://git.openjdk.org/jdk/pull/21397/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341273 Stats: 233 lines in 7 files changed: 210 ins; 7 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sviswanathan at openjdk.org Mon Oct 7 22:43:15 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Mon, 7 Oct 2024 22:43:15 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> Message-ID: On Fri, 4 Oct 2024 10:41:46 GMT, Roman Kennke wrote: >> @rkennke The small loop looks to me that it will run over the end of the array. >> Say the haystack_len is 7, the index below would be 0 after the shrq instruction, and the movq(XMM_TMP1, Address(haystack, index, Address::times_8)) in the loop will read 8 bytes i.e. one byte past the end of the array: >> // num_words (zero-based) = (haystack_len - 1) / 8; >> __ movq(index, haystack_len); >> __ subq(index, 1); >> __ shrq(index, LogBytesPerWord); >> >> __ bind(L_loop); >> __ movq(XMM_TMP1, Address(haystack, index, Address::times_8)); >> __ movq(Address(rsp, index, Address::times_8), XMM_TMP1); >> __ subq(index, 1); >> __ jcc(Assembler::positive, L_loop); > > Yes, and that is intentional. > > Say, haystack_len is 7, then the first block computes the adjustment of the haystack, which is 8 - (7 % 8) = 1. We adjust the haystack pointer one byte down, so that when we copy (multiple of) 8 bytes, we land on the last byte. We do copy a few bytes that are preceding the array, which is part of the object header and guaranteed to be >= 8 bytes. > > Then we compute the number of words to copy, but make it 0-based. That is '0' is 1 word, '1' is 2 words, etc. It makes the loop nicer. In this example we get 0, which means we copy one word from the adjusted haystack, which is correct. > > Then comes the actual loop. > > Afterwards we adjust the haystack pointer so that it points to the first array element that we just copied onto the stack, ignoring the few garbage bytes that we also copied. @rkennke Thanks for the explanation. I attach here a fix which is an extension of existing way of copying while taking care of the smaller object header. Also there are two instances of this in the intrinsic so I have factored the new code into a method and call it from both the places. [indexof_fix.patch](https://github.com/user-attachments/files/17285239/indexof_fix.patch) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1790967275 From lmesnik at openjdk.org Tue Oct 8 00:13:58 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 8 Oct 2024 00:13:58 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods In-Reply-To: References: Message-ID: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> On Mon, 7 Oct 2024 22:03:36 GMT, Serguei Spitsyn wrote: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Changes requested by lmesnik (Reviewer). src/hotspot/share/prims/jvmtiEnvBase.cpp line 691: > 689: > 690: if (is_virtual || jt->is_in_VTMS_transition()) { // filter out pure continuations > 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); Wouldn't be easier to split method `check_and_skip_hidden_frames` to skip_yeilds and skip_transition frames? BTW Also it is unclear shouldn't the `@Hidden` methods be skipped from all jvmti frame streams? src/hotspot/share/prims/jvmtiEnvBase.cpp line 2009: > 2007: bool is_virtual = java_lang_VirtualThread::is_instance(thread_oop); > 2008: > 2009: // Target can be virtual or platform thread. Can you please explain in comment why is it needed to disable all threads for platform target thread. test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 25: > 23: > 24: /* > 25: * @test id=virtual Having 'id=virtual' not needed and might confuse people. They expect to have other test variations for platform. test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 32: > 30: > 31: public class CheckHiddenFrames { > 32: private static final String AGENT_LIB = "CheckHiddenFrames"; It is not used? test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 43: > 41: > 42: public static void main(String[] args) throws Exception { > 43: Thread thread = Thread.ofVirtual().unstarted(CheckHiddenFrames::test); You can use startVirtualThread to save one line. ------------- PR Review: https://git.openjdk.org/jdk/pull/21397#pullrequestreview-2353060666 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1791023030 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1791008060 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1790967726 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1790968113 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1790966876 From rsunderbabu at openjdk.org Tue Oct 8 01:16:46 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 8 Oct 2024 01:16:46 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v2] In-Reply-To: References: Message-ID: <1TOhcDrLuyZyDYYqR1h5Prhr-vKvkfcYaAe7_O9oLEg=.3eb3ef39-339d-4154-a5c2-2072d5a092e9@github.com> > JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. > > Testing: > tier1,tier2,tier3 > tier6-comp,tier8-comp Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: resolving merge conflict ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21392/files - new: https://git.openjdk.org/jdk/pull/21392/files/897ba0f7..04546b5d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21392&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21392&range=00-01 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21392.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21392/head:pull/21392 PR: https://git.openjdk.org/jdk/pull/21392 From lmesnik at openjdk.org Tue Oct 8 02:06:57 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 8 Oct 2024 02:06:57 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v2] In-Reply-To: <1TOhcDrLuyZyDYYqR1h5Prhr-vKvkfcYaAe7_O9oLEg=.3eb3ef39-339d-4154-a5c2-2072d5a092e9@github.com> References: <1TOhcDrLuyZyDYYqR1h5Prhr-vKvkfcYaAe7_O9oLEg=.3eb3ef39-339d-4154-a5c2-2072d5a092e9@github.com> Message-ID: On Tue, 8 Oct 2024 01:16:46 GMT, Ramkumar Sunderbabu wrote: >> JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. >> >> Testing: >> tier1,tier2,tier3 >> tier6-comp,tier8-comp > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > resolving merge conflict Changes requested by lmesnik (Reviewer). test/jdk/ProblemList-Xcomp.txt line 31: > 29: > 30: java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all > 31: java/foreign/TestUpcallStress.java 8341584 generic-all This looks odd, this line shouldn't be added with your PR. It makes history of commits wrong. Please check if it was correctly merged. ------------- PR Review: https://git.openjdk.org/jdk/pull/21392#pullrequestreview-2353223223 PR Review Comment: https://git.openjdk.org/jdk/pull/21392#discussion_r1791080538 From rsunderbabu at openjdk.org Tue Oct 8 02:31:08 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 8 Oct 2024 02:31:08 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v2] In-Reply-To: References: <1TOhcDrLuyZyDYYqR1h5Prhr-vKvkfcYaAe7_O9oLEg=.3eb3ef39-339d-4154-a5c2-2072d5a092e9@github.com> Message-ID: On Tue, 8 Oct 2024 02:03:52 GMT, Leonid Mesnik wrote: >> Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: >> >> resolving merge conflict > > test/jdk/ProblemList-Xcomp.txt line 31: > >> 29: >> 30: java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all >> 31: java/foreign/TestUpcallStress.java 8341584 generic-all > > This looks odd, this line shouldn't be added with your PR. It makes history of commits wrong. Please check if it was correctly merged. Yeah, I messed up while resolving conflicts. I am checking how to correct this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21392#discussion_r1791094005 From rsunderbabu at openjdk.org Tue Oct 8 04:17:31 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 8 Oct 2024 04:17:31 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v3] In-Reply-To: References: Message-ID: > JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. > > Testing: > tier1,tier2,tier3 > tier6-comp,tier8-comp Ramkumar Sunderbabu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: commit after resolving conflicts ------------- Changes: https://git.openjdk.org/jdk/pull/21392/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21392&range=02 Stats: 7 lines in 3 files changed: 3 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21392.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21392/head:pull/21392 PR: https://git.openjdk.org/jdk/pull/21392 From lmesnik at openjdk.org Tue Oct 8 04:32:57 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 8 Oct 2024 04:32:57 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v3] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 04:17:31 GMT, Ramkumar Sunderbabu wrote: >> JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. >> >> Testing: >> tier1,tier2,tier3 >> tier6-comp,tier8-comp > > Ramkumar Sunderbabu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > commit after resolving conflicts Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21392#pullrequestreview-2353346908 From jbechberger at openjdk.org Tue Oct 8 06:58:13 2024 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Tue, 8 Oct 2024 06:58:13 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent [v2] In-Reply-To: References: Message-ID: > Remove the support for on-demand debugging via the onjcmd option. Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: Use port 0 in TestAgentEvent ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21387/files - new: https://git.openjdk.org/jdk/pull/21387/files/f76f8db0..17b7b5a5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21387&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21387&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21387.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21387/head:pull/21387 PR: https://git.openjdk.org/jdk/pull/21387 From jbechberger at openjdk.org Tue Oct 8 06:58:13 2024 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Tue, 8 Oct 2024 06:58:13 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent [v2] In-Reply-To: <4vmUQq_JI__RMxhSejCEjtYHtCWgNgALCygYx0fwXyM=.5e8bca4d-1ef6-4016-abd6-ef0e4dd38adc@github.com> References: <4vmUQq_JI__RMxhSejCEjtYHtCWgNgALCygYx0fwXyM=.5e8bca4d-1ef6-4016-abd6-ef0e4dd38adc@github.com> Message-ID: On Mon, 7 Oct 2024 16:17:59 GMT, Chris Plummer wrote: >> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: >> >> Use port 0 in TestAgentEvent > > test/jdk/jdk/jfr/event/runtime/TestAgentEvent.java line 68: > >> 66: * testJavaDynamic >> 67: * >> 68: * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005 > > This use of port 5005 could possibly conflict with other tests running in parallel that were already dynamically assigned this port. Is there a reason it can't remain "any"? Using `any` leads to the following error: ERROR: transport error 103: invalid port number specified ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:700] This doesn't happen with onjcmd because it delays parsing the port till the debugging is enabled. Using `0` as @schmelter-sap suggested, should prevent any issues. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21387#discussion_r1791299808 From rkennke at openjdk.org Tue Oct 8 07:08:52 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 07:08:52 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v35] In-Reply-To: References: Message-ID: <0ahBmcWCHqMMxr9RxUlOPgEJy4WSs7lQgRnxtEonZaY=.28275c5d-2d5f-490c-bf39-b0bb6817d6be@github.com> > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: - Rename nklass in x86 code - Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/17f8eb54..4d7228e0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=34 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=33-34 Stats: 148 lines in 6 files changed: 84 ins; 47 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Tue Oct 8 07:21:09 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 07:21:09 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v36] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with three additional commits since the last revision: - Re-enable indexOf intrinsic for compact headers - Rename nklass in aarch64 - Fix comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/4d7228e0..0be2fc40 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=35 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=34-35 Stats: 15 lines in 8 files changed: 0 ins; 1 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Tue Oct 8 07:21:09 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 07:21:09 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> Message-ID: <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> On Mon, 7 Oct 2024 22:40:37 GMT, Sandhya Viswanathan wrote: >> Yes, and that is intentional. >> >> Say, haystack_len is 7, then the first block computes the adjustment of the haystack, which is 8 - (7 % 8) = 1. We adjust the haystack pointer one byte down, so that when we copy (multiple of) 8 bytes, we land on the last byte. We do copy a few bytes that are preceding the array, which is part of the object header and guaranteed to be >= 8 bytes. >> >> Then we compute the number of words to copy, but make it 0-based. That is '0' is 1 word, '1' is 2 words, etc. It makes the loop nicer. In this example we get 0, which means we copy one word from the adjusted haystack, which is correct. >> >> Then comes the actual loop. >> >> Afterwards we adjust the haystack pointer so that it points to the first array element that we just copied onto the stack, ignoring the few garbage bytes that we also copied. > > @rkennke Thanks for the explanation. I attach here a fix which is an extension of existing way of copying while taking care of the smaller object header. Also there are two instances of this in the intrinsic so I have factored the new code into a method and call it from both the places. > [indexof_fix.patch](https://github.com/user-attachments/files/17285239/indexof_fix.patch) Thank you, @sviswa7! Yes this fix looks correct. I've intergrated it into this PR and re-enabled the indexOf intrinsic for compact headers. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791328427 From ayang at openjdk.org Tue Oct 8 07:43:18 2024 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 8 Oct 2024 07:43:18 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Mon, 7 Oct 2024 11:49:21 GMT, Stefan Karlsson wrote: >> When MinObjectAlignment=16, then that method does nothing anyway: >> >> >> if (MinObjAlignment > 1) { >> return; >> } >> >> >> >> I think what it really means to say is >> >> if (MinObjAlignment >= CollectedHeap::min_fill_size()) { >> return; >> } >> >> >> >> That's also what the comment says: "The size of the gap (if any) right before dense-prefix-end is MinObjAlignment. Need to fill in the gap only if it's smaller than min-obj-size, and the filler obj will extend to next region." >> >> If I interpret that correctly, we need to deal with the situation only when MinObjAlignment < min_fill_size, because the filler object would extend to the next region, and we need to adjust the next region and mark-bitmap for that extra word. @albertnetymk might want to confirm. >> >> I'll move the if (UCOH) block down a little bit to right before if (MinObjAlignment) block. > > After re-reading this again I agree with what you're writing. If you make the change to use: > > if (MinObjAlignment >= CollectedHeap::min_fill_size()) { > return; > } > > > do you even have to check for UCOH in this function? > > I also wonder if you could tweak the comment now that this is not true when UCOH is on: > > // The size of the filler (min-obj-size) is 2 heap words with the default > // MinObjAlignment, since both markword and klass take 1 heap word. I took UCOH into account when this code was written -- the current version of PR would fail the following assert. // Note: If min-fill-size decreases to 1, this whole method becomes redundant. assert(CollectedHeap::min_fill_size() >= 2, "inv"); The least intrusive way, IMO, is to put `if (UCOH) { return; }` right before `// Note: ...`, kind of like what Roman originally put it. I believe the advantage of this style is that when UCOH before always-true, it's obvious this whole method essentially becomes `return`and can be removed right away. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791362310 From stefank at openjdk.org Tue Oct 8 08:15:18 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 8 Oct 2024 08:15:18 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Tue, 8 Oct 2024 07:40:24 GMT, Albert Mingkun Yang wrote: >> After re-reading this again I agree with what you're writing. If you make the change to use: >> >> if (MinObjAlignment >= CollectedHeap::min_fill_size()) { >> return; >> } >> >> >> do you even have to check for UCOH in this function? >> >> I also wonder if you could tweak the comment now that this is not true when UCOH is on: >> >> // The size of the filler (min-obj-size) is 2 heap words with the default >> // MinObjAlignment, since both markword and klass take 1 heap word. > > I took UCOH into account when this code was written -- the current version of PR would fail the following assert. > > > // Note: If min-fill-size decreases to 1, this whole method becomes redundant. > assert(CollectedHeap::min_fill_size() >= 2, "inv"); > > > The least intrusive way, IMO, is to put `if (UCOH) { return; }` right before `// Note: ...`, kind of like what Roman originally put it. I believe the advantage of this style is that when UCOH before always-true, it's obvious this whole method essentially becomes `return`and can be removed right away. I was thinking that we should remove the entire: // Note: If min-fill-size decreases to 1, this whole method becomes redundant. assert(CollectedHeap::min_fill_size() >= 2, "inv"); block, since it is now incorrect, guarded by the proper check, and the comment is misleading since we now can have a min-fill-size that is 1. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791409345 From rkennke at openjdk.org Tue Oct 8 10:03:40 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 10:03:40 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v37] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Improve PSParallelCompact::fill_dense_prefix_end() even more ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/0be2fc40..d57dbfc5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=36 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=35-36 Stats: 9 lines in 1 file changed: 2 ins; 7 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From stooke at openjdk.org Tue Oct 8 10:12:03 2024 From: stooke at openjdk.org (Simon Tooke) Date: Tue, 8 Oct 2024 10:12:03 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v13] In-Reply-To: References: Message-ID: On Mon, 23 Sep 2024 01:59:01 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> delete commented out code > > test/hotspot/gtest/runtime/test_os.cpp line 434: > >> 432: #if defined(_WINDOWS) >> 433: EXPECT_TRUE(returnedBuffer == buffer); >> 434: EXPECT_TRUE(errno == 0); > > I thought we concluded you cannot guarantee that errno==0 after a successful call? Agreed and deleted. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1791595967 From rkennke at openjdk.org Tue Oct 8 10:19:19 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 10:19:19 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v8] In-Reply-To: <6usTXIvS83aO2VzX5xu2EnXlpIJ8YbfrWS6b3EI0MhE=.0e8cc603-0cd3-4bd9-b309-55e4dd0f0cb0@github.com> References: <6usTXIvS83aO2VzX5xu2EnXlpIJ8YbfrWS6b3EI0MhE=.0e8cc603-0cd3-4bd9-b309-55e4dd0f0cb0@github.com> Message-ID: On Mon, 9 Sep 2024 11:53:13 GMT, Thomas Schatzl wrote: >> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: >> >> - Try to avoid lea in loadNklass (aarch64) >> - Fix release build error > > src/hotspot/share/oops/klass.hpp line 169: > >> 167: // contention that may happen when a nearby object is modified. >> 168: AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. >> 169: // Some flags created by the JVM, not in the class file itself, > > Suggestion: > > markWord _prototype_header; // Used to initialize objects' header with compact headers. > > > Maybe some comment why this is an instance member. @tschatzl I just found your comment here, and I'm not sure what you mean, tbh. The prototype_header is a member of Klass because with compact headers, it encodes that Klass in the prototype header. Note that there is planned follow-up work to remove that field and encode the Klass* on the allocation path. https://bugs.openjdk.org/browse/JDK-8341703 Let me know if you still want me to change anything there, or if I can 'resolve' this request. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791602989 From rkennke at openjdk.org Tue Oct 8 10:19:20 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 10:19:20 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v8] In-Reply-To: References: <6usTXIvS83aO2VzX5xu2EnXlpIJ8YbfrWS6b3EI0MhE=.0e8cc603-0cd3-4bd9-b309-55e4dd0f0cb0@github.com> Message-ID: On Tue, 10 Sep 2024 09:28:41 GMT, Roman Kennke wrote: >> With compact headers, this value should only be used in C2, and not really as an actual offset. An earlier version of the change had the value in src/hotspot/share/opto/type.hpp instead, and only an assert(!UCOH) in oopDesc::klass_offset_in_bytes(). I think this would be a better solution overall, because it prevents accidental (and wrong) usage of the klass_offset in the runtime. Back then it has been rejected by somebody (don't remember), because it made the C2 diff a little messier, so I kept it like it is now. I would prefer to reinstate it, though. > >> (Fwiw, the method is also used during Universe initialization). > > Yes, but only in the -UCOH branch. We will deal with it in a follow-up. https://bugs.openjdk.org/browse/JDK-8340453 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791605009 From ayang at openjdk.org Tue Oct 8 10:23:20 2024 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 8 Oct 2024 10:23:20 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Tue, 8 Oct 2024 08:12:31 GMT, Stefan Karlsson wrote: >> I took UCOH into account when this code was written -- the current version of PR would fail the following assert. >> >> >> // Note: If min-fill-size decreases to 1, this whole method becomes redundant. >> assert(CollectedHeap::min_fill_size() >= 2, "inv"); >> >> >> The least intrusive way, IMO, is to put `if (UCOH) { return; }` right before `// Note: ...`, kind of like what Roman originally put it. I believe the advantage of this style is that when UCOH before always-true, it's obvious this whole method essentially becomes `return`and can be removed right away. > > I was thinking that we should remove the entire: > > // Note: If min-fill-size decreases to 1, this whole method becomes redundant. > assert(CollectedHeap::min_fill_size() >= 2, "inv"); > > block, since it is now incorrect, guarded by the proper check, and the comment is misleading since we now can have a min-fill-size that is 1. It's still correct when UCOH is disabled -- therefore, the UCOH check can be placed at the start without changing any existing logic. (The "rest" of this method assumes min-fill-size is 2, `assert(CollectedHeap::min_fill_size() == 2, "inv")`.) In this PR, since this method doesn't access UCOH, it can be easily forgotten to update this method when the UCOH flag is removed eventually -- it's not obvious to me that `MinObjAlignment >= checked_cast(CollectedHeap::min_fill_size())` is related to (or can be affected by) `UCOH` at first glance. (I slightly prefer having a `if (UCOH)` inside this method, but considering this method will be nuked in the long run, any short-time decision is fine by me, assuming the failing assert is fixed.) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791611304 From rkennke at openjdk.org Tue Oct 8 10:30:22 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 10:30:22 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <-UEFgAIQjGBginN0JRoyuwwJLmDssUEQGE_tCP-tRkw=.01ef3f37-01fa-4931-b4f3-571d21252bbd@github.com> Message-ID: On Tue, 8 Oct 2024 10:20:45 GMT, Albert Mingkun Yang wrote: >> I was thinking that we should remove the entire: >> >> // Note: If min-fill-size decreases to 1, this whole method becomes redundant. >> assert(CollectedHeap::min_fill_size() >= 2, "inv"); >> >> block, since it is now incorrect, guarded by the proper check, and the comment is misleading since we now can have a min-fill-size that is 1. > > It's still correct when UCOH is disabled -- therefore, the UCOH check can be placed at the start without changing any existing logic. (The "rest" of this method assumes min-fill-size is 2, `assert(CollectedHeap::min_fill_size() == 2, "inv")`.) > > In this PR, since this method doesn't access UCOH, it can be easily forgotten to update this method when the UCOH flag is removed eventually -- it's not obvious to me that `MinObjAlignment >= checked_cast(CollectedHeap::min_fill_size())` is related to (or can be affected by) `UCOH` at first glance. > > (I slightly prefer having a `if (UCOH)` inside this method, but considering this method will be nuked in the long run, any short-time decision is fine by me, assuming the failing assert is fixed.) I added an assert(!UCOH) in the implementation so that we don't forget it once the UCOH flag becomes obsolete. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1791619505 From rkennke at openjdk.org Tue Oct 8 11:47:55 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 11:47:55 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v38] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Fix include guards ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/d57dbfc5..4035bb61 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=37 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=36-37 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From stefank at openjdk.org Tue Oct 8 12:51:19 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 8 Oct 2024 12:51:19 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v38] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 11:47:55 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Fix include guards I have looked through and reviewed most of the files many times and I've tried to give comments in parts of the code where I'm typically not a maintainer. I'm giving an official Review/Approval of the gc/ code and most of the files in oops/. I'm specifically not approving the compressedKlass* files, because I think that others that are more vested in those bits, address ranges, and style need to fully Review those changes. My review comes with a caveat that the there's no significant regressions in GC pauses, marking times, and GC cycle durations, when UCOH is turned off. ------------- Marked as reviewed by stefank (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2354390888 From mbaesken at openjdk.org Tue Oct 8 13:44:12 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Tue, 8 Oct 2024 13:44:12 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang Message-ID: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . ------------- Commit messages: - JDK-8341722 Changes: https://git.openjdk.org/jdk/pull/21407/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21407&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341722 Stats: 9 lines in 4 files changed: 0 ins; 6 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21407.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21407/head:pull/21407 PR: https://git.openjdk.org/jdk/pull/21407 From stooke at openjdk.org Tue Oct 8 14:00:04 2024 From: stooke at openjdk.org (Simon Tooke) Date: Tue, 8 Oct 2024 14:00:04 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v13] In-Reply-To: References: Message-ID: <4dIhTLTOO25b6WmNJqpPMC4htno0UMMR4s8HtJB-GRA=.1a31e42f-4667-41e1-85a6-e8fd56fabc64@github.com> On Mon, 23 Sep 2024 02:01:47 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> delete commented out code > > test/hotspot/gtest/runtime/test_os.cpp line 442: > >> 440: errno = 0; >> 441: returnedBuffer = os::realpath(tmppath, buffer, MAX_PATH); >> 442: EXPECT_TRUE(returnedBuffer != nullptr); > > Why the change? An earlier misundertanding had me thinking the buffer allocated by realpath could be returned. I've reverted this change. > test/hotspot/gtest/runtime/test_os.cpp line 452: > >> 450: EXPECT_TRUE(returnedBuffer == nullptr); >> 451: EXPECT_TRUE(errno == ENAMETOOLONG); >> 452: #endif > > I think it would be better to increase the buffer size on macOS so this remains a positive test for all platforms. We already have different behaviour flagged for Windows. If we were to increase the buffer size, it's probably better to simply delete this test as it would behave the same as the test immediately prior. > test/hotspot/gtest/runtime/test_os.cpp line 460: > >> 458: >> 459: /* the following tests cause an assert in fastdebug mode */ >> 460: DEBUG_ONLY(if (false)) { > > Suggestion: > > #ifndef ASSERT > > no need for a runtime check. fixed. > test/hotspot/gtest/runtime/test_os.cpp line 467: > >> 465: >> 466: errno = 0; >> 467: returnedBuffer = os::realpath(tmppath, buffer, sizeof(buffer)); > > This is still not an EINVAL case - the buffer should be null. > Suggestion: > > returnedBuffer = os::realpath(tmppath, nullptr, sizeof(buffer)); Somehow my fix for this didn't make it into the last commit. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1791924994 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1791932505 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1791930993 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1791927384 From rcastanedalo at openjdk.org Tue Oct 8 15:47:16 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Tue, 8 Oct 2024 15:47:16 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Tue, 8 Oct 2024 07:16:13 GMT, Roman Kennke wrote: >> @rkennke Thanks for the explanation. I attach here a fix which is an extension of existing way of copying while taking care of the smaller object header. Also there are two instances of this in the intrinsic so I have factored the new code into a method and call it from both the places. >> [indexof_fix.patch](https://github.com/user-attachments/files/17285239/indexof_fix.patch) > > Thank you, @sviswa7! Yes this fix looks correct. I've intergrated it into this PR and re-enabled the indexOf intrinsic for compact headers. @rkennke @sviswa7 These changes trigger the following assertion failure: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (codeBuffer.cpp:1004), pid=96032, tid=29699 # guarantee(sect->end() <= tend) failed: sanity when running the following tests with compact object headers disabled (i.e. default JVM settings): - `java/lang/StringBuffer/ECoreIndexOf.java` - `java/lang/String/IndexOf.java` on our test macosx-x64 machines. These machines are equipped with Intel Core i7-8700B processors with the following characteristics: CPU: total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 10 microcode 0xf4, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, rtm, adx, fma, vzeroupper, clflush, clflushopt, rdtscp, f16c If you need more details to reproduce the issue, please let me know and I will try to help. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1792121119 From rcastanedalo at openjdk.org Tue Oct 8 16:01:23 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Tue, 8 Oct 2024 16:01:23 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Tue, 8 Oct 2024 15:44:45 GMT, Roberto Casta?eda Lozano wrote: >> Thank you, @sviswa7! Yes this fix looks correct. I've intergrated it into this PR and re-enabled the indexOf intrinsic for compact headers. > > @rkennke @sviswa7 These changes trigger the following assertion failure: > > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (codeBuffer.cpp:1004), pid=96032, tid=29699 > # guarantee(sect->end() <= tend) failed: sanity > > > when running the following tests with compact object headers disabled (i.e. default JVM settings): > > - `java/lang/StringBuffer/ECoreIndexOf.java` > - `java/lang/String/IndexOf.java` > > on our test macosx-x64 machines. These machines are equipped with Intel Core i7-8700B processors with the following characteristics: > > CPU: total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 10 microcode 0xf4, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, rtm, adx, fma, vzeroupper, clflush, clflushopt, rdtscp, f16c > > > If you need more details to reproduce the issue, please let me know and I will try to help. Turns out I can also reproduce the issue on my linux-x64 machine (Intel Core i7-9850H), simply running: `make run-test TEST="java/lang/String/IndexOf.java" CONF=linux-x64-debug` In this case I get: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (codeBuffer.hpp:200), pid=51958, tid=51975 # assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x00007c2778843560 <= 0x00007c27788543b3 <= 0x00007c27788543b0 A few more details of my processor: family 6 model 158 stepping 13 flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1792141874 From rkennke at openjdk.org Tue Oct 8 16:30:47 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 16:30:47 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v39] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Increase compiler code stubs size for indexOf intrinsic ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/4035bb61..b289ef88 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=38 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=37-38 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From cjplummer at openjdk.org Tue Oct 8 16:32:59 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 8 Oct 2024 16:32:59 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> Message-ID: <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> On Tue, 8 Oct 2024 13:38:54 GMT, Matthias Baesken wrote: > There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. > Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c line 393: > 391: > 392: hcreate_r(htab_sz, symtab->hash_table); > 393: // guarantee(rslt, "unexpected failure: hcreate_r"); The commented out guarantee line references rslt. I'm not so sure why it was commented out, but it goes back to the initial load of the file 17 years ago. It looks like the correct thing to do if rslt is null is to "goto bad;" but that change is probably beyond the scope of this PR. Maybe file a new CR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1792185871 From rkennke at openjdk.org Tue Oct 8 16:34:19 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 8 Oct 2024 16:34:19 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Tue, 8 Oct 2024 15:58:33 GMT, Roberto Casta?eda Lozano wrote: >> @rkennke @sviswa7 These changes trigger the following assertion failure: >> >> >> # >> # A fatal error has been detected by the Java Runtime Environment: >> # >> # Internal Error (codeBuffer.cpp:1004), pid=96032, tid=29699 >> # guarantee(sect->end() <= tend) failed: sanity >> >> >> when running the following tests with compact object headers disabled (i.e. default JVM settings): >> >> - `java/lang/StringBuffer/ECoreIndexOf.java` >> - `java/lang/String/IndexOf.java` >> >> on our test macosx-x64 machines. These machines are equipped with Intel Core i7-8700B processors with the following characteristics: >> >> CPU: total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 10 microcode 0xf4, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, rtm, adx, fma, vzeroupper, clflush, clflushopt, rdtscp, f16c >> >> >> If you need more details to reproduce the issue, please let me know and I will try to help. > > Turns out I can also reproduce the issue on my linux-x64 machine (Intel Core i7-9850H), simply running: > > `make run-test TEST="java/lang/String/IndexOf.java" CONF=linux-x64-debug` > > In this case I get: > > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (codeBuffer.hpp:200), pid=51958, tid=51975 > # assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x00007c2778843560 <= 0x00007c27788543b3 <= 0x00007c27788543b0 > > > A few more details of my processor: > > family 6 model 158 stepping 13 > flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities Oh! We need to increase the compiler stub size for the indexOf changes. Strange that it blows up like this, I was sure there was a better check for this somewhere. I changed it like this, let me know if you agree that this is the correct fix: https://github.com/openjdk/jdk/pull/20677/commits/b289ef885816958d9806c76f473b10e34a39e247 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1792186244 From cjplummer at openjdk.org Tue Oct 8 16:37:09 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 8 Oct 2024 16:37:09 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent [v2] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 06:58:13 GMT, Johannes Bechberger wrote: >> Remove the support for on-demand debugging via the onjcmd option. > > Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: > > Use port 0 in TestAgentEvent Changes look good. Thanks for taking care of this. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21387#pullrequestreview-2355012768 From sviswanathan at openjdk.org Tue Oct 8 16:38:23 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Tue, 8 Oct 2024 16:38:23 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Tue, 8 Oct 2024 16:30:56 GMT, Roman Kennke wrote: >> Turns out I can also reproduce the issue on my linux-x64 machine (Intel Core i7-9850H), simply running: >> >> `make run-test TEST="java/lang/String/IndexOf.java" CONF=linux-x64-debug` >> >> In this case I get: >> >> >> # >> # A fatal error has been detected by the Java Runtime Environment: >> # >> # Internal Error (codeBuffer.hpp:200), pid=51958, tid=51975 >> # assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x00007c2778843560 <= 0x00007c27788543b3 <= 0x00007c27788543b0 >> >> >> A few more details of my processor: >> >> family 6 model 158 stepping 13 >> flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities > > Oh! We need to increase the compiler stub size for the indexOf changes. Strange that it blows up like this, I was sure there was a better check for this somewhere. I changed it like this, let me know if you agree that this is the correct fix: > https://github.com/openjdk/jdk/pull/20677/commits/b289ef885816958d9806c76f473b10e34a39e247 Yes, the fix looks correct. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1792191386 From wkemper at openjdk.org Tue Oct 8 17:20:31 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 8 Oct 2024 17:20:31 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: > This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: - Fix merge error - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux - Merge branch 'shenandoah/master' into great-genshen-pr-redux - Merge - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane Reviewed-by: kdnilsen - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode Reviewed-by: kdnilsen, ysr - Merge - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle Reviewed-by: kdnilsen - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation Reviewed-by: kdnilsen, shade, ysr - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 ------------- Changes: https://git.openjdk.org/jdk/pull/21273/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21273&range=02 Stats: 22593 lines in 229 files changed: 20952 ins; 810 del; 831 mod Patch: https://git.openjdk.org/jdk/pull/21273.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21273/head:pull/21273 PR: https://git.openjdk.org/jdk/pull/21273 From dcubed at openjdk.org Tue Oct 8 18:40:01 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Tue, 8 Oct 2024 18:40:01 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:50:46 GMT, Kevin Walls wrote: >> Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: >> >> Have EventGeneratorLoop end after a more predictable duration > > Don't worry I'll close 8341518 as a duplicate. @kevinjwalls - Have you run this fix thru Tier5 in the Oracle CI? That's where we see a consistent single failure per Tier5 job set. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2400560564 From dcubed at openjdk.org Tue Oct 8 23:48:28 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Tue, 8 Oct 2024 23:48:28 GMT Subject: RFR: 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 Message-ID: A couple of trivial fixes to ProblemList some noisy tests: [JDK-8341803](https://bugs.openjdk.org/browse/JDK-8341803) ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 [JDK-8341805](https://bugs.openjdk.org/browse/JDK-8341805) ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode ------------- Commit messages: - 8341805: ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode - 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 Changes: https://git.openjdk.org/jdk/pull/21417/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21417&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341803 Stats: 6 lines in 2 files changed: 3 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21417.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21417/head:pull/21417 PR: https://git.openjdk.org/jdk/pull/21417 From psandoz at openjdk.org Tue Oct 8 23:56:57 2024 From: psandoz at openjdk.org (Paul Sandoz) Date: Tue, 8 Oct 2024 23:56:57 GMT Subject: RFR: 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 23:14:55 GMT, Daniel D. Daugherty wrote: > A couple of trivial fixes to ProblemList some noisy tests: > [JDK-8341803](https://bugs.openjdk.org/browse/JDK-8341803) ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 > [JDK-8341805](https://bugs.openjdk.org/browse/JDK-8341805) ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode Marked as reviewed by psandoz (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21417#pullrequestreview-2355721589 From dcubed at openjdk.org Wed Oct 9 00:03:00 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 9 Oct 2024 00:03:00 GMT Subject: RFR: 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 23:54:50 GMT, Paul Sandoz wrote: >> A couple of trivial fixes to ProblemList some noisy tests: >> [JDK-8341803](https://bugs.openjdk.org/browse/JDK-8341803) ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 >> [JDK-8341805](https://bugs.openjdk.org/browse/JDK-8341805) ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode > > Marked as reviewed by psandoz (Reviewer). @PaulSandoz - Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21417#issuecomment-2401010969 From dcubed at openjdk.org Wed Oct 9 00:03:01 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 9 Oct 2024 00:03:01 GMT Subject: Integrated: 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 23:14:55 GMT, Daniel D. Daugherty wrote: > A couple of trivial fixes to ProblemList some noisy tests: > [JDK-8341803](https://bugs.openjdk.org/browse/JDK-8341803) ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 > [JDK-8341805](https://bugs.openjdk.org/browse/JDK-8341805) ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode This pull request has now been integrated. Changeset: f276f58f Author: Daniel D. Daugherty URL: https://git.openjdk.org/jdk/commit/f276f58fb427a849549a525a200e95e28952edf4 Stats: 6 lines in 2 files changed: 3 ins; 0 del; 3 mod 8341803: ProblemList containers/docker/TestJcmdWithSideCar.java on linux-x64 8341805: ProblemList five mlvm/indy/func/jvmti tests in Xcomp mode Reviewed-by: psandoz ------------- PR: https://git.openjdk.org/jdk/pull/21417 From dcubed at openjdk.org Wed Oct 9 00:06:00 2024 From: dcubed at openjdk.org (Daniel D. Daugherty) Date: Wed, 9 Oct 2024 00:06:00 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: <5jaKmBk24j4mfs22UF7_oaxM7f5ffrEbnAOzzaIjU_4=.2f0a3071-0a74-4a08-8070-15dbea0464a6@github.com> On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration This test has been ProblemListed via: https://github.com/openjdk/jdk/pull/21417 We reached 24 sightings in the main CI which is way past my limit. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2401015745 From duke at openjdk.org Wed Oct 9 01:15:11 2024 From: duke at openjdk.org (duke) Date: Wed, 9 Oct 2024 01:15:11 GMT Subject: RFR: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging [v3] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 04:17:31 GMT, Ramkumar Sunderbabu wrote: >> JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. >> >> Testing: >> tier1,tier2,tier3 >> tier6-comp,tier8-comp > > Ramkumar Sunderbabu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > commit after resolving conflicts @rsunderbabu Your change (at version 4b3bba2568c601fa9a03908e604573a7e0ba6e7a) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21392#issuecomment-2401078991 From rsunderbabu at openjdk.org Wed Oct 9 03:15:00 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 9 Oct 2024 03:15:00 GMT Subject: Integrated: 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 15:28:19 GMT, Ramkumar Sunderbabu wrote: > JDK-8318668 was not reproducible in repeated runs. Hence, I am pulling it out of problem listing. Additionally I have increased logging so that it is easier to debug when the issue happens again. > > Testing: > tier1,tier2,tier3 > tier6-comp,tier8-comp This pull request has now been integrated. Changeset: de90204b Author: Ramkumar Sunderbabu URL: https://git.openjdk.org/jdk/commit/de90204b60c408ef258a2d2515ad252de4b23536 Stats: 7 lines in 3 files changed: 3 ins; 1 del; 3 mod 8341588: Remove CollectionUsageThreshold.java from ProblemList-Xcomp for debugging Reviewed-by: lmesnik, kevinw ------------- PR: https://git.openjdk.org/jdk/pull/21392 From lmao at openjdk.org Wed Oct 9 03:30:07 2024 From: lmao at openjdk.org (Liang Mao) Date: Wed, 9 Oct 2024 03:30:07 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Tue, 8 Oct 2024 17:20:31 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: > > - Fix merge error > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 Congratulations! Good to see the great progress. I just built this PR for some testing and found something unexpected. I ran the genshen VS shenandoah(default) with jbb2015 on aarch64 N2 with 8 cores and Xmx8g. The critical-jOPS of genshen(5373) is behind shenandoah(6027). Do I miss something on the options? ```java -Xmx8g -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational -Xlog:gc* -XX:MetaspaceSize=1g -jar specjbb2015.jar -m COMPOSITE``` ------------- PR Comment: https://git.openjdk.org/jdk/pull/21273#issuecomment-2401194597 From mbaesken at openjdk.org Wed Oct 9 06:27:59 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 9 Oct 2024 06:27:59 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> Message-ID: <5UMeyoUDYQdXMI4WrOL9wvprNM3T7aJcFmGy5XQNQqo=.e4b257cf-d52a-4b5f-99e5-7bb5d5deb325@github.com> On Tue, 8 Oct 2024 16:30:36 GMT, Chris Plummer wrote: >> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. >> Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . > > src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c line 393: > >> 391: >> 392: hcreate_r(htab_sz, symtab->hash_table); >> 393: // guarantee(rslt, "unexpected failure: hcreate_r"); > > The commented out guarantee line references rslt. I'm not so sure why it was commented out, but it goes back to the initial load of the file 17 years ago. It looks like the correct thing to do if rslt is null is to "goto bad;" but that change is probably beyond the scope of this PR. Maybe file a new CR. Hi Chris , I created https://bugs.openjdk.org/browse/JDK-8341820 for the return value checking. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1792911176 From rcastanedalo at openjdk.org Wed Oct 9 06:30:18 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Wed, 9 Oct 2024 06:30:18 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Tue, 8 Oct 2024 16:30:56 GMT, Roman Kennke wrote: >> Turns out I can also reproduce the issue on my linux-x64 machine (Intel Core i7-9850H), simply running: >> >> `make run-test TEST="java/lang/String/IndexOf.java" CONF=linux-x64-debug` >> >> In this case I get: >> >> >> # >> # A fatal error has been detected by the Java Runtime Environment: >> # >> # Internal Error (codeBuffer.hpp:200), pid=51958, tid=51975 >> # assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x00007c2778843560 <= 0x00007c27788543b3 <= 0x00007c27788543b0 >> >> >> A few more details of my processor: >> >> family 6 model 158 stepping 13 >> flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities > > Oh! We need to increase the compiler stub size for the indexOf changes. Strange that it blows up like this, I was sure there was a better check for this somewhere. I changed it like this, let me know if you agree that this is the correct fix: > https://github.com/openjdk/jdk/pull/20677/commits/b289ef885816958d9806c76f473b10e34a39e247 That seems to work, thanks @rkennke! Since the [indexOf changes](https://github.com/openjdk/jdk/pull/20677/files#diff-ae1139bb5342494f9761e04389b090c543391bfdd7817af1625e854357c96e63) are complex and affect the default JVM configuration, they should be subject to the same level of scrutiny as if they were a standalone RFE, i.e. approved by at least a second reviewer. @sviswa7 could someone else at Intel have a second look and explicitly approve them? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1792911644 From stooke at openjdk.org Wed Oct 9 07:16:13 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 9 Oct 2024 07:16:13 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v14] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: feedback from review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/920f67d8..6715569a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=12-13 Stats: 24 lines in 1 file changed: 5 ins; 1 del; 18 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From jwaters at openjdk.org Wed Oct 9 07:28:58 2024 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 9 Oct 2024 07:28:58 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <5UMeyoUDYQdXMI4WrOL9wvprNM3T7aJcFmGy5XQNQqo=.e4b257cf-d52a-4b5f-99e5-7bb5d5deb325@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> <5UMeyoUDYQdXMI4WrOL9wvprNM3T7aJcFmGy5XQNQqo=.e4b257cf-d52a-4b5f-99e5-7bb5d5deb325@github.com> Message-ID: <0phEjRhdkzoktdn5f-VmwNddCFABbKUw0XKgLENxsII=.44778b32-2039-4b52-9b97-40b5ee690675@github.com> On Wed, 9 Oct 2024 06:25:07 GMT, Matthias Baesken wrote: >> src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c line 393: >> >>> 391: >>> 392: hcreate_r(htab_sz, symtab->hash_table); >>> 393: // guarantee(rslt, "unexpected failure: hcreate_r"); >> >> The commented out guarantee line references rslt. I'm not so sure why it was commented out, but it goes back to the initial load of the file 17 years ago. It looks like the correct thing to do if rslt is null is to "goto bad;" but that change is probably beyond the scope of this PR. Maybe file a new CR. > > Hi Chris , I created https://bugs.openjdk.org/browse/JDK-8341820 for the return value checking. Might be a good idea to have rslt commented out rather than removed outright if we don't want to forget about it. guarantee on a variable that doesn't exist will be rather confusing to anyone reading through the code ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1793006705 From sspitsyn at openjdk.org Wed Oct 9 07:41:01 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 9 Oct 2024 07:41:01 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods In-Reply-To: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> References: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> Message-ID: On Mon, 7 Oct 2024 22:41:06 GMT, Leonid Mesnik wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 25: > >> 23: >> 24: /* >> 25: * @test id=virtual > > Having 'id=virtual' not needed and might confuse people. They expect to have other test variations for platform. Good suggestion, thanks. Removed. > test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 32: > >> 30: >> 31: public class CheckHiddenFrames { >> 32: private static final String AGENT_LIB = "CheckHiddenFrames"; > > It is not used? Thanks, removed. I saw it but forgot to remove. > test/hotspot/jtreg/serviceability/jvmti/vthread/CheckHiddenFrames/CheckHiddenFrames.java line 43: > >> 41: >> 42: public static void main(String[] args) throws Exception { >> 43: Thread thread = Thread.ofVirtual().unstarted(CheckHiddenFrames::test); > > You can use > startVirtualThread > to save one line. Good suggestion, thanks. Changed to use startVirtualThread. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793023718 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793024733 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793023025 From sspitsyn at openjdk.org Wed Oct 9 07:57:57 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 9 Oct 2024 07:57:57 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods In-Reply-To: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> References: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> Message-ID: On Mon, 7 Oct 2024 23:43:23 GMT, Leonid Mesnik wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 2009: > >> 2007: bool is_virtual = java_lang_VirtualThread::is_instance(thread_oop); >> 2008: >> 2009: // Target can be virtual or platform thread. > > Can you please explain in comment why is it needed to disable all threads for platform target thread. Thank you for suggestion. Explained comment. Now, it looks as below: // Target can be virtual or platform thread. // Disable VTMS transition for one thread if it is virtual. // Otherwise, disable VTMS transitions for all threads // to protect against VTMS transitions in carrier threads. // For the latter VTMS transitions are disabled for all threads by several reasons: // - carrier threads can mount virtual threads which may cause incorrect behavior // - it is good invariant if we can ensure no VTMS transition might happen at some points // - there is no mechanism to disable transitions for a specific carrier threads yet ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793048247 From sspitsyn at openjdk.org Wed Oct 9 08:01:58 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 9 Oct 2024 08:01:58 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods In-Reply-To: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> References: <10mZcVsZJP5Rcb-M1_EJxOeamq1PWSp1LPUZQSGh2Zc=.82fc7d27-0ce7-417c-96ce-446a0356f340@github.com> Message-ID: On Tue, 8 Oct 2024 00:11:12 GMT, Leonid Mesnik wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 691: > >> 689: >> 690: if (is_virtual || jt->is_in_VTMS_transition()) { // filter out pure continuations >> 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); > > Wouldn't be easier to split method `check_and_skip_hidden_frames` to skip_yeilds and skip_transition frames? > BTW Also it is unclear shouldn't the `@Hidden` methods be skipped from all jvmti frame streams? Good suggestion, thanks. I was also thinking about it but was not sure it can be simplified. JVMTI does not support @Hidden annotation which is used in Java `printStackTrace()` api implementation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793054337 From mbaesken at openjdk.org Wed Oct 9 10:38:57 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 9 Oct 2024 10:38:57 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <0phEjRhdkzoktdn5f-VmwNddCFABbKUw0XKgLENxsII=.44778b32-2039-4b52-9b97-40b5ee690675@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> <5UMeyoUDYQdXMI4WrOL9wvprNM3T7aJcFmGy5XQNQqo=.e4b257cf-d52a-4b5f-99e5-7bb5d5deb325@github.com> <0phEjRhdkzoktdn5f-VmwNddCFABbKUw0XKgLENxsII=.44778b32-2039-4b52-9b97-40b5ee690675@github.com> Message-ID: On Wed, 9 Oct 2024 07:26:41 GMT, Julian Waters wrote: > Might be a good idea to have rslt commented out Why not; Chris what do you say ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1793282296 From jsjolen at openjdk.org Wed Oct 9 10:58:59 2024 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Wed, 9 Oct 2024 10:58:59 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: <-RsM5drgIB3p9AOkmUVuDkzPAmyujn6I91NBZiv7Eb8=.ca6112f4-fa6a-490c-b594-cb37f97aa129@github.com> On Wed, 2 Oct 2024 13:28:13 GMT, Robert Toyonaga wrote: >> ### Summary >> This PR just replaces `ThreadCritical` with a lock specific to NMT. `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init. There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests) don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. >> >> Testing: >> - hotspot_nmt >> - gtest:VirtualSpace >> - tier1 > > Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: > > Update src/hotspot/share/utilities/vmError.cpp > > Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> Hi, Big thanks to David for taking the heavy brunt of reviewing this change. This code looks good to me, it's a bit unfortunate that we have to export `MemTracker::reduce_tracking_to_summary` for the limited use case of exiting the VM on error, but OK. Let's wait for Thomas to come back for this change, I think it's not more than fair that he gets to have another look at this. ------------- Marked as reviewed by jsjolen (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20852#pullrequestreview-2356793662 From kevinw at openjdk.org Wed Oct 9 11:14:01 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 9 Oct 2024 11:14:01 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration Hmm, actually no I _can_ still get a failure. This change is still worthwhile, but not a reason to un-problemlist the test just yet (so thanks, yes problemlisting was a good step). Previously, the EventGeneratorLoop had shown its ending message, so it was not surprising the test failed. Now I don't see that message (good, EventGeneratorLoop still running), but can still get the same kind of failure (java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr). More to do in 8341518... ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2402025140 From aboldtch at openjdk.org Wed Oct 9 11:21:27 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 9 Oct 2024 11:21:27 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation Message-ID: This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. Object o = new Object(); synchronized(o) { o.wait(1); } synchronized(o) { deoptimize(); } got transformed to Object o = new Object(); synchronized(o) { o.wait(1); } // synchronized(o) { Eliminated lock deoptimize(); // } As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. ------------- Commit messages: - Decouple from EA and potential partial lock elimination - 8341819: LightweightSynchronizer::enter_for races with deflation Changes: https://git.openjdk.org/jdk/pull/21420/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21420&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341819 Stats: 19 lines in 2 files changed: 17 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21420.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21420/head:pull/21420 PR: https://git.openjdk.org/jdk/pull/21420 From mbaesken at openjdk.org Wed Oct 9 11:44:35 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 9 Oct 2024 11:44:35 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> Message-ID: <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> > There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. > Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: adjust gcc warning settings; bring back rslt ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21407/files - new: https://git.openjdk.org/jdk/pull/21407/files/ee3546b1..705bd07b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21407&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21407&range=00-01 Stats: 3 lines in 2 files changed: 1 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21407.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21407/head:pull/21407 PR: https://git.openjdk.org/jdk/pull/21407 From mbaesken at openjdk.org Wed Oct 9 11:47:00 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 9 Oct 2024 11:47:00 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> Message-ID: <-lxjK9aLbWpegpHr8XKWFqLck4OShpBuuBpWrLMkMyk=.5450dde8-025f-4a94-8f50-605f246e3578@github.com> On Tue, 8 Oct 2024 13:38:54 GMT, Matthias Baesken wrote: > There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. > Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . I brought back `rslt` but uncommented, as suggested. Additionally I removed some special gcc warning setting; those disabled the symtab.c and LinuxDebuggerLocal.cpp related warnings when compiling with gcc (brings clang and gcc behavior a bit closer together). ------------- PR Comment: https://git.openjdk.org/jdk/pull/21407#issuecomment-2402092775 From rkennke at openjdk.org Wed Oct 9 11:49:05 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 9 Oct 2024 11:49:05 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 11:16:46 GMT, Axel Boldt-Christmas wrote: > This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. > > For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. > > However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > synchronized(o) { > deoptimize(); > } > > got transformed to > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > // synchronized(o) { Eliminated lock > deoptimize(); > // } > > > As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. > After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. Looks good to me. Thank you! ------------- Marked as reviewed by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21420#pullrequestreview-2356904757 From aboldtch at openjdk.org Wed Oct 9 11:50:17 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 9 Oct 2024 11:50:17 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode Message-ID: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) ------------- Commit messages: - Remove XCollectedHeap from HSDB - Fix typo in TestZUncommitEvent.java - Add missing problem-listing - Remove x from jdk.hotspot.agent - 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode Changes: https://git.openjdk.org/jdk/pull/21401/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341692 Stats: 39423 lines in 406 files changed: 152 ins; 39003 del; 268 mod Patch: https://git.openjdk.org/jdk/pull/21401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21401/head:pull/21401 PR: https://git.openjdk.org/jdk/pull/21401 From stooke at openjdk.org Wed Oct 9 12:12:36 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 9 Oct 2024 12:12:36 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v15] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: account for Windows behviour changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/6715569a..e1b2c534 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=13-14 Stats: 8 lines in 2 files changed: 4 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From aboldtch at openjdk.org Wed Oct 9 12:57:36 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 9 Oct 2024 12:57:36 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> Message-ID: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> > This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: - LargeWindowPaintTest.java fix id typo - Fix problem-listed @requires typo - Fix @requires !vm.gc.Z, must use vm.gc != "Z" - Reorder z_globals options: product > diagnostic product > develop - Consistent albite special code style - Consistent order between ZArguments and GCArguments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21401/files - new: https://git.openjdk.org/jdk/pull/21401/files/e5865bc8..22c243a6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=00-01 Stats: 53 lines in 8 files changed: 21 ins; 23 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/21401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21401/head:pull/21401 PR: https://git.openjdk.org/jdk/pull/21401 From ihse at openjdk.org Wed Oct 9 13:25:48 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 9 Oct 2024 13:25:48 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> Message-ID: On Wed, 9 Oct 2024 12:57:36 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: > > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments Build changes look good. Are you on a direct track towards winning over the title of Dr Deprecator? ;-) ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2357082736 From stefank at openjdk.org Wed Oct 9 13:25:49 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 9 Oct 2024 13:25:49 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> Message-ID: On Wed, 9 Oct 2024 12:57:36 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: > > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments src/hotspot/share/runtime/arguments.cpp line 523: > 521: > 522: { "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() }, > 523: { "ZGenerational", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::undefined() }, FTR: This line depends on what version the JEP gets targeted to. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21401#discussion_r1793510168 From stefank at openjdk.org Wed Oct 9 13:27:13 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 9 Oct 2024 13:27:13 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> Message-ID: On Wed, 9 Oct 2024 12:57:36 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: > > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments Looks good to me! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21401#issuecomment-2402271738 From pchilanomate at openjdk.org Wed Oct 9 14:15:59 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 9 Oct 2024 14:15:59 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 11:16:46 GMT, Axel Boldt-Christmas wrote: > This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. > > For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. > > However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > synchronized(o) { > deoptimize(); > } > > got transformed to > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > // synchronized(o) { Eliminated lock > deoptimize(); > // } > > > As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. > After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. Looks good to me, thanks. ------------- Marked as reviewed by pchilanomate (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21420#pullrequestreview-2357290865 From eosterlund at openjdk.org Wed Oct 9 14:46:00 2024 From: eosterlund at openjdk.org (Erik =?UTF-8?B?w5ZzdGVybHVuZA==?=) Date: Wed, 9 Oct 2024 14:46:00 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> Message-ID: On Wed, 9 Oct 2024 12:57:36 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: > > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments Looks good. ------------- Marked as reviewed by eosterlund (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2357380323 From rsunderbabu at openjdk.org Wed Oct 9 15:06:11 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 9 Oct 2024 15:06:11 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support Message-ID: The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". Positive Testing: tier1,tier2,tier3 - to check stability tier5 - to run container tests Negative Testing: Ran the following groups in hosts where container is not present. open/test/hotspot/jtreg/containers/ open/test/jdk/jdk/internal/platform/docker/ open/test/jdk/jdk/internal/platform/cgroup/ ------------- Commit messages: - corrected the copyright headers - initial commit Changes: https://git.openjdk.org/jdk/pull/21423/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21423&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341138 Stats: 54 lines in 26 files changed: 6 ins; 0 del; 48 mod Patch: https://git.openjdk.org/jdk/pull/21423.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21423/head:pull/21423 PR: https://git.openjdk.org/jdk/pull/21423 From cjplummer at openjdk.org Wed Oct 9 15:38:03 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 9 Oct 2024 15:38:03 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <9xtyq-yoawgL56BKui49A19DYpPHJZVC4Cw5a_gQLuY=.75aa9044-3b40-49fc-bb80-5ad5e4865fe3@github.com> <5UMeyoUDYQdXMI4WrOL9wvprNM3T7aJcFmGy5XQNQqo=.e4b257cf-d52a-4b5f-99e5-7bb5d5deb325@github.com> <0phEjRhdkzoktdn5f-VmwNddCFABbKUw0XKgLENxsII=.44778b32-2039-4b52-9b97-40b5ee690675@github.com> Message-ID: On Wed, 9 Oct 2024 10:36:28 GMT, Matthias Baesken wrote: >> Might be a good idea to have rslt commented out rather than removed outright if we don't want to forget about it. guarantee on a variable that doesn't exist will be rather confusing to anyone reading through the code > >> Might be a good idea to have rslt commented out > > Why not; Chris what do you say ? Yeah, I think it is good like this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1793746144 From cjplummer at openjdk.org Wed Oct 9 15:38:01 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 9 Oct 2024 15:38:01 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> Message-ID: On Wed, 9 Oct 2024 11:44:35 GMT, Matthias Baesken wrote: >> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. >> Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . > > Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: > > adjust gcc warning settings; bring back rslt Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21407#pullrequestreview-2357520081 From sviswanathan at openjdk.org Wed Oct 9 16:25:23 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Wed, 9 Oct 2024 16:25:23 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Wed, 9 Oct 2024 06:25:28 GMT, Roberto Casta?eda Lozano wrote: >> Oh! We need to increase the compiler stub size for the indexOf changes. Strange that it blows up like this, I was sure there was a better check for this somewhere. I changed it like this, let me know if you agree that this is the correct fix: >> https://github.com/openjdk/jdk/pull/20677/commits/b289ef885816958d9806c76f473b10e34a39e247 > > That seems to work, thanks @rkennke! > > Since the [indexOf changes](https://github.com/openjdk/jdk/pull/20677/files#diff-ae1139bb5342494f9761e04389b090c543391bfdd7817af1625e854357c96e63) are complex and affect the default JVM configuration, they should be subject to the same level of scrutiny as if they were a standalone RFE, i.e. approved by at least a second reviewer. @sviswa7 could someone else at Intel have a second look and explicitly approve them? Yes, @vpaprotsk could review the changes that we made in src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1793814453 From kevinw at openjdk.org Wed Oct 9 17:31:06 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 9 Oct 2024 17:31:06 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters In-Reply-To: References: Message-ID: On Tue, 17 Sep 2024 14:10:07 GMT, Kevin Walls wrote: > DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. > e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". Hi, Looking for input. We do _need_ this change, or something like it, as we have the FILE type out there in the product, and JMC does not understand it (nor would any other app). ------------- PR Comment: https://git.openjdk.org/jdk/pull/21040#issuecomment-2402897334 From rcastanedalo at openjdk.org Wed Oct 9 17:44:24 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Wed, 9 Oct 2024 17:44:24 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Wed, 9 Oct 2024 16:21:53 GMT, Sandhya Viswanathan wrote: >> That seems to work, thanks @rkennke! >> >> Since the [indexOf changes](https://github.com/openjdk/jdk/pull/20677/files#diff-ae1139bb5342494f9761e04389b090c543391bfdd7817af1625e854357c96e63) are complex and affect the default JVM configuration, they should be subject to the same level of scrutiny as if they were a standalone RFE, i.e. approved by at least a second reviewer. @sviswa7 could someone else at Intel have a second look and explicitly approve them? > > Yes, @vpaprotsk could review the changes that we made in src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp. Yes, that would be great. In the meantime, I ran a few thousand times the randomized test `java/lang/StringBuffer/ECoreIndexOf.java` with and without compact object headers, on product and debug builds, on different x64 implementations, and found no failures. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1793917912 From prr at openjdk.org Wed Oct 9 18:27:02 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 9 Oct 2024 18:27:02 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v2] In-Reply-To: <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <7ekcZqBSpXnzKa2EHQKPNZhhrBIrL7A0ubEBpWXMVUc=.88bfa7d4-c75a-4b56-9c2c-da8acc6f605a@github.com> Message-ID: On Wed, 9 Oct 2024 12:57:36 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request incrementally with six additional commits since the last revision: > > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments the 2D/AWT test changes are fine. I've not looked at anything else. ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2357882378 From duke at openjdk.org Wed Oct 9 19:13:02 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Wed, 9 Oct 2024 19:13:02 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 11:11:24 GMT, Kevin Walls wrote: >> Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: >> >> Have EventGeneratorLoop end after a more predictable duration > > Hmm, actually no I _can_ still get a failure. > > This change is still worthwhile, but not a reason to un-problemlist the test just yet (so thanks, yes problemlisting was a good step). > > Previously, the EventGeneratorLoop had shown its ending message, so it was not surprising the test failed. > > Now I don't see that message (good, EventGeneratorLoop still running), but can still get the same kind of failure > (java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr). More to do in 8341518... I take it you have not been able to reproduce the problem outside CI yet @kevinjwalls? Have you been able to pinpoint anything about where or when the failures happen? OS version, kernel version, Docker version, anything else? I saw some notes about it in https://bugs.openjdk.org/browse/JDK-8341518, is OEL referring to Oracle Linux? Only ever failures on OEL 7, never on OEL 8? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2403097164 From sgehwolf at openjdk.org Wed Oct 9 19:38:11 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Wed, 9 Oct 2024 19:38:11 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 14:50:30 GMT, Ramkumar Sunderbabu wrote: > The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". > > Positive Testing: > tier1,tier2,tier3 - to check stability > tier5 - to run container tests > > Negative Testing: > Ran the following groups in hosts where container is not present. > open/test/hotspot/jtreg/containers/ > open/test/jdk/jdk/internal/platform/docker/ > open/test/jdk/jdk/internal/platform/cgroup/ Seems OK to me. One minor nit. test/lib/jdk/test/lib/Container.java line 27: > 25: > 26: public class Container { > 27: // Use this property to specify container location on your system. Suggestion: // Use this property to specify container runtime location (e.g. docker) on your system. ------------- PR Review: https://git.openjdk.org/jdk/pull/21423#pullrequestreview-2358152114 PR Review Comment: https://git.openjdk.org/jdk/pull/21423#discussion_r1794127601 From kevinw at openjdk.org Wed Oct 9 19:48:12 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 9 Oct 2024 19:48:12 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration Yes OEL was Oracle Linux: Our CI tests with docker run on Oracle Linux 7, and they fail with elevated-true (i.e. with "--cap-add=NET_BIND_SERVICE"). Our CI runs with Oracle Linux 8 use podman and they are OK using "--cap-add=NET_BIND_SERVICE" ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2403302429 From sviswanathan at openjdk.org Wed Oct 9 20:28:29 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Wed, 9 Oct 2024 20:28:29 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v26] In-Reply-To: References: <6PTWMepIDuZDdPfN3xNKV1vqUyO_R4yCSeiSTpYIyyQ=.61a5b462-7114-4385-a6d7-40e5c7b0005d@github.com> <6yrLSIp1cwJXxYVoMfSLxhbFA9Qdc9P3ML25QW0sfL4=.aa8bedac-1faa-4148-bcfc-a1434ddc9bac@github.com> Message-ID: On Wed, 9 Oct 2024 17:41:37 GMT, Roberto Casta?eda Lozano wrote: >> Yes, @vpaprotsk could review the changes that we made in src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp. > > Yes, that would be great. In the meantime, I ran a few thousand times the randomized test `java/lang/StringBuffer/ECoreIndexOf.java` with and without compact object headers, on product and debug builds, on different x64 implementations, and found no failures. Thanks a lot @robcasloz for doing the testing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1794181528 From cjplummer at openjdk.org Wed Oct 9 20:39:12 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 9 Oct 2024 20:39:12 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters In-Reply-To: References: Message-ID: On Tue, 17 Sep 2024 14:10:07 GMT, Kevin Walls wrote: > DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. > e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java line 133: > 131: > 132: // Knowledge of the types made public by com.sun.management.internal.DiagnosticCommandImpl > 133: private static final String [] publicTypes = new String [] { "INT", "STRING", "BOOLEAN", "STRING SET", "MEMORY SIZE", "NANOTIME" }; These type are "implementation dependent", yet we are referring to them as public types. Also, these "public types" are now in two different places. If they were public, only one copy should be needed. Maybe we just need better terminology since they are not actually public, but just happen to be the types the implementation is know to return...err, I guess you could say the leak out to the "public". Sigh. IDK. I guess I just feel we could do a better job in how we refer to these types in the code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21040#discussion_r1794193671 From sspitsyn at openjdk.org Wed Oct 9 22:47:31 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 9 Oct 2024 22:47:31 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v2] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: 1. Minor tweaks in new test; 2. Refactor skip_hidden_frames in two ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/8615d2b9..8ec7bd3f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=00-01 Stats: 42 lines in 3 files changed: 23 ins; 12 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sspitsyn at openjdk.org Wed Oct 9 22:58:33 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 9 Oct 2024 22:58:33 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/8ec7bd3f..3317ea81 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=01-02 Stats: 14 lines in 2 files changed: 8 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From stooke at openjdk.org Thu Oct 10 06:44:29 2024 From: stooke at openjdk.org (Simon Tooke) Date: Thu, 10 Oct 2024 06:44:29 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v16] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: remove accidently commited file ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/e1b2c534..e8c29ff5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=14-15 Stats: 59 lines in 1 file changed: 0 ins; 59 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From lucy at openjdk.org Thu Oct 10 06:46:13 2024 From: lucy at openjdk.org (Lutz Schmidt) Date: Thu, 10 Oct 2024 06:46:13 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> Message-ID: <8FNj6NUjFGDmgaThzmacRV9g584Pm6_5v-wdtjJCao8=.877913eb-0cfd-4b4e-971a-d39525cf77e9@github.com> On Wed, 9 Oct 2024 11:44:35 GMT, Matthias Baesken wrote: >> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. >> Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . > > Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: > > adjust gcc warning settings; bring back rslt LGTM. ------------- Marked as reviewed by lucy (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21407#pullrequestreview-2359153153 From stooke at openjdk.org Thu Oct 10 06:51:13 2024 From: stooke at openjdk.org (Simon Tooke) Date: Thu, 10 Oct 2024 06:51:13 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v17] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke 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 22 additional commits since the last revision: - Merge branch 'master' into pr_windows_realpath - remove accidently commited file - account for Windows behviour changes - feedback from review - delete commented out code - fix realpath test on macOS - remove tabs - remove conditional compilation - Merge branch 'master' into pr_windows_realpath - fix realpath() test for POSIX - ... and 12 more: https://git.openjdk.org/jdk/compare/281b387e...9fe1466b ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/e8c29ff5..9fe1466b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=15-16 Stats: 67910 lines in 1125 files changed: 55391 ins; 6843 del; 5676 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From mbaesken at openjdk.org Thu Oct 10 07:24:15 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Thu, 10 Oct 2024 07:24:15 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> Message-ID: On Wed, 9 Oct 2024 11:44:35 GMT, Matthias Baesken wrote: >> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. >> Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . > > Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: > > adjust gcc warning settings; bring back rslt Thanks for the reviews and suggestions ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21407#issuecomment-2404260346 From mbaesken at openjdk.org Thu Oct 10 07:24:16 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Thu, 10 Oct 2024 07:24:16 GMT Subject: Integrated: 8341722: Fix some warnings as errors when building on Linux with toolchain clang In-Reply-To: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> Message-ID: On Tue, 8 Oct 2024 13:38:54 GMT, Matthias Baesken wrote: > There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. > Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . This pull request has now been integrated. Changeset: e7c5bf45 Author: Matthias Baesken URL: https://git.openjdk.org/jdk/commit/e7c5bf45f753ad6459c666a4dd4a31197b69e05e Stats: 12 lines in 5 files changed: 1 ins; 8 del; 3 mod 8341722: Fix some warnings as errors when building on Linux with toolchain clang Reviewed-by: cjplummer, lucy ------------- PR: https://git.openjdk.org/jdk/pull/21407 From kevinw at openjdk.org Thu Oct 10 08:12:11 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 10 Oct 2024 08:12:11 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 20:36:07 GMT, Chris Plummer wrote: >> DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. >> e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". > > test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java line 133: > >> 131: >> 132: // Knowledge of the types made public by com.sun.management.internal.DiagnosticCommandImpl >> 133: private static final String [] publicTypes = new String [] { "INT", "STRING", "BOOLEAN", "STRING SET", "MEMORY SIZE", "NANOTIME" }; > > These type are "implementation dependent", yet we are referring to them as public types. Also, these "public types" are now in two different places. If they were public, only one copy should be needed. Maybe we just need better terminology since they are not actually public, but just happen to be the types the implementation is know to return...err, I guess you could say the leak out to the "public". Sigh. IDK. I guess I just feel we could do a better job in how we refer to these types in the code. Right, public as in the type names which are observable by applications/users, not as in Java type terminology. Comment could be: // Knowledge of the implementation-dependent types in DiagnosticCommandImpl, seen by applications/users // (see the DiagnosticCommandMBean Descriptor, field "dcmd.arg.type"). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21040#discussion_r1794931004 From kevinw at openjdk.org Thu Oct 10 08:51:38 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 10 Oct 2024 08:51:38 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v2] In-Reply-To: References: Message-ID: > DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. > e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". Kevin Walls 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 four additional commits since the last revision: - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types - Update comment about type name knowledge - Test update - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21040/files - new: https://git.openjdk.org/jdk/pull/21040/files/aa22301c..fabcaebe Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21040&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21040&range=00-01 Stats: 198321 lines in 1421 files changed: 184773 ins; 6839 del; 6709 mod Patch: https://git.openjdk.org/jdk/pull/21040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21040/head:pull/21040 PR: https://git.openjdk.org/jdk/pull/21040 From mbaesken at openjdk.org Thu Oct 10 09:02:25 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Thu, 10 Oct 2024 09:02:25 GMT Subject: RFR: 8341820: Check return value of hcreate_r Message-ID: In symtab.c there is some coding where hcreate_r is used. We should check the return value of the call (previously there was some guarantee checking the return value but uncommented). This has been discussed in the PR of [JDK-8341722](https://bugs.openjdk.org/browse/JDK-8341722) . ------------- Commit messages: - JDK-8341820 Changes: https://git.openjdk.org/jdk/pull/21445/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21445&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341820 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21445.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21445/head:pull/21445 PR: https://git.openjdk.org/jdk/pull/21445 From rcastanedalo at openjdk.org Thu Oct 10 10:03:33 2024 From: rcastanedalo at openjdk.org (Roberto =?UTF-8?B?Q2FzdGHDsWVkYQ==?= Lozano) Date: Thu, 10 Oct 2024 10:03:33 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v39] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 16:30:47 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Increase compiler code stubs size for indexOf intrinsic Thanks @rkennke and @tstuefe for patiently addressing my comments. I have reviewed the HotSpot compiler parts of this changeset, except those in `src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp` which should be reviewed by someone more familiar with the `indexOf` intrinsic implementation (@sviswa7 has suggested @vpaprotsk for this task). More specifically, my approval covers the following files/directories: src/hotspot/cpu/aarch64 (excluding interpreter-only changes) src/hotspot/cpu/x86 (excluding interpreter-only and c2_stubGenerator_x86_64_string.cpp changes) src/hotspot/share/opto src/hotspot/share/ci src/hotspot/share/gc/{shared,x,z}/c2/{x,z}barrierSetC2.cpp test/hotspot/jtreg/compiler As I mentioned earlier, after the integration of this changeset and before compact headers can be considered non-experimental, I think C2's dependency on `klass_offset_in_bytes()` (when using compact headers) should be removed, and a more robust C2 model for klass pointer loading should be developed ([JDK-8340453](https://bugs.openjdk.org/browse/JDK-8340453)). ------------- Marked as reviewed by rcastanedalo (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2359713290 From sspitsyn at openjdk.org Thu Oct 10 10:29:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 10 Oct 2024 10:29:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 22:58:33 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run I've pushed two updates. The first one addresses the suggestions from Leonid: - minor tweaks in new test - moved skipping hidden methods `yield()` and `yield0()` from `check_and_skip_hidden_frames()` to a separate function - explained in a comment of `JvmtiHandshake::execute()` why all VTMS transitions are disabled for platform thread - added extra safety/stability checks and a couple of asserts around calls to `check_and_skip_hidden_frames()` Second update fixes one more `NotifyFramePop` issue with the frames at the virtual thread start: - `enter()`, `enter0`, `VThreadContinuation$1.run()` and `VirtualThread.run()` This the bottom of stack trace from debugger: 0: java/lang/VirtualThread: run(Ljava/lang/Runnable;)V 1: java/lang/VirtualThread$VThreadContinuation$1: run()V 2: jdk/internal/vm/Continuation: enter0()V 3: jdk/internal/vm/Continuation: enter(Ljdk/internal/vm/Continuation;Z)V The fix includes three parts: - the `notifyJvmtiStart()`/`notifyJvmtiEnd()` notification calls are moved from `VirtualThread.run()` to the `VThreadContinuation$1.run()` - the annotation `@JvmtiMountTransition` has been added to the `VThreadContinuation$1.run()` - the `NotifyFramePop` is changed to return `JVMTI_ERRO_OPAQUE_FRAME` for frames with `enter()` and methods annotated with `@JvmtiMountTransition` ------------- PR Comment: https://git.openjdk.org/jdk/pull/21397#issuecomment-2404706773 From aboldtch at openjdk.org Thu Oct 10 11:59:24 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Thu, 10 Oct 2024 11:59:24 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation [v2] In-Reply-To: References: Message-ID: > This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. > > For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. > > However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > synchronized(o) { > deoptimize(); > } > > got transformed to > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > // synchronized(o) { Eliminated lock > deoptimize(); > // } > > > As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. > After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision: Remove @test id ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21420/files - new: https://git.openjdk.org/jdk/pull/21420/files/e16bfde1..bfc5a349 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21420&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21420&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21420.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21420/head:pull/21420 PR: https://git.openjdk.org/jdk/pull/21420 From aboldtch at openjdk.org Thu Oct 10 11:59:25 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Thu, 10 Oct 2024 11:59:25 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation In-Reply-To: References: Message-ID: <6l_D0sSCB0e_iT4BvSHilqJGEQo4rE5hGD9_SHibSX8=.776ebc6c-fc2c-4770-a25f-f0a59e335a14@github.com> On Wed, 9 Oct 2024 11:16:46 GMT, Axel Boldt-Christmas wrote: > This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. > > For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. > > However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > synchronized(o) { > deoptimize(); > } > > got transformed to > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > // synchronized(o) { Eliminated lock > deoptimize(); > // } > > > As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. > After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. Ran through tier1-3 and stress tested escape analysis and lock elimination tests. Removed the `@test id=` as it gets propagated to the wrong place. The `@bug` is enough. I'll integrate after I've gotten a review / re-review on the test configuration change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21420#issuecomment-2404891138 From rkennke at openjdk.org Thu Oct 10 13:27:23 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 10 Oct 2024 13:27:23 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Tue, 8 Oct 2024 17:20:31 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: > > - Fix merge error > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 That is a big change - great work! In this first batch I've reviewed: src/hotspot/cpu src/hotspot/gc/shared src/hotspot/gc/shenandoah/c1 src/hotspot/gc/shenandoah/c2 src/hotspot/gc/shenandoah/heuristics src/hotspot/gc/shenandoah/mode I only have a few comments so far. Will review the remaining parts in separate batches. src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp line 75: > 73: > 74: // Create a mask to test if the marking bit is set. > 75: // TODO: can we directly test if bit is set? That comment here is quite justified, IMO. I'm pretty sure that we could test for the flag in a single instruction, instead of doing the and-cmp sequence and even allocating a new register. Unless of course when C1 LIR can't represent it. Have you tried to implement that and failed, and therefore remove the comment? src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 96: > 94: size_t capacity = _space_info->soft_max_capacity(); > 95: size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste); > 96: size_t free_target = (capacity * ShenandoahMinFreeThreshold) / 100 + max_cset; Does re-arranging the math here risk overflow (e.g. on 32-bit)? src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp line 79: > 77: > 78: protected: > 79: static const uint Moving_Average_Samples = 10; // Number of samples to store in moving averages I've never seen that style for constants in HotSpot before. I'd either make it MOVING_AVERAGE_SAMPLES or MovingAverageSamples. I think the latter is more prevalent, but I am not certain. ------------- Changes requested by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21273#pullrequestreview-2360208858 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795359413 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795377554 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795401675 From rkennke at openjdk.org Thu Oct 10 13:27:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 10 Oct 2024 13:27:24 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Thu, 10 Oct 2024 13:13:14 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp line 79: > >> 77: >> 78: protected: >> 79: static const uint Moving_Average_Samples = 10; // Number of samples to store in moving averages > > I've never seen that style for constants in HotSpot before. I'd either make it MOVING_AVERAGE_SAMPLES or MovingAverageSamples. I think the latter is more prevalent, but I am not certain. Oh but I see that it's used in this source file. Hmm... So maybe stick with it for now and make a follow-up change? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795404177 From pchilanomate at openjdk.org Thu Oct 10 13:37:10 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 10 Oct 2024 13:37:10 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 11:59:24 GMT, Axel Boldt-Christmas wrote: >> This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). >> >> When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). >> >> I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. >> >> For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. >> >> However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. >> >> Object o = new Object(); >> synchronized(o) { >> o.wait(1); >> } >> synchronized(o) { >> deoptimize(); >> } >> >> got transformed to >> >> Object o = new Object(); >> synchronized(o) { >> o.wait(1); >> } >> // synchronized(o) { Eliminated lock >> deoptimize(); >> // } >> >> >> As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. >> After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. > > Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision: > > Remove @test id Marked as reviewed by pchilanomate (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21420#pullrequestreview-2360354550 From rsunderbabu at openjdk.org Thu Oct 10 14:27:08 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Thu, 10 Oct 2024 14:27:08 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support [v2] In-Reply-To: References: Message-ID: > The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". > > Positive Testing: > tier1,tier2,tier3 - to check stability > tier5 - to run container tests > > Negative Testing: > Ran the following groups in hosts where container is not present. > open/test/hotspot/jtreg/containers/ > open/test/jdk/jdk/internal/platform/docker/ > open/test/jdk/jdk/internal/platform/cgroup/ Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: addressing review comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21423/files - new: https://git.openjdk.org/jdk/pull/21423/files/75001218..3e36b519 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21423&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21423&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21423.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21423/head:pull/21423 PR: https://git.openjdk.org/jdk/pull/21423 From sgehwolf at openjdk.org Thu Oct 10 15:41:14 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Thu, 10 Oct 2024 15:41:14 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 14:27:08 GMT, Ramkumar Sunderbabu wrote: >> The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". >> >> Positive Testing: >> tier1,tier2,tier3 - to check stability >> tier5 - to run container tests >> >> Negative Testing: >> Ran the following groups in hosts where container is not present. >> open/test/hotspot/jtreg/containers/ >> open/test/jdk/jdk/internal/platform/docker/ >> open/test/jdk/jdk/internal/platform/cgroup/ > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > addressing review comment Marked as reviewed by sgehwolf (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21423#pullrequestreview-2360759661 From aboldtch at openjdk.org Thu Oct 10 17:06:16 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Thu, 10 Oct 2024 17:06:16 GMT Subject: RFR: 8341819: LightweightSynchronizer::enter_for races with deflation [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 11:59:24 GMT, Axel Boldt-Christmas wrote: >> This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). >> >> When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). >> >> I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. >> >> For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. >> >> However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. >> >> Object o = new Object(); >> synchronized(o) { >> o.wait(1); >> } >> synchronized(o) { >> deoptimize(); >> } >> >> got transformed to >> >> Object o = new Object(); >> synchronized(o) { >> o.wait(1); >> } >> // synchronized(o) { Eliminated lock >> deoptimize(); >> // } >> >> >> As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. >> After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. > > Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision: > > Remove @test id Thanks for the reviews. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21420#issuecomment-2405626337 From aboldtch at openjdk.org Thu Oct 10 17:06:17 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Thu, 10 Oct 2024 17:06:17 GMT Subject: Integrated: 8341819: LightweightSynchronizer::enter_for races with deflation In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 11:16:46 GMT, Axel Boldt-Christmas wrote: > This is a regression from [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > When using `+UseObjectMonitorTable` monitors are inflated in a locked state effectively blocking out deflation. `LightweightSynchronizer::enter_for` assumed this to be true. But when the `-UseObjectMonitorTable` path was added `// Do the old inflate and enter.` this is no longer true as it first inflates a monitor in an unlocked state and then tries to lock. We need to introduce a retry loop similar to what was used before [JDK-8315884](https://bugs.openjdk.org/browse/JDK-8315884). > > I propose we add this retry loop for both cases, to decouple the `LightweightSynchronizer::enter_for` from how lock elimination is done. With a retry loop, the only requirements for using `LightweightSynchronizer::enter_for` is that the Object locked on cannot have been locked on by another thread, i.e. there is no contention, but makes no assumptions on the interaction with the deflation thread. > > For `-UseObjectMonitorTable` 7bdbe114eb57fe7310f9664a434c4d9203e656fc should be enough, as it will assist the deflating thread with deflation, so the second call must succeed. > > However `+UseObjectMonitorTable` cannot do this so it must wait for the deflating thread to make progress. But as mentioned above, this would only happen if partial lock elimination is performed. E.g. > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > synchronized(o) { > deoptimize(); > } > > got transformed to > > Object o = new Object(); > synchronized(o) { > o.wait(1); > } > // synchronized(o) { Eliminated lock > deoptimize(); > // } > > > As far as I can tell, this does not happen. But I do not want to couple lock elimination decision with `LightweightSynchronizer::enter_for`. So I propose a retry loop instead of just the two calls. > After this change the only prerequisite for using `LightweightSynchronizer::enter_for` is that the object being synchronized can not have been reached by another JavaThread (except the deflating thread). So there may never be contention, but there may be deflation. This pull request has now been integrated. Changeset: 6fad6af0 Author: Axel Boldt-Christmas URL: https://git.openjdk.org/jdk/commit/6fad6af0de5e749aa60038d70ae196b5f666286f Stats: 18 lines in 2 files changed: 16 ins; 0 del; 2 mod 8341819: LightweightSynchronizer::enter_for races with deflation Reviewed-by: pchilanomate, rkennke ------------- PR: https://git.openjdk.org/jdk/pull/21420 From duke at openjdk.org Thu Oct 10 18:38:13 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Thu, 10 Oct 2024 18:38:13 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 19:45:24 GMT, Kevin Walls wrote: >> Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: >> >> Have EventGeneratorLoop end after a more predictable duration > > Yes OEL was Oracle Linux: > > Our CI tests with docker run on Oracle Linux 7, and they fail with elevated-true (i.e. with "--cap-add=NET_BIND_SERVICE"). > > Our CI runs with Oracle Linux 8 use podman and they are OK using "--cap-add=NET_BIND_SERVICE" @kevinjwalls do you know which Docker version your OEL 7 tests use? I'm not very familiar with the RPM-based world, but I set up an OEL 7 VM, got Docker 18.09 installed and trying to reproduce the test failure now. Just wondering if your CI uses the same one. # yum list installed | grep docker-engine docker-engine.x86_64 18.09.1.ol-1.0.3.el7 @ol7_developer ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2405791086 From rkennke at openjdk.org Thu Oct 10 19:27:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 10 Oct 2024 19:27:24 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Tue, 8 Oct 2024 17:20:31 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: > > - Fix merge error > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 And here comes the first part of `src/hotspot/share/gc/shenandoah` review. src/hotspot/share/gc/shenandoah/shenandoahAffiliation.hpp line 44: > 42: default: > 43: ShouldNotReachHere(); > 44: return "?"; This return is unreachable code (according to my IDE) src/hotspot/share/gc/shenandoah/shenandoahAffiliation.hpp line 58: > 56: default: > 57: ShouldNotReachHere(); > 58: return "?"; Same. src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 40: > 38: DIRTY_SCAN_OBJS = 6, > 39: ALTERNATIONS = 7, > 40: MAX_CARD_STAT_TYPE = 8 Are the numerical values relevant or what is the reason to spell them out? src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 46: > 44: CARD_STAT_SCAN_RS = 0, > 45: CARD_STAT_UPDATE_REFS = 1, > 46: MAX_CARD_STAT_LOG_TYPE = 2 Same here? src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 676: > 674: case ShenandoahAllocRequest::_alloc_shared_gc: { > 675: // Fast-path: try to allocate in the collector view first > 676: idx_t leftmost_collector = _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector); 1. The curly bracing that starts at _alloc_plab and then again at _alloc_shared_gc is really really weird. 2. The block that is enclosed by the curly braces is really huge for a switch-case. It probably looks better if the code can be factored out into a method and be called from the switch cases? I'm not sure if this is easy to do, because there are some returns and breaks sprinkled in the block, too. But this only makes it worse. ------------- Changes requested by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21273#pullrequestreview-2361030955 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795859909 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795860226 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795888252 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795888425 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1795936007 From cjplummer at openjdk.org Thu Oct 10 20:02:09 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 10 Oct 2024 20:02:09 GMT Subject: RFR: 8341820: Check return value of hcreate_r In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:57:44 GMT, Matthias Baesken wrote: > In symtab.c there is some coding where hcreate_r is used. We should check the return value of the call (previously there was some guarantee checking the return value but uncommented). > > This has been discussed in the PR of [JDK-8341722](https://bugs.openjdk.org/browse/JDK-8341722) . Looks good. Thanks for the cleanup. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21445#pullrequestreview-2361286987 From jlu at openjdk.org Thu Oct 10 22:00:45 2024 From: jlu at openjdk.org (Justin Lu) Date: Thu, 10 Oct 2024 22:00:45 GMT Subject: RFR: 8341794: Fix ExceptionOccurred in jdk.attach Message-ID: Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.attach_. This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. JNI Docs - ExceptionCheck > We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. ------------- Commit messages: - init Changes: https://git.openjdk.org/jdk/pull/21459/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21459&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341794 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21459.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21459/head:pull/21459 PR: https://git.openjdk.org/jdk/pull/21459 From jlu at openjdk.org Thu Oct 10 22:01:22 2024 From: jlu at openjdk.org (Justin Lu) Date: Thu, 10 Oct 2024 22:01:22 GMT Subject: RFR: 8341797: Fix ExceptionOccurred in jdk.jdi Message-ID: Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.jdi_. This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. JNI Docs - ExceptionCheck > We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. ------------- Commit messages: - init Changes: https://git.openjdk.org/jdk/pull/21460/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21460&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341797 Stats: 11 lines in 2 files changed: 0 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/21460.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21460/head:pull/21460 PR: https://git.openjdk.org/jdk/pull/21460 From mseledtsov at openjdk.org Thu Oct 10 22:49:10 2024 From: mseledtsov at openjdk.org (Mikhailo Seledtsov) Date: Thu, 10 Oct 2024 22:49:10 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support [v2] In-Reply-To: References: Message-ID: <7qtN24O68lFXKIhmUZD4iCEn_NE9OcEPdL2Cn7iWITE=.3378efdd-d54c-4df5-b9e3-5114c9495930@github.com> On Thu, 10 Oct 2024 14:27:08 GMT, Ramkumar Sunderbabu wrote: >> The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". >> >> Positive Testing: >> tier1,tier2,tier3 - to check stability >> tier5 - to run container tests >> >> Negative Testing: >> Ran the following groups in hosts where container is not present. >> open/test/hotspot/jtreg/containers/ >> open/test/jdk/jdk/internal/platform/docker/ >> open/test/jdk/jdk/internal/platform/cgroup/ > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > addressing review comment Marked as reviewed by mseledtsov (Committer). Changes look good to me. Thank you for making these changes. ------------- PR Review: https://git.openjdk.org/jdk/pull/21423#pullrequestreview-2361544516 PR Comment: https://git.openjdk.org/jdk/pull/21423#issuecomment-2406168566 From amenkov at openjdk.org Fri Oct 11 00:26:09 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Fri, 11 Oct 2024 00:26:09 GMT Subject: RFR: 8341794: Fix ExceptionOccurred in jdk.attach In-Reply-To: References: Message-ID: <-QGX3gDEa03o9FW936OO1AzYZPVDH9al0UWV93S8Dqk=.6d93d4e0-bfb1-44b7-bb4f-ba3e06136538@github.com> On Thu, 10 Oct 2024 21:55:37 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.attach_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21459#pullrequestreview-2361673051 From amenkov at openjdk.org Fri Oct 11 00:32:10 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Fri, 11 Oct 2024 00:32:10 GMT Subject: RFR: 8341797: Fix ExceptionOccurred in jdk.jdi In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 21:56:39 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.jdi_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21460#pullrequestreview-2361685169 From duke at openjdk.org Fri Oct 11 00:50:09 2024 From: duke at openjdk.org (duke) Date: Fri, 11 Oct 2024 00:50:09 GMT Subject: RFR: 8341138: Rename jtreg property docker.support as container.support [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 14:27:08 GMT, Ramkumar Sunderbabu wrote: >> The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". >> >> Positive Testing: >> tier1,tier2,tier3 - to check stability >> tier5 - to run container tests >> >> Negative Testing: >> Ran the following groups in hosts where container is not present. >> open/test/hotspot/jtreg/containers/ >> open/test/jdk/jdk/internal/platform/docker/ >> open/test/jdk/jdk/internal/platform/cgroup/ > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > addressing review comment @rsunderbabu Your change (at version 3e36b519be6dfed513fbe867e3ec0f03e061eaa1) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21423#issuecomment-2406315737 From cjplummer at openjdk.org Fri Oct 11 03:49:09 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 11 Oct 2024 03:49:09 GMT Subject: RFR: 8341794: Fix ExceptionOccurred in jdk.attach In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 21:55:37 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.attach_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21459#pullrequestreview-2361906968 From cjplummer at openjdk.org Fri Oct 11 03:50:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 11 Oct 2024 03:50:10 GMT Subject: RFR: 8341797: Fix ExceptionOccurred in jdk.jdi In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 21:56:39 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.jdi_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21460#pullrequestreview-2361907548 From kbarrett at openjdk.org Fri Oct 11 03:59:13 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Fri, 11 Oct 2024 03:59:13 GMT Subject: RFR: 8341722: Fix some warnings as errors when building on Linux with toolchain clang [v2] In-Reply-To: <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> References: <7Ku9Im8ezr8pe8kNAqFBuJ2psZ7ZpYxB15icbON7-l4=.b30ffe03-1b45-41e4-a0f7-05141baf6cb1@github.com> <_xv74pf2blc3P7IPtDVOO7oDbH6rIZRh406FXP_cjZc=.5385eca4-86ff-4fae-be7c-59826dcfe305@github.com> Message-ID: On Wed, 9 Oct 2024 11:44:35 GMT, Matthias Baesken wrote: >> There are a few warnings as errors occurring when building on Linux with clang (clang15). Mostly these are some kind of 'unused' warnings. >> Might be related to https://bugs.openjdk.org/browse/JDK-8339156 . > > Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: > > adjust gcc warning settings; bring back rslt test/hotspot/gtest/runtime/test_os_linux.cpp line 366: > 364: os::pretouch_memory(heap, heap + size, os::vm_page_size()); > 365: }; > 366: auto useMemory = [heap](Thread*, int) { Coming to this late, after the change has been integrated. These lambdas should have been changed to use implicit reference capture (`[&]`), per the style guide. The change to the pretouch lambda actually makes things more difficult to understand, since the outer `size` variable *is* referenced within the lambda body. This works because `size` is an integral constant initialized from a constant expression, so does not need to be captured for the reference to work. I'm guessing the clang warning had something to do with that, but it's not mentioned in the JBS issue. If implicit reference capture were used, the referential transparency that comes with it would mean readers wouldn't need to even know about that distinction. I'll file an issue to change the capture lists. I didn't find any other explicit capture lists in HotSpot code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21407#discussion_r1796392834 From cjplummer at openjdk.org Fri Oct 11 04:22:12 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 11 Oct 2024 04:22:12 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:51:38 GMT, Kevin Walls wrote: >> DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. >> e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". > > Kevin Walls 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 four additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types > - Update comment about type name knowledge > - Test update > - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21040#pullrequestreview-2361929093 From aboldtch at openjdk.org Fri Oct 11 06:43:33 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Fri, 11 Oct 2024 06:43:33 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v3] In-Reply-To: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> Message-ID: > This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) Axel Boldt-Christmas 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 12 additional commits since the last revision: - Merge tag 'jdk-24+19' into JDK-8341692 Added tag jdk-24+19 for changeset e7c5bf45 - LargeWindowPaintTest.java fix id typo - Fix problem-listed @requires typo - Fix @requires !vm.gc.Z, must use vm.gc != "Z" - Reorder z_globals options: product > diagnostic product > develop - Consistent albite special code style - Consistent order between ZArguments and GCArguments - Remove XCollectedHeap from HSDB - Fix typo in TestZUncommitEvent.java - Add missing problem-listing - ... and 2 more: https://git.openjdk.org/jdk/compare/63794f5e...e58b4c5a ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21401/files - new: https://git.openjdk.org/jdk/pull/21401/files/22c243a6..e58b4c5a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=01-02 Stats: 6773 lines in 133 files changed: 5327 ins; 455 del; 991 mod Patch: https://git.openjdk.org/jdk/pull/21401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21401/head:pull/21401 PR: https://git.openjdk.org/jdk/pull/21401 From mbaesken at openjdk.org Fri Oct 11 07:53:12 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Fri, 11 Oct 2024 07:53:12 GMT Subject: RFR: 8336401: Remove the option onjcmd from the jdwp agent [v2] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 06:58:13 GMT, Johannes Bechberger wrote: >> Remove the support for on-demand debugging via the onjcmd option. > > Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: > > Use port 0 in TestAgentEvent Thanks for doing the change + CSR, looks good! ------------- Marked as reviewed by mbaesken (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21387#pullrequestreview-2362178355 From lucy at openjdk.org Fri Oct 11 08:13:11 2024 From: lucy at openjdk.org (Lutz Schmidt) Date: Fri, 11 Oct 2024 08:13:11 GMT Subject: RFR: 8341820: Check return value of hcreate_r In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:57:44 GMT, Matthias Baesken wrote: > In symtab.c there is some coding where hcreate_r is used. We should check the return value of the call (previously there was some guarantee checking the return value but uncommented). > > This has been discussed in the PR of [JDK-8341722](https://bugs.openjdk.org/browse/JDK-8341722) . LGTM. ------------- Marked as reviewed by lucy (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21445#pullrequestreview-2362219032 From mbaesken at openjdk.org Fri Oct 11 08:25:17 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Fri, 11 Oct 2024 08:25:17 GMT Subject: RFR: 8341820: Check return value of hcreate_r In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:57:44 GMT, Matthias Baesken wrote: > In symtab.c there is some coding where hcreate_r is used. We should check the return value of the call (previously there was some guarantee checking the return value but uncommented). > > This has been discussed in the PR of [JDK-8341722](https://bugs.openjdk.org/browse/JDK-8341722) . Hi Lutz and Chris, thanks for the reviews ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21445#issuecomment-2406886245 From mbaesken at openjdk.org Fri Oct 11 08:25:17 2024 From: mbaesken at openjdk.org (Matthias Baesken) Date: Fri, 11 Oct 2024 08:25:17 GMT Subject: Integrated: 8341820: Check return value of hcreate_r In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:57:44 GMT, Matthias Baesken wrote: > In symtab.c there is some coding where hcreate_r is used. We should check the return value of the call (previously there was some guarantee checking the return value but uncommented). > > This has been discussed in the PR of [JDK-8341722](https://bugs.openjdk.org/browse/JDK-8341722) . This pull request has now been integrated. Changeset: 7c0dbf8e Author: Matthias Baesken URL: https://git.openjdk.org/jdk/commit/7c0dbf8e9c69d51aa8e06305e4483002116019f4 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod 8341820: Check return value of hcreate_r Reviewed-by: cjplummer, lucy ------------- PR: https://git.openjdk.org/jdk/pull/21445 From duke at openjdk.org Fri Oct 11 08:40:10 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Fri, 11 Oct 2024 08:40:10 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration I had to change SELinux to permissive to get the Docker tests to work at all in the OEL 7 VM (and bind-mounting to work in general for Docker containers). Maybe there are ways to give just the right permissions. # grep ^SELINUX= /etc/sysconfig/selinux SELINUX=permissive How is SELinux configured in your CI? I would not be surprised if it's related to that, but as it stands, I have not been able to reproduce any failure in my VM. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21331#issuecomment-2406915951 From sspitsyn at openjdk.org Fri Oct 11 09:18:23 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 11 Oct 2024 09:18:23 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning Message-ID: There is a race between JVMTI NotifyFramePop function and FramePop event posting code. The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. Testing: - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` - TBD: mach5 tiers 1-6 ------------- Commit messages: - fixed trailing spaces in new test - 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning Changes: https://git.openjdk.org/jdk/pull/21468/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8340698 Stats: 360 lines in 6 files changed: 360 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Fri Oct 11 09:26:42 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 11 Oct 2024 09:26:42 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: minor comment tweak ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/773b5d68..c68625be Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From rkennke at openjdk.org Fri Oct 11 12:28:18 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Fri, 11 Oct 2024 12:28:18 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Tue, 8 Oct 2024 17:20:31 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: > > - Fix merge error > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 I reviewed the rest of `src/hotspot/shared/gc/shenandoah`. I tried to find places where this could affect performance or even correctness of single-gen Shenandoah, but could not find any (altough, some places are a bit shady and hard to figure out, e.g. ShFreeSet). Overall I only have a couple of comments. src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 579: > 577: st->print("Status: "); > 578: if (has_forwarded_objects()) st->print("has forwarded objects, "); > 579: if (is_concurrent_mark_in_progress()) st->print("marking, "); What is this printing when not running with generational mode? src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 535: > 533: ShenandoahPacer* pacer() const { return _pacer; } > 534: > 535: ShenandoahPhaseTimings* phase_timings() const { return _phase_timings; } The indentation is off here. src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 335: > 333: uint ShenandoahHeap::get_object_age(oop obj) { > 334: // This is impossible to do unless we "freeze" ABA-type oscillations > 335: // With Lilliput, we can do this more easily. The comment about Lilliput can be removed. Since we only return the actual age when the mark is not displaced, we already to the correct thing. With lightweight-locking, the mark can never be displaced, and this code should just work. src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 396: > 394: } > 395: > 396: inline bool ShenandoahHeap::is_old(oop obj) const { What is the difference between this method and the above is_in_old()? Why does it need to check that active generation is young? src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.hpp line 28: > 26: #define SHARE_GC_SHENANDOAH_SHENANDOAHMMUTRACKER_HPP > 27: > 28: #include "runtime/mutex.hpp" I think you don't use Mutex in this file. ------------- Changes requested by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21273#pullrequestreview-2362458572 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796745606 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796795684 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796806016 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796807913 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796848150 From rkennke at openjdk.org Fri Oct 11 15:18:25 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Fri, 11 Oct 2024 15:18:25 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: <_1_RPbV4VVoczxDhQYp967iOM37EHh3ZcK5b8dvKrQU=.1b9556a6-81d3-428d-8593-bd4cdced44de@github.com> On Tue, 8 Oct 2024 17:20:31 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: > > - Fix merge error > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane > > Reviewed-by: kdnilsen > - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode > > Reviewed-by: kdnilsen, ysr > - Merge > - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle > > Reviewed-by: kdnilsen > - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation > > Reviewed-by: kdnilsen, shade, ysr > - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 I looked at the remaining changes, it's mostly tests. Only some minor comments/requests on those. test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java line 100: > 98: > 99: /* > 100: * @test id=generational You are making a test configuration and call it 'generational' but then one of the two run configurations doesn't actually run with generational mode. You probably want to separate the two? test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java line 163: > 161: final int min = 0; > 162: final int max = 384 * 1024; > 163: // Each allocated int array is assumed to consume 16 bytes for alignment and header, plus With the upcoming 'compact headers' it's going to be only 12 bytes. If that matters, then the actual number should perhaps be a constant? Preexisting and not relevant for this PR, though. test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java line 1: > 1: /* Why are you removing the test? test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java line 1: > 1: /* And this test? test/hotspot/jtreg/gc/shenandoah/oom/TestAllocOutOfMemory.java line 1: > 1: /* Or is this new test subsuming several old tests? ------------- Changes requested by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21273#pullrequestreview-2362848068 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796980759 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1796983485 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797098313 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797098581 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797099580 From wkemper at openjdk.org Fri Oct 11 21:11:25 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:11:25 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: <_1_RPbV4VVoczxDhQYp967iOM37EHh3ZcK5b8dvKrQU=.1b9556a6-81d3-428d-8593-bd4cdced44de@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> <_1_RPbV4VVoczxDhQYp967iOM37EHh3ZcK5b8dvKrQU=.1b9556a6-81d3-428d-8593-bd4cdced44de@github.com> Message-ID: On Fri, 11 Oct 2024 15:13:07 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > test/hotspot/jtreg/gc/shenandoah/oom/TestAllocOutOfMemory.java line 1: > >> 1: /* > > Or is this new test subsuming several old tests? Correct, we rolled the `TestAlloc` tests into one file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797425083 From wkemper at openjdk.org Fri Oct 11 21:17:28 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:17:28 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Thu, 10 Oct 2024 13:14:15 GMT, Roman Kennke wrote: >> src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp line 79: >> >>> 77: >>> 78: protected: >>> 79: static const uint Moving_Average_Samples = 10; // Number of samples to store in moving averages >> >> I've never seen that style for constants in HotSpot before. I'd either make it MOVING_AVERAGE_SAMPLES or MovingAverageSamples. I think the latter is more prevalent, but I am not certain. > > Oh but I see that it's used in this source file. Hmm... So maybe stick with it for now and make a follow-up change? Yes. I agree this is idiosyncratic formatting for the rest of HotSpot, but it is consistent with pre-existing constants in this file: static const intx Concurrent_Adjust = -1; // recover from penalties static const intx Degenerated_Penalty = 10; // how much to penalize average GC duration history on Degenerated GC static const intx Full_Penalty = 20; // how much to penalize average GC duration history on Full GC ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797428779 From wkemper at openjdk.org Fri Oct 11 21:20:37 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:20:37 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 10:14:31 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 579: > >> 577: st->print("Status: "); >> 578: if (has_forwarded_objects()) st->print("has forwarded objects, "); >> 579: if (is_concurrent_mark_in_progress()) st->print("marking, "); > > What is this printing when not running with generational mode? It will print "young marking". We can change this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797430904 From wkemper at openjdk.org Fri Oct 11 21:24:27 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:24:27 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 11:01:54 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 535: > >> 533: ShenandoahPacer* pacer() const { return _pacer; } >> 534: >> 535: ShenandoahPhaseTimings* phase_timings() const { return _phase_timings; } > > The indentation is off here. I'll fix this, but I secretly don't like this style of formatting because it is slightly tedious to maintain. It also suggests that these methods are somehow grouped and formatted together for a reason beyond aesthetics. > src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 396: > >> 394: } >> 395: >> 396: inline bool ShenandoahHeap::is_old(oop obj) const { > > What is the difference between this method and the above is_in_old()? Why does it need to check that active generation is young? This is just a bad, confusing method name. I'll fix this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797432875 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797433441 From jlu at openjdk.org Fri Oct 11 21:33:31 2024 From: jlu at openjdk.org (Justin Lu) Date: Fri, 11 Oct 2024 21:33:31 GMT Subject: Integrated: 8341794: Fix ExceptionOccurred in jdk.attach In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 21:55:37 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.attach_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. This pull request has now been integrated. Changeset: c4965d9b Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/c4965d9b135b58e0b3604bc1cc60978ad4c8c11b Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod 8341794: Fix ExceptionOccurred in jdk.attach Reviewed-by: amenkov, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/21459 From jlu at openjdk.org Fri Oct 11 21:35:25 2024 From: jlu at openjdk.org (Justin Lu) Date: Fri, 11 Oct 2024 21:35:25 GMT Subject: Integrated: 8341797: Fix ExceptionOccurred in jdk.jdi In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 21:56:39 GMT, Justin Lu wrote: > Please review this PR which is part of the bigger umbrella bug: https://bugs.openjdk.org/browse/JDK-8341542. > > This fixes incorrect usage of `jthrowable ExceptionOccurred(JNIEnv *env)` within _jdk.jdi_. > This corrects instances where the return value is being treated as a boolean. Such occurrences are replaced with `jboolean ExceptionCheck(JNIEnv *env)`. > > JNI Docs - ExceptionCheck >> We introduce a convenience function to check for pending exceptions without creating a local reference to the exception object. ... Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. This pull request has now been integrated. Changeset: 2db33971 Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/2db3397187563d1821d24578247f764c372fbb4b Stats: 11 lines in 2 files changed: 0 ins; 0 del; 11 mod 8341797: Fix ExceptionOccurred in jdk.jdi Reviewed-by: amenkov, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/21460 From wkemper at openjdk.org Fri Oct 11 21:36:27 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:36:27 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Thu, 10 Oct 2024 17:44:03 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/shenandoahAffiliation.hpp line 58: > >> 56: default: >> 57: ShouldNotReachHere(); >> 58: return "?"; > > Same. https://bugs.openjdk.org/browse/JDK-8341992 > src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 335: > >> 333: uint ShenandoahHeap::get_object_age(oop obj) { >> 334: // This is impossible to do unless we "freeze" ABA-type oscillations >> 335: // With Lilliput, we can do this more easily. > > The comment about Lilliput can be removed. Since we only return the actual age when the mark is not displaced, we already to the correct thing. With lightweight-locking, the mark can never be displaced, and this code should just work. https://bugs.openjdk.org/browse/JDK-8341992 > src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.hpp line 28: > >> 26: #define SHARE_GC_SHENANDOAH_SHENANDOAHMMUTRACKER_HPP >> 27: >> 28: #include "runtime/mutex.hpp" > > I think you don't use Mutex in this file. https://bugs.openjdk.org/browse/JDK-8341992 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797440111 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797439856 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797439708 From wkemper at openjdk.org Fri Oct 11 21:36:27 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 21:36:27 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 21:20:55 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 535: >> >>> 533: ShenandoahPacer* pacer() const { return _pacer; } >>> 534: >>> 535: ShenandoahPhaseTimings* phase_timings() const { return _phase_timings; } >> >> The indentation is off here. > > I'll fix this, but I secretly don't like this style of formatting because it is slightly tedious to maintain. It also suggests that these methods are somehow grouped and formatted together for a reason beyond aesthetics. https://bugs.openjdk.org/browse/JDK-8341992 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797439929 From wkemper at openjdk.org Fri Oct 11 22:03:26 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 22:03:26 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: <1tM_l9mquiouiroTulNDRfVposOwRRVmj18YD_WJU6I=.20e1a171-4438-417f-af58-18e2ed57d125@github.com> On Thu, 10 Oct 2024 12:48:05 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp line 75: > >> 73: >> 74: // Create a mask to test if the marking bit is set. >> 75: // TODO: can we directly test if bit is set? > > That comment here is quite justified, IMO. I'm pretty sure that we could test for the flag in a single instruction, instead of doing the and-cmp sequence and even allocating a new register. Unless of course when C1 LIR can't represent it. Have you tried to implement that and failed, and therefore remove the comment? @shipilev and I looked at this: https://github.com/openjdk/jdk/pull/19180#discussion_r1609666303. The performance change was insignificant. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797456666 From ysr at openjdk.org Fri Oct 11 22:17:28 2024 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Fri, 11 Oct 2024 22:17:28 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Thu, 10 Oct 2024 18:07:27 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 40: > >> 38: DIRTY_SCAN_OBJS = 6, >> 39: ALTERNATIONS = 7, >> 40: MAX_CARD_STAT_TYPE = 8 > > Are the numerical values relevant or what is the reason to spell them out? Not needed; explicit enumeration values can be removed. > src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 46: > >> 44: CARD_STAT_SCAN_RS = 0, >> 45: CARD_STAT_UPDATE_REFS = 1, >> 46: MAX_CARD_STAT_LOG_TYPE = 2 > > Same here? Yes, same; explicit enumeration values can be removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797462093 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797462886 From cjplummer at openjdk.org Fri Oct 11 23:16:20 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 11 Oct 2024 23:16:20 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v3] In-Reply-To: References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> Message-ID: On Fri, 11 Oct 2024 06:43:33 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas 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 12 additional commits since the last revision: > > - Merge tag 'jdk-24+19' into JDK-8341692 > > Added tag jdk-24+19 for changeset e7c5bf45 > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments > - Remove XCollectedHeap from HSDB > - Fix typo in TestZUncommitEvent.java > - Add missing problem-listing > - ... and 2 more: https://git.openjdk.org/jdk/compare/df0ae672...e58b4c5a The serviceability related changes look good. I suppose the 6 or so SA bugs filed against the non-generational ZGC can be closed out. I have a note to myself to go through them and close if appropriate. We have [JDK-8307393](https://bugs.openjdk.org/browse/JDK-8307393) filed for the lack of SA support for generational ZGC, and that is probably the only SA ZGC related issue we need to keep around. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2363665123 From wkemper at openjdk.org Fri Oct 11 23:34:32 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 11 Oct 2024 23:34:32 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: <9VnBxOMfOYEdW6nHhKxSvAtURKeC3a8GfpVPo-g7cr8=.dffb958c-a71d-4fd5-9319-eabff1f6c2f9@github.com> On Thu, 10 Oct 2024 18:47:38 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 676: > >> 674: case ShenandoahAllocRequest::_alloc_shared_gc: { >> 675: // Fast-path: try to allocate in the collector view first >> 676: idx_t leftmost_collector = _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector); > > 1. The curly bracing that starts at _alloc_plab and then again at _alloc_shared_gc is really really weird. > 2. The block that is enclosed by the curly braces is really huge for a switch-case. > It probably looks better if the code can be factored out into a method and be called from the switch cases? I'm not sure if this is easy to do, because there are some returns and breaks sprinkled in the block, too. But this only makes it worse. https://bugs.openjdk.org/browse/JDK-8342001 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1797493799 From duke at openjdk.org Sat Oct 12 02:48:25 2024 From: duke at openjdk.org (duke) Date: Sat, 12 Oct 2024 02:48:25 GMT Subject: Withdrawn: 8328866: Add raw monitor rank support to the debug agent In-Reply-To: <93YjmODwCGoXcsJIoNu3Ot5ckIegnS0pmhmavIAHNhQ=.69c012c0-584d-42d1-b469-5aa36cd7252e@github.com> References: <93YjmODwCGoXcsJIoNu3Ot5ckIegnS0pmhmavIAHNhQ=.69c012c0-584d-42d1-b469-5aa36cd7252e@github.com> Message-ID: On Wed, 1 May 2024 21:32:46 GMT, Chris Plummer wrote: > This PR adds ranked monitor support to the debug agent. The debug agent has a large number of monitors, and it's really hard to know which order to grab them in, and for that matter which monitors might already be held at any given moment. By imposing a rank on each monitor, we can check to make sure they are always grabbed in the order of their rank. Having this in place when I was working on [JDK-8324868](https://bugs.openjdk.org/browse/JDK-8324868) would have made it much easier to detect a deadlock that was occuring, and the reason for it. That's what motivated me to do this work > > There were 2 or 3 minor rank issues discovered as a result of these changes. I also learned a lot about some of the more ugly details of the locking support in the process. > > Tested with the following on all supported platforms and with virtual threads: > > com/sun/jdi > vmTestbase/nsk/jdi > vmTestbase/nsk/jdb > vmTestbase/nsk/jdwp > > Still need to run tier2 and tier5. > > Details of the changes follow in the first comment. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/19044 From rsunderbabu at openjdk.org Sat Oct 12 03:28:17 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Sat, 12 Oct 2024 03:28:17 GMT Subject: Integrated: 8341138: Rename jtreg property docker.support as container.support In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 14:50:30 GMT, Ramkumar Sunderbabu wrote: > The System property "docker.support" defined in VMProps gives a wrong impression that it is tied to docker alone. The property is common for any container runtime. Hence, it needs to be renamed as "container.support". > > Positive Testing: > tier1,tier2,tier3 - to check stability > tier5 - to run container tests > > Negative Testing: > Ran the following groups in hosts where container is not present. > open/test/hotspot/jtreg/containers/ > open/test/jdk/jdk/internal/platform/docker/ > open/test/jdk/jdk/internal/platform/cgroup/ This pull request has now been integrated. Changeset: 41ee582d Author: Ramkumar Sunderbabu Committer: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/41ee582df8c65f2f26b21e46784cf0bc4ece0585 Stats: 54 lines in 26 files changed: 6 ins; 0 del; 48 mod 8341138: Rename jtreg property docker.support as container.support Reviewed-by: sgehwolf, mseledtsov ------------- PR: https://git.openjdk.org/jdk/pull/21423 From sspitsyn at openjdk.org Sat Oct 12 11:09:17 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Sat, 12 Oct 2024 11:09:17 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows In-Reply-To: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: <51lZUKmNd7ohM7HvCR4NbAc2rYFn96n9ToHcQYORNuw=.e8f916cc-41d7-412d-b769-ec0efd520e8f@github.com> On Fri, 30 Aug 2024 00:07:50 GMT, Alex Menkov wrote: > The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. > More detailed explanations on the 1st comment. > > Testing: tier1,tier2,tier3,tier4,hs-tier5-svc > manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. This is nice fix, thank you for doing this! I still need one more pass on the Windows `AttachListener` part and hope to complete it early next week. src/hotspot/share/services/attachListener.cpp line 649: > 647: > 648: return true; > 649: } Nit: This function is too big. I'd suggest to split it to make more readable. For example, the lines 596-648 can be moved to new function which is called by the `AttachOperation::read_request()'. src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java line 46: > 44: > 45: private volatile long hProcess; // handle to the process > 46: private int ver = VERSION_1; // updated by detectVersion on attach Nit: The comment is not fully accurate as the result returned by the `detectVersion()` is stored in this private field by the `VirtualMachineImpl` constructor. ------------- PR Review: https://git.openjdk.org/jdk/pull/20782#pullrequestreview-2363889264 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1797683041 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1797678822 From stooke at openjdk.org Sat Oct 12 17:31:49 2024 From: stooke at openjdk.org (Simon Tooke) Date: Sat, 12 Oct 2024 17:31:49 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v18] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: odd github behaviour ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/9fe1466b..673269c9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=17 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=16-17 Stats: 6 lines in 1 file changed: 6 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From azafari at openjdk.org Sat Oct 12 18:45:14 2024 From: azafari at openjdk.org (Afshin Zafari) Date: Sat, 12 Oct 2024 18:45:14 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: On Wed, 2 Oct 2024 13:28:13 GMT, Robert Toyonaga wrote: >> ### Summary >> This PR just replaces `ThreadCritical` with a lock specific to NMT. `ThreadCritical` is a big lock and is unnecessary for the purposes of NMT. I've implemented the new lock with a semaphore so that it can be used early before VM init. There is also the possibility of adding assertions in places we expect NMT to have synchronization. I haven't added assertions yet in many places because some code paths such as the (NMT tests) don't lock yet. I think it makes sense to close any gaps in locking in another PR in which I can also add more assertions. >> >> Testing: >> - hotspot_nmt >> - gtest:VirtualSpace >> - tier1 > > Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: > > Update src/hotspot/share/utilities/vmError.cpp > > Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> Just an important test or comparison is needed here. Do you have any comparison of the performance before and after this PR change set? Even if no degrading is expected, better to test it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20852#issuecomment-2408656738 From stooke at openjdk.org Sun Oct 13 06:09:52 2024 From: stooke at openjdk.org (Simon Tooke) Date: Sun, 13 Oct 2024 06:09:52 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v19] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: spelling mistake ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/673269c9..b1893035 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=18 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=17-18 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From stooke at openjdk.org Sun Oct 13 15:38:49 2024 From: stooke at openjdk.org (Simon Tooke) Date: Sun, 13 Oct 2024 15:38:49 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: clean up test code ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/b1893035..b7e6043f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=19 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=18-19 Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From iklam at openjdk.org Mon Oct 14 06:30:55 2024 From: iklam at openjdk.org (Ioi Lam) Date: Mon, 14 Oct 2024 06:30:55 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v14] In-Reply-To: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: > This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). > > **Overview** > > - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. > - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. > - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. > - The boot classes are loaded as part of `vmClasses::resolve_all()` > - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). > - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. > > **All-or-nothing Loading** > > - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. > - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: > - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. > - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. > - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. > - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exact same set of modules are visible whe... Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Added more exclusions to hotspot_aot_classlinking test group, as these tests disable full-module-graph - Merge branch 'jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver' into jep-483-step-03-8329706-implement-xx-aot-class-linking - Merge branch 'jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver' into jep-483-step-03-8329706-implement-xx-aot-class-linking - Merge branch 'jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver' into jep-483-step-03-8329706-implement-xx-aot-class-linking - @dholmes-ora comments - @dholmes-ora comments - Fixed ZERO build - minor comment fix - @ashu-mehra comment: move code outside of call_initPhase2(); also renamed BOOT/BOOT2 to BOOT1/BOOT2 and refactored code related to AOTLinkedClassCategory - @ashu-mehra reviews - ... and 8 more: https://git.openjdk.org/jdk/compare/c068db8e...02ac6d6e ------------- Changes: https://git.openjdk.org/jdk/pull/20843/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=13 Stats: 1795 lines in 47 files changed: 1638 ins; 57 del; 100 mod Patch: https://git.openjdk.org/jdk/pull/20843.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20843/head:pull/20843 PR: https://git.openjdk.org/jdk/pull/20843 From iklam at openjdk.org Mon Oct 14 07:19:03 2024 From: iklam at openjdk.org (Ioi Lam) Date: Mon, 14 Oct 2024 07:19:03 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v15] In-Reply-To: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: <1ZXms0ZIxS7YIAqTp97N51dVk8iNpwuBm_zLPO6qqYw=.18911399-dfb8-4293-bba4-57e643561065@github.com> > This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). > > **Overview** > > - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. > - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. > - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. > - The boot classes are loaded as part of `vmClasses::resolve_all()` > - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). > - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. > > **All-or-nothing Loading** > > - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. > - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: > - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. > - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. > - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. > - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exact same set of modules are visible whe... Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: Missed one file from last commit ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20843/files - new: https://git.openjdk.org/jdk/pull/20843/files/02ac6d6e..22c47d33 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=13-14 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20843.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20843/head:pull/20843 PR: https://git.openjdk.org/jdk/pull/20843 From stooke at openjdk.org Mon Oct 14 10:34:15 2024 From: stooke at openjdk.org (Simon Tooke) Date: Mon, 14 Oct 2024 10:34:15 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v13] In-Reply-To: References: Message-ID: On Mon, 23 Sep 2024 02:13:33 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> delete commented out code > > Changes requested by dholmes (Reviewer). Hello, @dholmes-ora , could you please take another look? I've responded to your concerns about the macOS-specific tests, but I don't know if you feel my response is adequate. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20683#issuecomment-2410764298 From rkennke at openjdk.org Mon Oct 14 16:58:27 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 14 Oct 2024 16:58:27 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: <1tM_l9mquiouiroTulNDRfVposOwRRVmj18YD_WJU6I=.20e1a171-4438-417f-af58-18e2ed57d125@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> <1tM_l9mquiouiroTulNDRfVposOwRRVmj18YD_WJU6I=.20e1a171-4438-417f-af58-18e2ed57d125@github.com> Message-ID: On Fri, 11 Oct 2024 22:00:55 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp line 75: >> >>> 73: >>> 74: // Create a mask to test if the marking bit is set. >>> 75: // TODO: can we directly test if bit is set? >> >> That comment here is quite justified, IMO. I'm pretty sure that we could test for the flag in a single instruction, instead of doing the and-cmp sequence and even allocating a new register. Unless of course when C1 LIR can't represent it. Have you tried to implement that and failed, and therefore remove the comment? > > @shipilev and I looked at this: https://github.com/openjdk/jdk/pull/19180#discussion_r1609666303. The performance change was insignificant. ok. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1799832437 From mdoerr at openjdk.org Mon Oct 14 17:40:38 2024 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 14 Oct 2024 17:40:38 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v11] In-Reply-To: References: Message-ID: <9F4j9U7srQ_aLXdOairjcjGy9Rm-gO8MXPCrqz03iec=.00254e94-dbcc-49ce-a0de-3b72cd2e2b4e@github.com> On Tue, 1 Oct 2024 15:46:01 GMT, Roman Kennke wrote: >>> Indeed, I could re-enable all tests in: >>> >>> ``` >>> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java >>> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java >>> test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java >>> ``` >>> >>> but unfortunately not those others: >>> >>> ``` >>> > > > test/hotspot/jtreg/compiler/loopopts/superword/TestAlignVector.java >>> > > > test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java >>> ``` >>> >>> I think the issue with all of them is that vectorization in those scenarios only works when the operations inside the loop start at an array index that addresses an element at 8-byte-aligned offset. >>> >>> I have filed https://bugs.openjdk.org/browse/JDK-8340010 to track it. >> >> @rkennke A test run of the current changeset in our internal CI system revealed that the following tests fail (because of missing vectorization) when using `-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:UseSSE=N` with `N <= 3` on an Intel Xeon Platinum 8358 machine: >> >> - test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java >> - test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java >> - test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java >> >> Here are the failure details: >> >> >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: >> >> 1) Method "public static void compiler.c2.irTests.TestVectorizationNotRun.test(byte[],long[])" - [Failed IR rules: 1]: >> * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#V#LOAD_VECTOR_L#_", ">=1", "_#STORE_VECTOR#_", ">=1"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})" >> > Phase "PrintIdeal": >> - counts: Graph contains wrong number of nodes: >> * Constraint 1: "(\\d+(\\s){2}(LoadVector.*)+(\\s){2}===.*vector[A-Za-z]\[2\]:\{long\})" >> - Failed comparison: [found] 0 >= 1 [given] >> - No nodes matched! >> * Constraint 2: "(\\d+(\\s){2}(StoreVector.*)+(\\s){2}===.*)" >> - Failed comparison: [found] 0 >= 1 [given] >> - No nodes matched! >> >> >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java: >> >> 1) Method "public static void compiler.c2.irTests.TestVectorizati... > >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: > > I think I would disable the tests for now. Is there a good way to say 'run this when UCOH is off OR UseSSE>3? @rkennke: I have a PPC64 implementation: https://github.com/TheRealMDoerr/jdk/commit/6722f8be9a0940fab6417d4de58ec1538c436702 Do you want to include it? Should we also ask s390 and riscv folks? ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2411867295 From rkennke at openjdk.org Mon Oct 14 19:11:30 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 14 Oct 2024 19:11:30 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v11] In-Reply-To: References: Message-ID: On Tue, 1 Oct 2024 15:46:01 GMT, Roman Kennke wrote: >>> Indeed, I could re-enable all tests in: >>> >>> ``` >>> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java >>> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java >>> test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java >>> ``` >>> >>> but unfortunately not those others: >>> >>> ``` >>> > > > test/hotspot/jtreg/compiler/loopopts/superword/TestAlignVector.java >>> > > > test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java >>> ``` >>> >>> I think the issue with all of them is that vectorization in those scenarios only works when the operations inside the loop start at an array index that addresses an element at 8-byte-aligned offset. >>> >>> I have filed https://bugs.openjdk.org/browse/JDK-8340010 to track it. >> >> @rkennke A test run of the current changeset in our internal CI system revealed that the following tests fail (because of missing vectorization) when using `-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:UseSSE=N` with `N <= 3` on an Intel Xeon Platinum 8358 machine: >> >> - test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java >> - test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java >> - test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java >> >> Here are the failure details: >> >> >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: >> >> 1) Method "public static void compiler.c2.irTests.TestVectorizationNotRun.test(byte[],long[])" - [Failed IR rules: 1]: >> * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#V#LOAD_VECTOR_L#_", ">=1", "_#STORE_VECTOR#_", ">=1"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})" >> > Phase "PrintIdeal": >> - counts: Graph contains wrong number of nodes: >> * Constraint 1: "(\\d+(\\s){2}(LoadVector.*)+(\\s){2}===.*vector[A-Za-z]\[2\]:\{long\})" >> - Failed comparison: [found] 0 >= 1 [given] >> - No nodes matched! >> * Constraint 2: "(\\d+(\\s){2}(StoreVector.*)+(\\s){2}===.*)" >> - Failed comparison: [found] 0 >= 1 [given] >> - No nodes matched! >> >> >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java: >> >> 1) Method "public static void compiler.c2.irTests.TestVectorizati... > >> test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java: > > I think I would disable the tests for now. Is there a good way to say 'run this when UCOH is off OR UseSSE>3? > @rkennke: I have a PPC64 implementation: [TheRealMDoerr at 6722f8b](https://github.com/TheRealMDoerr/jdk/commit/6722f8be9a0940fab6417d4de58ec1538c436702) Do you want to include it? Should we also ask s390 and riscv folks? AFAIK, @Hamlin-Li is working on the RISCV port. Not sure who would do s390. If it's available before intergration, I'll include it, but I'll not wait for it. Thanks for the PPC64 port, I'll include it in this PR! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2412025660 From amenkov at openjdk.org Mon Oct 14 20:32:26 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Mon, 14 Oct 2024 20:32:26 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v2] In-Reply-To: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: > The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. > More detailed explanations on the 1st comment. > > Testing: tier1,tier2,tier3,tier4,hs-tier5-svc > manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: feedback ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20782/files - new: https://git.openjdk.org/jdk/pull/20782/files/fd52c130..2e904c58 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=00-01 Stats: 85 lines in 3 files changed: 45 ins; 33 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/20782.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20782/head:pull/20782 PR: https://git.openjdk.org/jdk/pull/20782 From amenkov at openjdk.org Mon Oct 14 20:32:26 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Mon, 14 Oct 2024 20:32:26 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v2] In-Reply-To: <51lZUKmNd7ohM7HvCR4NbAc2rYFn96n9ToHcQYORNuw=.e8f916cc-41d7-412d-b769-ec0efd520e8f@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> <51lZUKmNd7ohM7HvCR4NbAc2rYFn96n9ToHcQYORNuw=.e8f916cc-41d7-412d-b769-ec0efd520e8f@github.com> Message-ID: On Sat, 12 Oct 2024 11:04:25 GMT, Serguei Spitsyn wrote: >> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: >> >> feedback > > src/hotspot/share/services/attachListener.cpp line 649: > >> 647: >> 648: return true; >> 649: } > > Nit: This function is too big. I'd suggest to split it to make more readable. For example, the lines 596-648 can be moved to new function which is called by the `AttachOperation::read_request()'. Done > src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java line 46: > >> 44: >> 45: private volatile long hProcess; // handle to the process >> 46: private int ver = VERSION_1; // updated by detectVersion on attach > > Nit: The comment is not fully accurate as the result returned by the `detectVersion()` is stored in this private field by the `VirtualMachineImpl` constructor. Updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1800056341 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1800056007 From mdoerr at openjdk.org Mon Oct 14 21:49:28 2024 From: mdoerr at openjdk.org (Martin Doerr) Date: Mon, 14 Oct 2024 21:49:28 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v39] In-Reply-To: References: Message-ID: On Tue, 8 Oct 2024 16:30:47 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Increase compiler code stubs size for indexOf intrinsic Thanks! @offamitkumar: It could still be done after this PR is integrated, but I guess you want to provide an s390 implementation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2412394373 From amenkov at openjdk.org Tue Oct 15 00:21:41 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 15 Oct 2024 00:21:41 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v3] In-Reply-To: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: > The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. > More detailed explanations on the 1st comment. > > Testing: tier1,tier2,tier3,tier4,hs-tier5-svc > manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: renamed JVM_EnqueueOperation2 renamed JVM_EnqueueOperation2 to JVM_EnqueueOperation_v2 for consistency (per Serguei request) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20782/files - new: https://git.openjdk.org/jdk/pull/20782/files/2e904c58..1fed4ea6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=01-02 Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/20782.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20782/head:pull/20782 PR: https://git.openjdk.org/jdk/pull/20782 From duke at openjdk.org Tue Oct 15 01:25:22 2024 From: duke at openjdk.org (duke) Date: Tue, 15 Oct 2024 01:25:22 GMT Subject: Withdrawn: 8337276: jcmd man page update for PID in output filenames In-Reply-To: References: Message-ID: On Wed, 31 Jul 2024 08:30:47 GMT, Kevin Walls wrote: > Man page update for jcmd. > > Add updates for the filename options/arguments affected by: > 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID > > Also: > In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. > > In Description: > Each diagnostic command has its own set of options and arguments . > > Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. > > Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20401 From mli at openjdk.org Tue Oct 15 08:09:36 2024 From: mli at openjdk.org (Hamlin Li) Date: Tue, 15 Oct 2024 08:09:36 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v23] In-Reply-To: References: <0BrAbBTKmpqTGDrc--2znzO8t07yoqabwa6g2K05GHI=.d3c17fd5-4770-4623-8d2f-604816afc033@github.com> Message-ID: On Thu, 19 Sep 2024 15:01:26 GMT, Hamlin Li wrote: >> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge remote-tracking branch 'lilliput/JEP-450-temporary-fix-branch-2' into JDK-8305895-v4 >> - review feedback > > In both aarch64.ad and x86_64.ad, `MachUEPNode::format` might need some change accordingly? > AFAIK, @Hamlin-Li is working on the RISCV port. Not sure who would do s390. If it's available before intergration, I'll include it, but I'll not wait for it. Thanks! We're having some internal (riscv specific) discussion & review, should be able to provide the patch soon. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2413178574 From amitkumar at openjdk.org Tue Oct 15 08:14:30 2024 From: amitkumar at openjdk.org (Amit Kumar) Date: Tue, 15 Oct 2024 08:14:30 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v39] In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 21:47:00 GMT, Martin Doerr wrote: >@offamitkumar: It could still be done after this PR is integrated, but I guess you want to provide an s390 implementation. I haven't looked into it yet. I am looking into other issues for now, but I will if I can get time to work on this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2413190779 From kevinw at openjdk.org Tue Oct 15 08:20:18 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 15 Oct 2024 08:20:18 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames In-Reply-To: References: Message-ID: On Wed, 31 Jul 2024 08:30:47 GMT, Kevin Walls wrote: > Man page update for jcmd. > > Add updates for the filename options/arguments affected by: > 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID > > Also: > In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. > > In Description: > Each diagnostic command has its own set of options and arguments . > > Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. > > Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. My plan is to come back and finalize this change once https://github.com/openjdk/jdk/pull/21040 is done. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20401#issuecomment-2413202369 From kevinw at openjdk.org Tue Oct 15 08:21:18 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 15 Oct 2024 08:21:18 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:51:38 GMT, Kevin Walls wrote: >> DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. >> e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". > > Kevin Walls 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 four additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types > - Update comment about type name knowledge > - Test update > - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. Thanks Chris. Hoping to get a second approval. Would be great to get this change done, then I can go back and know that the man page change in https://github.com/openjdk/jdk/pull/20401 will be correct. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21040#issuecomment-2413205144 From egahlin at openjdk.org Tue Oct 15 08:34:13 2024 From: egahlin at openjdk.org (Erik Gahlin) Date: Tue, 15 Oct 2024 08:34:13 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:51:38 GMT, Kevin Walls wrote: >> DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. >> e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". > > Kevin Walls 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 four additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types > - Update comment about type name knowledge > - Test update > - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21040#pullrequestreview-2368548822 From kevinw at openjdk.org Tue Oct 15 08:34:14 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 15 Oct 2024 08:34:14 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v2] In-Reply-To: References: Message-ID: On Thu, 10 Oct 2024 08:51:38 GMT, Kevin Walls wrote: >> DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. >> e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". > > Kevin Walls 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 four additional commits since the last revision: > > - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types > - Update comment about type name knowledge > - Test update > - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. Thanks Erik! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21040#issuecomment-2413233734 From rkennke at openjdk.org Tue Oct 15 08:46:57 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 15 Oct 2024 08:46:57 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v40] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: PPC64 implementation of Compact Object Headers (JEP 450) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/b289ef88..6722f8be Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=39 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=38-39 Stats: 161 lines in 9 files changed: 95 ins; 39 del; 27 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From kevinw at openjdk.org Tue Oct 15 08:53:39 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 15 Oct 2024 08:53:39 GMT Subject: RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters [v3] In-Reply-To: References: Message-ID: > DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. > e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". Kevin Walls 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 five additional commits since the last revision: - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types - Merge remote-tracking branch 'upstream/master' into 8338603_dcmd_mbean_types - Update comment about type name knowledge - Test update - 8338603: DiagnosticCommandMBean operations should standardize types for parameters. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21040/files - new: https://git.openjdk.org/jdk/pull/21040/files/fabcaebe..70312190 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21040&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21040&range=01-02 Stats: 14306 lines in 284 files changed: 12064 ins; 1035 del; 1207 mod Patch: https://git.openjdk.org/jdk/pull/21040.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21040/head:pull/21040 PR: https://git.openjdk.org/jdk/pull/21040 From rkennke at openjdk.org Tue Oct 15 09:02:16 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 15 Oct 2024 09:02:16 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v41] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 90 commits: - Merge tag 'jdk-24+19' into JDK-8305895-v4 Added tag jdk-24+19 for changeset e7c5bf45 - PPC64 implementation of Compact Object Headers (JEP 450) - Increase compiler code stubs size for indexOf intrinsic - Fix include guards - Improve PSParallelCompact::fill_dense_prefix_end() even more - Re-enable indexOf intrinsic for compact headers - Rename nklass in aarch64 - Fix comment - Rename nklass in x86 code - Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 - ... and 80 more: https://git.openjdk.org/jdk/compare/e7c5bf45...86f94fee ------------- Changes: https://git.openjdk.org/jdk/pull/20677/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=40 Stats: 4865 lines in 205 files changed: 3383 ins; 818 del; 664 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From sgehwolf at openjdk.org Tue Oct 15 09:43:02 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 15 Oct 2024 09:43:02 GMT Subject: RFR: 8336881: [Linux] Support for hierarchical limits for Metrics [v10] In-Reply-To: References: Message-ID: <_wzqCdQ-RVPJsfS1tjWnorQJpINjfP3RA4O14xNMGdU=.4a9b6e43-d199-4dcf-851e-9c297b58e647@github.com> > Please review this fix for cgroups-based metrics reporting in the `jdk.internal.platform` package. This fix is supposed to address wrong reporting of certain limits if the limits aren't set at the leaf nodes. > > For example, on cg v2, the memory limit interface file is `memory.max`. Consider a cgroup path of `/a/b/c/d`. The current code only reports the limits (via Metrics) correctly if it's set at `/a/b/c/d/memory.max`. However, some systems - like a systemd slice - sets those limits further up the hierarchy. For example at `/a/b/c/memory.max`. `/a/b/c/d/memory.max` might be set to the value `max` (for unlimited), yet `/a/b/c/memory.max` would report the actual limit value (e.g. `1048576000`). > > This patch addresses this issue by: > > 1. Refactoring the interface lookup code to relevant controllers for cpu/memory. The CgroupSubsystem classes then delegate to those for the lookup. This facilitates having an API for the lookup of an updated limit in step 2. > 2. Walking the full hierarchy of the cgroup path (if any), looking for a lower limit than at the leaf. Note that it's not possible to raise the limit set at a path closer to the root via the interface file at a further-to-the-leaf-level. The odd case out seems to be `max` values on some systems (which seems to be the default value). > > As an optimization this hierarchy walk is skipped on containerized systems (like K8S), where the limits are set in interface files at the leaf nodes of the hierarchy. Therefore there should be no change on those systems. > > This patch depends on the Hotspot change implementing the same for the JVM so that `Metrics.isContainerized()` works correctly on affected systems where `-XshowSettings:system` currently reports `System not containerized` due to the missing JVM fix. A test framework for such hierarchical systems has been added in [JDK-8333446](https://bugs.openjdk.org/browse/JDK-8333446). This patch adds a test using that framework among some simpler unit tests. > > Thoughts? > > Testing: > > - [x] GHA > - [x] Container tests on Linux x86_64 on cg v1 and cg v2 systems > - [x] Some manual testing using systemd slices Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 35 commits: - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Add exclusive access dirs directive for systemd tests - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Improve systemd slice test for non-root on cg v2 - Fix unit tests - Add JVM_HostActiveProcessorCount using JVM api - Merge branch 'jdk-8322420_cgroup_hierarchy_walk_init' into jdk-8336881-metrics-systemd-slice - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init - Merge branch 'jdk-8322420_cgroup_hierarchy_walk_init' into jdk-8336881-metrics-systemd-slice - ... and 25 more: https://git.openjdk.org/jdk/compare/521effe0...03699b08 ------------- Changes: https://git.openjdk.org/jdk/pull/20280/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20280&range=09 Stats: 1595 lines in 27 files changed: 1344 ins; 152 del; 99 mod Patch: https://git.openjdk.org/jdk/pull/20280.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20280/head:pull/20280 PR: https://git.openjdk.org/jdk/pull/20280 From sspitsyn at openjdk.org Tue Oct 15 09:55:15 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 09:55:15 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v3] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: <7nf9YVsVg_UA_kD85dcBd8tT0_J_maZ5H-WGBEgWdbU=.685a1387-c66e-4514-8c74-1da1bf4bac57@github.com> On Tue, 15 Oct 2024 00:21:41 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: > > renamed JVM_EnqueueOperation2 > > renamed JVM_EnqueueOperation2 to JVM_EnqueueOperation_v2 for consistency (per Serguei request) src/hotspot/os/windows/attachListener_windows.cpp line 40: > 38: // executes a small stub generated by the client. The stub invokes the > 39: // JVM_EnqueueOperation or JVM_EnqueueOperation_v2 function which checks the operation parameters > 40: // and enqueues the operation request to the queue serviced by the attach listener. The thread created by Nit: Just a suggestion to simplify this line of comment a little bit: // and enqueues the operation request for the attach listener. The thread created by ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1800830693 From sspitsyn at openjdk.org Tue Oct 15 10:05:14 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 10:05:14 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v3] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 15 Oct 2024 00:21:41 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: > > renamed JVM_EnqueueOperation2 > > renamed JVM_EnqueueOperation2 to JVM_EnqueueOperation_v2 for consistency (per Serguei request) src/hotspot/os/windows/attachListener_windows.cpp line 108: > 106: size, > 107: &nread, > 108: nullptr); // not overlapped Nit: Missed space after `fsuccess` at line 104. Also, there is not cast `(DWORD)size` at line 106 as it is done in the `WriteFile()` call at line 118. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1800848373 From sspitsyn at openjdk.org Tue Oct 15 10:14:13 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 10:14:13 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v3] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 15 Oct 2024 00:21:41 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: > > renamed JVM_EnqueueOperation2 > > renamed JVM_EnqueueOperation2 to JVM_EnqueueOperation_v2 for consistency (per Serguei request) I've posted some nits and one questions. Otherwise, this change looks good to me. src/hotspot/os/windows/attachListener_windows.cpp line 194: > 192: } > 193: const char* arg(int i) const { > 194: return (i >= 0 && AttachOperation::arg_count_max) ? _arg[i] : nullptr; Nit: Dot is not needed at the end of comment at line 140. Q: Should the condition at line 194 be modified as below: ```return (i >= 0 && i < AttachOperation::arg_count_max) ? _arg[i] : nullptr;``` ------------- PR Review: https://git.openjdk.org/jdk/pull/20782#pullrequestreview-2368827594 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1800860402 From rsunderbabu at openjdk.org Tue Oct 15 10:16:38 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 15 Oct 2024 10:16:38 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver Message-ID: Passing "-Xmx1g -Xcomp" to the LingeredApp. Testing: tier1 ------------- Commit messages: - start the LingeredApp with jvm options Changes: https://git.openjdk.org/jdk/pull/21519/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21519&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8339871 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21519.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21519/head:pull/21519 PR: https://git.openjdk.org/jdk/pull/21519 From rkennke at openjdk.org Tue Oct 15 10:47:55 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 15 Oct 2024 10:47:55 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v42] In-Reply-To: References: Message-ID: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Fix aarch64.ad ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/86f94fee..005498b1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=41 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=40-41 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From kevinw at openjdk.org Tue Oct 15 10:53:15 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 15 Oct 2024 10:53:15 GMT Subject: Integrated: 8338603: DiagnosticCommandMBean operations should standardize types for parameters In-Reply-To: References: Message-ID: <3_K1g-JQznKDxhE2V1oEGiE5WKM9R__ullYvDxd73c8=.6712eeb9-d159-4040-a94a-082a4d282772@github.com> On Tue, 17 Sep 2024 14:10:07 GMT, Kevin Walls wrote: > DiagnosticCommandImpl should only publish parameter types in a known standard set, and use "STRING" on anything else. > e.g. We can say "FILE" in the help output for jcmd, as that's for humans, but the MBean parameter info should contain "STRING". This pull request has now been integrated. Changeset: df7d6e08 Author: Kevin Walls URL: https://git.openjdk.org/jdk/commit/df7d6e081ff9513fbd6cff5d033a307e6798418b Stats: 58 lines in 2 files changed: 50 ins; 0 del; 8 mod 8338603: DiagnosticCommandMBean operations should standardize types for parameters Reviewed-by: cjplummer, egahlin ------------- PR: https://git.openjdk.org/jdk/pull/21040 From tschatzl at openjdk.org Tue Oct 15 11:28:31 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 15 Oct 2024 11:28:31 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v8] In-Reply-To: <6usTXIvS83aO2VzX5xu2EnXlpIJ8YbfrWS6b3EI0MhE=.0e8cc603-0cd3-4bd9-b309-55e4dd0f0cb0@github.com> References: <6usTXIvS83aO2VzX5xu2EnXlpIJ8YbfrWS6b3EI0MhE=.0e8cc603-0cd3-4bd9-b309-55e4dd0f0cb0@github.com> Message-ID: On Mon, 9 Sep 2024 11:53:13 GMT, Thomas Schatzl wrote: >> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: >> >> - Try to avoid lea in loadNklass (aarch64) >> - Fix release build error > > src/hotspot/share/oops/klass.hpp line 169: > >> 167: // contention that may happen when a nearby object is modified. >> 168: AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. >> 169: // Some flags created by the JVM, not in the class file itself, > > Suggestion: > > markWord _prototype_header; // Used to initialize objects' header with compact headers. > > > Maybe some comment why this is an instance member. >@tschatzl I just found your comment here, and I'm not sure what you mean, tbh. The prototype_header is a member of Klass because with compact headers, it encodes that Klass in the prototype header. Note that there is planned follow-up work to remove that field and encode the Klass* on the allocation path. https://bugs.openjdk.org/browse/JDK-8341703 You explained what I had wanted to see here - why do we need a per-klass prototype header, because the markWord contains it ;) Given that it is going away, I retract this comment and the request can be resolved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1800983876 From mullan at openjdk.org Tue Oct 15 13:03:33 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 13:03:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager Message-ID: This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. The code changes can be broken down into roughly the following categories: 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most familiar with. ------------- Commit messages: - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 - Merge - fix setOpenURIHandler docs - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 - Fix whitespace - Merge - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 - Remove windows-specific policy file as it is no longer needed. - clientlibs: Updated Problemlist JBS ID for javax/swing/JPopupMenu/6694823/bug6694823.java - Merge - ... and 73 more: https://git.openjdk.org/jdk/compare/a601cd2e...d05122fb Changes: https://git.openjdk.org/jdk/pull/21498/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21498&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8338411 Stats: 63777 lines in 1825 files changed: 935 ins; 59236 del; 3606 mod Patch: https://git.openjdk.org/jdk/pull/21498.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21498/head:pull/21498 PR: https://git.openjdk.org/jdk/pull/21498 From liach at openjdk.org Tue Oct 15 13:03:33 2024 From: liach at openjdk.org (Chen Liang) Date: Tue, 15 Oct 2024 13:03:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... @seanjmullan I think you can use many lines of command in one github comment, like ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2411850563 From dfuchs at openjdk.org Tue Oct 15 15:19:23 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 15 Oct 2024 15:19:23 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Impressive work. I had a look at everything source in `net`, `logging`, `jmx` and `httpclient`. Mostly good, but I was surprised to see an explicit new `throw new SecurityException()` in `java.util.logging`; Also JMX still supports authentication and coarse authorisation, which means that `SecurityException` can still be thrown by the `JMXAuthenticator` / `MBeanServerAccessController` on the server side and thrown on the client side. I have made some suggestions. src/java.base/share/classes/java/net/URLClassLoader.java line 667: > 665: * @param codesource the codesource > 666: * @throws NullPointerException if {@code codesource} is {@code null}. > 667: * @return the permissions for the codesource Since there is no SecurityManager any more, I guess this method could be, in the future, degraded to return an empty collection? Then when that's done the API documentation above could be trivially simplified to `{@return an empty {@code PermissionCollection}}`? src/java.logging/share/classes/java/util/logging/LogManager.java line 2430: > 2428: @Deprecated(since="17", forRemoval=true) > 2429: public void checkAccess() { > 2430: throw new SecurityException(); Though this method is no longer called in the JDK, this is a change of behaviour that could affect subclasses of `LogManager`, or code using the `LogManager` that might still be calling this method. This method is deprecated for removal, and degrading it to always throw an exception is a logical step prior to removing it. However, I wonder if this shouldn't better be done separately, outside of this JEP? src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnection.java line 159: > 157: * is specified for the MBean. > 158: * @throws SecurityException if the client does not have permission > 159: * to perform this operation. Maybe we should revert those changes, or word them differently. AFAIU, is is still possible for a JMXConnectorServer to implement coarse grained authorization by setting up an `MBeanServerAccessController`, and in fact, the default JMX Agent does that. The JDK has a built-in implementation of `MBeanServerAccessController`, `MBeanServerFileAccessController`, which will throw `SecurityException` if access is denied by the `MBeanServerFileAccessController`. I believe this will result in the `RMIConnection` throwing `SecurityException` if the operation is denied by the `MBeanServerAccessController`. So I believe - in all methods here and in `RMIConnectionImpl`, we should leave the door open for `SecurityException` to get thrown. An alternative could be to cover that use case with a blanket statement, here, in `RMIConnectionImpl`, in `MBeanServer`, and in `MBeanServerConnection`. src/java.management/share/classes/javax/management/remote/JMXAuthenticator.java line 67: > 65: * > 66: * @exception SecurityException if the server cannot authenticate the user > 67: * with the provided credentials. Should this be reverted? Authentication has not been removed. src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java line 225: > 223: * > 224: * @exception SecurityException if the connection cannot be made > 225: * for security reasons. I wonder if these changes should also be reverted, on the ground that a server may have authentication in place and may refuse the connection. Same below. ------------- Changes requested by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2369425602 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801215698 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801291195 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801341618 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801357691 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801362306 From alanb at openjdk.org Tue Oct 15 15:24:25 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 15 Oct 2024 15:24:25 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 14:27:13 GMT, Daniel Fuchs wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.logging/share/classes/java/util/logging/LogManager.java line 2430: > >> 2428: @Deprecated(since="17", forRemoval=true) >> 2429: public void checkAccess() { >> 2430: throw new SecurityException(); > > Though this method is no longer called in the JDK, this is a change of behaviour that could affect subclasses of `LogManager`, or code using the `LogManager` that might still be calling this method. This method is deprecated for removal, and degrading it to always throw an exception is a logical step prior to removing it. However, I wonder if this shouldn't better be done separately, outside of this JEP? This is forced move. Same thing with Thread.checkAccess and ThreadGroup.checkAccess that also have to be re-specified to throw unconditionally. They are called out in the CSR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801415455 From dfuchs at openjdk.org Tue Oct 15 15:36:17 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 15 Oct 2024 15:36:17 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 15:21:32 GMT, Alan Bateman wrote: >> src/java.logging/share/classes/java/util/logging/LogManager.java line 2430: >> >>> 2428: @Deprecated(since="17", forRemoval=true) >>> 2429: public void checkAccess() { >>> 2430: throw new SecurityException(); >> >> Though this method is no longer called in the JDK, this is a change of behaviour that could affect subclasses of `LogManager`, or code using the `LogManager` that might still be calling this method. This method is deprecated for removal, and degrading it to always throw an exception is a logical step prior to removing it. However, I wonder if this shouldn't better be done separately, outside of this JEP? > > This is forced move. Same thing with Thread.checkAccess and ThreadGroup.checkAccess that also have to be re-specified to throw unconditionally. They are called out in the CSR. OK ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801445724 From ihse at openjdk.org Tue Oct 15 15:42:17 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 15 Oct 2024 15:42:17 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Build changes look good. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2369826643 From duke at openjdk.org Tue Oct 15 15:55:17 2024 From: duke at openjdk.org (David M. Lloyd) Date: Tue, 15 Oct 2024 15:55:17 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 15:33:03 GMT, Daniel Fuchs wrote: >> This is a bit of forced move. Same thing with Thread.checkAccess and ThreadGroup.checkAccess that also have to be re-specified to throw unconditionally. They are called out in the CSR. > > OK While I disagree with this change on the principle of "the system should operate as if no security manager were installed", the workaround for callers is actually rather simple: if (System.getSecurityManager() != null) { foo.checkAccess(); } I assume the justification for having these methods throw is consistency with the `check*` methods defined on `SecurityManager`. I agree that those methods should throw, because nobody should be handling instances of `SecurityManager` after this change. However, having other `checkAccess` methods throw (as opposed to being a no-op, as they would behave previously when no security manager is installed) doesn't really fulfill this spirit in my opinion. But since the workaround is so simple, it doesn't really matter. It would be different if we (library authors) would have to resort to MR JARs for example, but that is not the case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801484176 From mullan at openjdk.org Tue Oct 15 16:17:19 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 16:17:19 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 15:52:13 GMT, David M. Lloyd wrote: >> OK > > While I disagree with this change on the principle of "the system should operate as if no security manager were installed", the workaround for callers is actually rather simple: > > > if (System.getSecurityManager() != null) { > foo.checkAccess(); > } > > > I assume the justification for having these methods throw is consistency with the `check*` methods defined on `SecurityManager`. I agree that those methods should throw, because nobody should be handling instances of `SecurityManager` after this change. However, having other `checkAccess` methods throw (as opposed to being a no-op, as they would behave previously when no security manager is installed) doesn't really fulfill this spirit in my opinion. > > But since the workaround is so simple, it doesn't really matter. It would be different if we (library authors) would have to resort to MR JARs for example, but that is not the case. While making `LogManager.checkAccess` be a no-op might be more convenient, it could unconditionally permit operations that formerly required a permission check: clearly a bad idea. Always throwing a `SecurityException` is the safest option. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801518838 From sgehwolf at openjdk.org Tue Oct 15 16:37:21 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 15 Oct 2024 16:37:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Drive-by comment: `java.lang.StackWalker` still has some `checkPermission()` calls that uses: SecurityManager sm = System.getSecurityManager(); if (sm != null) { ... } Intentional? ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2369966554 From duke at openjdk.org Tue Oct 15 16:37:22 2024 From: duke at openjdk.org (David M. Lloyd) Date: Tue, 15 Oct 2024 16:37:22 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 16:14:58 GMT, Sean Mullan wrote: > While making `LogManager.checkAccess` be a no-op might be more convenient, it could unconditionally permit operations that formerly required a permission check: clearly a bad idea. Always throwing a `SecurityException` is the safest option. It's not about convenience _or_ safety; this part of the change has a provably flawed logical basis. These methods would no longer called from within the JDK after this change. All three of these methods were already previously defined to be a no-op when no security manager was installed (specifically when `System.getSecurityManager() == null`). Since no security manager may be installed after this change, this method will always return `null`. Thus, a no-op is still the most correct behavior and does not permit any operation that previously required a permission check (since it was already a no-op any time no security manager was installed, which will now be the only possible scenario). Therefore it is provably no safer to throw `SecurityException` here, since this will only prompt library developers to introduce the workaround I posted above when their tests fail, yielding the exact same result (except with a minor inconvenience to library developers). Either way is fine (as I said, the workaround is trivial), but IMO it's best to be conscious of the correct reasoning lest flawed assumptions _do_ end up enabling the introduction of unsafe changes elsewhere in the code. We don't have to make any assumptions about safety or previous behavior because it's all statically provable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801549133 From dfuchs at openjdk.org Tue Oct 15 16:44:16 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 15 Oct 2024 16:44:16 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <00frHPVuBzy1HhWEnmBtfSS4CeXN3uOVVilYbvntplY=.40626317-3ede-4a7f-b906-a8fa7829a418@github.com> On Tue, 15 Oct 2024 16:34:40 GMT, Severin Gehwolf wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Drive-by comment: `java.lang.StackWalker` still has some `checkPermission()` calls that uses: > > > SecurityManager sm = System.getSecurityManager(); > if (sm != null) { > ... > } > > > Intentional? @jerboaa Yes - this is intentional: > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2414512674 From sgehwolf at openjdk.org Tue Oct 15 16:57:21 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 15 Oct 2024 16:57:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 16:34:40 GMT, Severin Gehwolf wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Drive-by comment: `java.lang.StackWalker` still has some `checkPermission()` calls that uses: > > > SecurityManager sm = System.getSecurityManager(); > if (sm != null) { > ... > } > > > Intentional? > @jerboaa Yes - this is intentional: > > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). OK. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2414541204 From mullan at openjdk.org Tue Oct 15 17:04:25 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 17:04:25 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 16:34:06 GMT, David M. Lloyd wrote: >> While making `LogManager.checkAccess` be a no-op might be more convenient, it could unconditionally >> permit operations that formerly required a permission check: clearly a bad idea. Always throwing a `SecurityException` is the safest option. > >> While making `LogManager.checkAccess` be a no-op might be more convenient, it could unconditionally permit operations that formerly required a permission check: clearly a bad idea. Always throwing a `SecurityException` is the safest option. > > It's not about convenience _or_ safety; this part of the change has a provably flawed logical basis. > > These methods would no longer called from within the JDK after this change. All three of these methods were already previously defined to be a no-op when no security manager was installed (specifically when `System.getSecurityManager() == null`). Since no security manager may be installed after this change, this method will always return `null`. Thus, a no-op is still the most correct behavior and does not permit any operation that previously required a permission check (since it was already a no-op any time no security manager was installed, which will now be the only possible scenario). Therefore it is provably no safer to throw `SecurityException` here, since this will only prompt library developers to introduce the workaround I posted above when their tests fail, yielding the exact same result (except with a minor inconvenience to library developers). > > Either way is fine (as I said, the workaround is trivial), but IMO it's best to be conscious of the correct reasoning lest flawed assumptions _do_ end up enabling the introduction of unsafe changes elsewhere in the code. We don't have to make any assumptions about safety or previous behavior because it's all statically provable. I see your point now. We have strived to preserve compatibility with libraries that follow well known code patterns as described in the JEP, so I will discuss this with others who are more familiar with the compatibility risk of making this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801595566 From erikj at openjdk.org Tue Oct 15 17:52:22 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 15 Oct 2024 17:52:22 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <8aC3jj6-F-URh3DOk-64i-0FSHKwpUX7gPAvP70FUnI=.b8b29107-9a65-403f-8292-1613a401a3d3@github.com> On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Build changes look good. ------------- Marked as reviewed by erikj (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370152926 From cjplummer at openjdk.org Tue Oct 15 17:52:22 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 15 Oct 2024 17:52:22 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... jdk.jdi and jdk.attach changes look good. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370157272 From coleenp at openjdk.org Tue Oct 15 18:51:28 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 15 Oct 2024 18:51:28 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... HotSpot changes look great. Will clean out the rest in [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). ------------- Marked as reviewed by coleenp (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370289526 From naoto at openjdk.org Tue Oct 15 18:51:29 2024 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 15 Oct 2024 18:51:29 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <4WtQzf1WGGjNSzOuxPNvYOub8uuVyYhaad13b4RfMDI=.d7e704b1-68af-4ddd-b221-77b76c179f98@github.com> On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... This is a great work! I looked through the following areas that relate to i18n/charset/console/javatime, and they all look good to me. src/java.base/share/classes/java/util/Locale.java src/java.base/share/classes/java/util/ResourceBundle.java src/java.base/share/classes/java/util/TimeZone.java src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java test/jdk/java/io/Console/ test/jdk/java/nio/charset/spi/ test/jdk/java/time/nontestng/java/time/chrono/ test/jdk/java/util/PluggableLocale/ test/jdk/java/util/ResourceBundle/ test/jdk/java/util/TimeZone/ test/jdk/java/util/spi/ResourceBundleControlProvider/ test/jdk/sun/nio/cs/ test/jdk/sun/util/locale/provider/ ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370292817 From duke at openjdk.org Tue Oct 15 19:08:13 2024 From: duke at openjdk.org (Sebastian =?UTF-8?B?TMO2dmRhaGw=?=) Date: Tue, 15 Oct 2024 19:08:13 GMT Subject: RFR: 8341482: Attach API access to /proc filesystem should use doPrivileged [v2] In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: <7w6YHW02YtcgYw4giNMNCrlG7_ubcjyXE8ucigWmbHI=.7b2ec962-7b79-451b-8776-1035cfaf651e@github.com> On Wed, 2 Oct 2024 21:15:11 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations Thanks @larry-cable for looking into this! The following test passes on my Ubuntu 24.04 with this PR at least. `TestJcmdWithSideCar` with Docker: make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker" `TestJcmdWithSideCar` with Podman: make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=podman" make test TEST="jtreg:test/hotspot/jtreg/containers" make test TEST="jtreg:test/hotspot/jtreg/serviceability" FWIW, the `SecurityManager` PR (#21498) has been opened now. Ideally we would get this one in before it's merged. src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java line 70: > 68: @FunctionalInterface > 69: private interface IOFunction { > 70: public R apply(T t) throws IOException; Minor nit, indentation is a bit off compared to the rest of the file: Suggestion: public R apply(T t) throws IOException; src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java line 76: > 74: private static R filesFunctionPrivileged(IOFunction function, final Path path, Supplier def) throws IOException { > 75: try { > 76: return AccessController.doPrivileged((PrivilegedExceptionAction) () -> function.apply(path)); Ditto: Suggestion: return AccessController.doPrivileged((PrivilegedExceptionAction) () -> function.apply(path)); ------------- Marked as reviewed by slovdahl at github.com (no known OpenJDK username). PR Review: https://git.openjdk.org/jdk/pull/21312#pullrequestreview-2370283806 PR Review Comment: https://git.openjdk.org/jdk/pull/21312#discussion_r1801747382 PR Review Comment: https://git.openjdk.org/jdk/pull/21312#discussion_r1801750306 From mchung at openjdk.org Tue Oct 15 19:36:24 2024 From: mchung at openjdk.org (Mandy Chung) Date: Tue, 15 Oct 2024 19:36:24 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Source changes in `java.base/java/lang/**`, `java.management`, and `jdk.management` module look good. Also hotspot change. src/java.base/share/classes/java/lang/SecurityManager.java line 72: > 70: private static class StackWalkerHolder { > 71: static final StackWalker STACK_WALKER = > 72: StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); Suggestion: StackWalker.getInstance(Set.of(Option.DROP_METHOD_INFO, Option.RETAIN_CLASS_REFERENCE)); Method info is not needed. ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370337536 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801781277 From cjplummer at openjdk.org Tue Oct 15 20:42:11 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 15 Oct 2024 20:42:11 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 10:12:21 GMT, Ramkumar Sunderbabu wrote: > Passing "-Xmx1g -Xcomp" to the LingeredApp. > Testing: tier1 We have 3 processes here: 1. The test. 2. The SA Debuggee process spawned by the test (LingeredApp) 3. The SA "tool", also spawned by the test. (1) and (2) will automatically get the default test args, which will include -Xcomp if it is a -Xcomp test task. (3) will not get the default test args since it is spawned with createLimitedTestJavaProcessBuilder(), which is likely what we want. The only process that needs to be run with -Xcomp (and any other test args) is (2) the debuggee process, but I don't see why we don't just allow it to get -Xcomp when run as part of a -Xcomp test task, and not have -Xcomp otherwise. It doesn't appear that -Xcomp on the debuggee is a requirement for this test, because in the past it has not been explicitly run with -Xcomp. The changes in the PR get rid of test runs where the debuggee does not use -Xcmp, and also continue to force -Xcomp on the test process, which is unnecessary. If we really only want the debuggee run with -Xcomp, then we should probably limit this test to only support -Xcomp test runs. So that means adding `@requires vm.compMode == "Xcomp"`. It also means getting rid of -Xcomp elsewhere in the test. I'm not sure of the reason for `-Xmx1g`. Maybe @tkrodriguez can explain. I think another options is to have the test explicitly launch the debuggee with -Xcomp as is done in this PR, but also add `@requires vm.flagless`. @lmesnik? ------------- PR Review: https://git.openjdk.org/jdk/pull/21519#pullrequestreview-2370566945 From wkemper at openjdk.org Tue Oct 15 20:49:24 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 15 Oct 2024 20:49:24 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: <7Y0f1A161C8p_W13beNZEsIGywt8i5JQz9LS-LQabQ4=.cb780e1a-7519-4a9b-9c63-c65898de6749@github.com> On Thu, 10 Oct 2024 12:58:56 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 96: > >> 94: size_t capacity = _space_info->soft_max_capacity(); >> 95: size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste); >> 96: size_t free_target = (capacity * ShenandoahMinFreeThreshold) / 100 + max_cset; > > Does re-arranging the math here risk overflow (e.g. on 32-bit)? https://bugs.openjdk.org/browse/JDK-8342239 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1801956645 From wkemper at openjdk.org Tue Oct 15 20:54:18 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 15 Oct 2024 20:54:18 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 22:12:25 GMT, Y. Srinivas Ramakrishna wrote: >> src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 40: >> >>> 38: DIRTY_SCAN_OBJS = 6, >>> 39: ALTERNATIONS = 7, >>> 40: MAX_CARD_STAT_TYPE = 8 >> >> Are the numerical values relevant or what is the reason to spell them out? > > Not needed; explicit enumeration values can be removed. https://github.com/openjdk/shenandoah/pull/514 >> src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 46: >> >>> 44: CARD_STAT_SCAN_RS = 0, >>> 45: CARD_STAT_UPDATE_REFS = 1, >>> 46: MAX_CARD_STAT_LOG_TYPE = 2 >> >> Same here? > > Yes, same; explicit enumeration values can be removed. https://github.com/openjdk/shenandoah/pull/514 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1801975222 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1801975588 From cjplummer at openjdk.org Tue Oct 15 20:57:11 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 15 Oct 2024 20:57:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Fri, 11 Oct 2024 09:26:42 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > minor comment tweak Overall the fix looks good. I made a couple of minor suggestions for the test. Make sure you test on all platforms and with -Xcomp since the test is timing sensitive. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 57: > 55: Thread controlThread = new Thread(() -> control(testThread), "Control Thread"); > 56: > 57: setFramePopNotificationMode(testThread, true); I think we can get rid of this API and just have the native code default to enabling FRAME_POP events. This was copied from a test that would turn it on and off, but this test always needs it on. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 156: > 154: > 155: // We only want to do a NotifyFramePop once for the main method. The sole purpose is > 156: // to force the thread into interpOnly mode, which seems to help the tests's timing Suggestion: // to force the thread into interpOnly mode, which seems to help the test's timing ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2370623582 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1801978159 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1801969813 From never at openjdk.org Tue Oct 15 21:12:09 2024 From: never at openjdk.org (Tom Rodriguez) Date: Tue, 15 Oct 2024 21:12:09 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver In-Reply-To: References: Message-ID: <2GU82lxQpCxOHOba2gWcSYpriAXiIjq8g_kISFatO8w=.d1ebdcc2-daed-479d-b458-0da08cbc3380@github.com> On Tue, 15 Oct 2024 10:12:21 GMT, Ramkumar Sunderbabu wrote: > Passing "-Xmx1g -Xcomp" to the LingeredApp. > Testing: tier1 The -Xmx1g is probably just copied from ClhsdbPrintAll.java so it could probably be dropped. Since the point of this test is to exercise nmethod debug info decoding we want LingeredApp to run with Xcomp so that the inspected process has nmethods. It doesn't matter if anything else is run with Xcomp so whatever accomplishes that seems fine. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21519#issuecomment-2415171345 From amenkov at openjdk.org Tue Oct 15 21:24:12 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 15 Oct 2024 21:24:12 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 22:58:33 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run src/hotspot/share/prims/jvmtiEnvBase.cpp line 692: > 690: if (jt->is_in_VTMS_transition()) { > 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); > 692: } else if (is_virtual) { // filter out pure continuations Not sure I follow the logic here. As far as I understand yield/yield need to be filtered out only for unmounted virtual threads. But `is_virtual` here means we have mounted VT? Looks like almost all callers call this method only if `jt->is_in_JTMS_transilition()` is true Exception is a call from `get_vthread_jvf()` when vthread is mounted. src/hotspot/share/prims/jvmtiEnvBase.cpp line 703: > 701: if (java_lang_VirtualThread::is_instance(vthread)) { // paranoid check for safety > 702: if (java_lang_Thread::is_in_VTMS_transition(vthread)) { > 703: jvf = check_and_skip_hidden_frames(java_lang_Thread::is_in_VTMS_transition(vthread), jvf); it's just checked that `java_lang_Thread::is_in_VTMS_transition(vthread)` is true Suggestion: jvf = check_and_skip_hidden_frames(true, jvf); src/hotspot/share/prims/jvmtiEnvBase.cpp line 2025: > 2023: // - it is a good invariant when a thread's handshake can't be impacted by a VTMS transition > 2024: // - there is no mechanism to disable transitions of a specific carrier thread yet > 2025: JvmtiVTMSTransitionDisabler disabler(is_virtual ? target : nullptr); // nullptr is to disable all We have a number of places with the same issue - `JvmtiVTMSTransitionDisabler disabler(target)` when target thread can be virtual or platform. I think they need to be fixed all together (and most likely as a separate issue). Maybe it would be better to fix disabler itself (check if the thread provided is platform and disable transitions for all threads in the case). Then there is no need to update all this places when (if) disabling for single platform thread is implemented src/hotspot/share/prims/jvmtiExport.cpp line 1814: > 1812: } > 1813: // pure continuations have no VTMS transitions but they use methods annotated with JvmtiMountTransition > 1814: if ((mh->jvmti_mount_transition() && state->is_virtual()) || thread->is_in_any_VTMS_transition()) { Could you please explain the change (and other similar changes in jvmtiExport.cpp) Before events were not posted for any `@JvmtiMountTransition` methods, and now only for virtual threads? I.e. events for `@JvmtiMountTransition` methods of carrier threads are posted? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1801933054 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1801953309 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1801992736 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802034030 From amenkov at openjdk.org Tue Oct 15 21:31:11 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 15 Oct 2024 21:31:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 22:58:33 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run src/hotspot/share/prims/jvmtiEnvBase.cpp line 588: > 586: // There should not be any VTMS transition here. This is for safety. > 587: if (java_thread->is_in_VTMS_transition()) { > 588: jvf = JvmtiEnvBase::check_and_skip_hidden_frames(java_thread, jvf); The code now checks `java_thread->is_in_VTMS_transition()`, so it may be simplified to Suggestion: jvf = JvmtiEnvBase::check_and_skip_hidden_frames(true, jvf); src/hotspot/share/prims/jvmtiEnvBase.cpp line 691: > 689: > 690: if (jt->is_in_VTMS_transition()) { > 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); Suggestion: jvf = check_and_skip_hidden_frames(true, jvf); src/hotspot/share/prims/jvmtiEnvBase.cpp line 753: > 751: // Skip hidden frames only for carrier threads > 752: // which are in non-temporary VTMS transition. > 753: jvf = check_and_skip_hidden_frames(jt, jvf); Can be Suggestion: jvf = check_and_skip_hidden_frames(true, jvf); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802038615 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802039013 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802039786 From sspitsyn at openjdk.org Tue Oct 15 21:34:10 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 21:34:10 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 20:49:51 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 156: > >> 154: >> 155: // We only want to do a NotifyFramePop once for the main method. The sole purpose is >> 156: // to force the thread into interpOnly mode, which seems to help the tests's timing > > Suggestion: > > // to force the thread into interpOnly mode, which seems to help the test's timing Thanks. Fixed now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802043134 From prr at openjdk.org Tue Oct 15 21:39:19 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 15 Oct 2024 21:39:19 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... I have looked at the source code changes in java.desktop They are mostly OK. I have noted text that was removed in two places in java.awt.Robot where the removal should be reverted. I have also "grepped" the sandbox repo to identify any errors of omission - pertaining to the SE API specification, not internals - and found none. I also noted a couple of Permission classes we should deprecate - and filed bugs on them. I have not yet examined any of the test updates. That looks like a big job. src/java.desktop/share/classes/java/awt/AWTPermission.java line 39: > 37: * @apiNote > 38: * This permission cannot be used for controlling access to resources anymore > 39: * as the Security Manager is no longer supported. After this JEP is integrated, I expect to deprecate AWTPermission, probably for removal src/java.desktop/share/classes/java/awt/Robot.java line 433: > 431: * then a {@code SecurityException} may be thrown, > 432: * or the content of the returned {@code Color} is undefined. > 433: *

This text should not have been removed. It pertains to the desktop permissions as well as the Java SecurityManager. src/java.desktop/share/classes/java/awt/Robot.java line 460: > 458: * then a {@code SecurityException} may be thrown, > 459: * or the contents of the returned {@code BufferedImage} are undefined. > 460: *

This text should not have been removed. It pertains to the desktop permissions as well as the Java SecurityManager. src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java line 36: > 34: * actions list; you either have the named permission or you don't. > 35: *

> 36: * The target name is the name of the audio permission. AudioPermission is another class we should deprecate ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2370309133 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1801765010 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802031119 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802031524 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802042388 From sspitsyn at openjdk.org Tue Oct 15 21:48:10 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 21:48:10 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: <4-iAWYiOUcdSMFVFWvAq0DMtJdq3eqQVpv8jHPuU-gE=.a3ff03e1-fbe8-4a6b-a57e-a902d8488bca@github.com> On Tue, 15 Oct 2024 20:51:47 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 57: > >> 55: Thread controlThread = new Thread(() -> control(testThread), "Control Thread"); >> 56: >> 57: setFramePopNotificationMode(testThread, true); > > I think we can get rid of this API and just have the native code default to enabling FRAME_POP events. This was copied from a test that would turn it on and off, but this test always needs it on. Thank you for the suggestion. I've removed the second parameter and defaulted it to `true`. The API is still useful as it points to the tested thread the FramePop events have to be enabled for. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802055012 From sspitsyn at openjdk.org Tue Oct 15 21:51:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 21:51:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 20:45:46 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 703: > >> 701: if (java_lang_VirtualThread::is_instance(vthread)) { // paranoid check for safety >> 702: if (java_lang_Thread::is_in_VTMS_transition(vthread)) { >> 703: jvf = check_and_skip_hidden_frames(java_lang_Thread::is_in_VTMS_transition(vthread), jvf); > > it's just checked that `java_lang_Thread::is_in_VTMS_transition(vthread)` is true > Suggestion: > > jvf = check_and_skip_hidden_frames(true, jvf); Good catch, thanks. Fixed now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802057401 From sspitsyn at openjdk.org Tue Oct 15 22:02:12 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 22:02:12 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 20:40:50 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 692: > >> 690: if (jt->is_in_VTMS_transition()) { >> 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); >> 692: } else if (is_virtual) { // filter out pure continuations > > Not sure I follow the logic here. > As far as I understand yield/yield need to be filtered out only for unmounted virtual threads. But `is_virtual` here means we have mounted VT? > Looks like almost all callers call this method only if `jt->is_in_JTMS_transilition()` is true > Exception is a call from `get_vthread_jvf()` when vthread is mounted. This seems to be a good catch. The call to `skip_top_jvmti_annotated_frames()` should not be needed. It does not harm either, so I've added it for safety. Will remove it and rerun mach5 tiers to make sure there is nothing unexpected. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802065755 From mullan at openjdk.org Tue Oct 15 22:12:26 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 22:12:26 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <_UQk_rXNduHRZLxx3Y5n9iIW8AIxddeMhTW-9HaU3W8=.1903abd6-c56e-4096-bf3a-4b48ed890c0d@github.com> On Tue, 15 Oct 2024 13:51:18 GMT, Daniel Fuchs wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.base/share/classes/java/net/URLClassLoader.java line 667: > >> 665: * @param codesource the codesource >> 666: * @throws NullPointerException if {@code codesource} is {@code null}. >> 667: * @return the permissions for the codesource > > Since there is no SecurityManager any more, I guess this method could be, in the future, degraded to return an empty collection? Then when that's done the API documentation above could be trivially simplified to `{@return an empty {@code PermissionCollection}}`? Yes, I think that is a good suggestion. Let me think about whether it should be done as part of this JEP or if we can do it later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802073264 From sspitsyn at openjdk.org Tue Oct 15 22:13:12 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 22:13:12 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 20:55:54 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 2025: > >> 2023: // - it is a good invariant when a thread's handshake can't be impacted by a VTMS transition >> 2024: // - there is no mechanism to disable transitions of a specific carrier thread yet >> 2025: JvmtiVTMSTransitionDisabler disabler(is_virtual ? target : nullptr); // nullptr is to disable all > > We have a number of places with the same issue - `JvmtiVTMSTransitionDisabler disabler(target)` when target thread can be virtual or platform. > I think they need to be fixed all together (and most likely as a separate issue). > Maybe it would be better to fix disabler itself (check if the thread provided is platform and disable transitions for all threads in the case). Then there is no need to update all this places when (if) disabling for single platform thread is implemented Good suggestion, thanks. Though, I'd prefer to fix it here, so will prepare a fix in the `JvmtiVTMSTransitionDisabler` constructor. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802073959 From mullan at openjdk.org Tue Oct 15 22:19:21 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 22:19:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 19:11:24 GMT, Mandy Chung wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.base/share/classes/java/lang/SecurityManager.java line 72: > >> 70: private static class StackWalkerHolder { >> 71: static final StackWalker STACK_WALKER = >> 72: StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); > > Suggestion: > > StackWalker.getInstance(Set.of(Option.DROP_METHOD_INFO, Option.RETAIN_CLASS_REFERENCE)); > > > Method info is not needed. Thanks, will fix. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802077370 From mullan at openjdk.org Tue Oct 15 22:19:22 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 22:19:22 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 21:17:37 GMT, Phil Race wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.desktop/share/classes/java/awt/Robot.java line 433: > >> 431: * then a {@code SecurityException} may be thrown, >> 432: * or the content of the returned {@code Color} is undefined. >> 433: *

> > This text should not have been removed. It pertains to the desktop permissions as well as the Java SecurityManager. Ok, I will revert it. > src/java.desktop/share/classes/java/awt/Robot.java line 460: > >> 458: * then a {@code SecurityException} may be thrown, >> 459: * or the contents of the returned {@code BufferedImage} are undefined. >> 460: *

> > This text should not have been removed. It pertains to the desktop permissions as well as the Java SecurityManager. Ok, I will revert it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802077916 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802078111 From mullan at openjdk.org Tue Oct 15 22:19:23 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 15 Oct 2024 22:19:23 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 15:01:00 GMT, Daniel Fuchs wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java line 225: > >> 223: * >> 224: * @exception SecurityException if the connection cannot be made >> 225: * for security reasons. > > I wonder if these changes should also be reverted, on the ground that a server may have authentication in place and may refuse the connection. Same below. Yes, good catches, I will revert some of these JMX methods that can also throw SecurityExceptions for non-SM reasons. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802076052 From cjplummer at openjdk.org Tue Oct 15 22:26:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 15 Oct 2024 22:26:10 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Fri, 11 Oct 2024 09:26:42 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > minor comment tweak src/hotspot/share/prims/jvmtiThreadState.hpp line 364: > 362: void set_top_frame_is_exiting() { _top_frame_is_exiting = true; } > 363: void clr_top_frame_is_exiting() { _top_frame_is_exiting = false; } > 364: bool is_top_frame_is_exiting() { return _top_frame_is_exiting; } Just noticed you are using "is" twice in this API. I'm not sure of the hotspot convention here. Seems probably the first "is" should be dropped. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802083174 From amenkov at openjdk.org Tue Oct 15 22:31:46 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 15 Oct 2024 22:31:46 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: > The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. > More detailed explanations on the 1st comment. > > Testing: tier1,tier2,tier3,tier4,hs-tier5-svc > manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: - updated comment - feedback ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20782/files - new: https://git.openjdk.org/jdk/pull/20782/files/1fed4ea6..86bd1cd2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=02-03 Stats: 8 lines in 1 file changed: 0 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/20782.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20782/head:pull/20782 PR: https://git.openjdk.org/jdk/pull/20782 From amenkov at openjdk.org Tue Oct 15 22:31:46 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 15 Oct 2024 22:31:46 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v3] In-Reply-To: <7nf9YVsVg_UA_kD85dcBd8tT0_J_maZ5H-WGBEgWdbU=.685a1387-c66e-4514-8c74-1da1bf4bac57@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> <7nf9YVsVg_UA_kD85dcBd8tT0_J_maZ5H-WGBEgWdbU=.685a1387-c66e-4514-8c74-1da1bf4bac57@github.com> Message-ID: On Tue, 15 Oct 2024 09:52:27 GMT, Serguei Spitsyn wrote: >> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision: >> >> renamed JVM_EnqueueOperation2 >> >> renamed JVM_EnqueueOperation2 to JVM_EnqueueOperation_v2 for consistency (per Serguei request) > > src/hotspot/os/windows/attachListener_windows.cpp line 40: > >> 38: // executes a small stub generated by the client. The stub invokes the >> 39: // JVM_EnqueueOperation or JVM_EnqueueOperation_v2 function which checks the operation parameters >> 40: // and enqueues the operation request to the queue serviced by the attach listener. The thread created by > > Nit: Just a suggestion to simplify this line of comment a little bit: > // and enqueues the operation request for the attach listener. The thread created by I've made it "enqueues the operation request to the queue." > src/hotspot/os/windows/attachListener_windows.cpp line 108: > >> 106: size, >> 107: &nread, >> 108: nullptr); // not overlapped > > Nit: Missed space after `fsuccess` at line 104. > Also, there is not cast `(DWORD)size` at line 106 as it is done in the `WriteFile()` call at line 118. Fixed both indent and cast > src/hotspot/os/windows/attachListener_windows.cpp line 194: > >> 192: } >> 193: const char* arg(int i) const { >> 194: return (i >= 0 && AttachOperation::arg_count_max) ? _arg[i] : nullptr; > > Nit: Dot is not needed at the end of comment at line 140. > Q: Should the condition at line 194 be modified as below: > ```return (i >= 0 && i < AttachOperation::arg_count_max) ? _arg[i] : nullptr;``` Good catch! Fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1802084434 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1802084837 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1802086150 From dholmes at openjdk.org Tue Oct 15 22:44:17 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 15 Oct 2024 22:44:17 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v15] In-Reply-To: <1ZXms0ZIxS7YIAqTp97N51dVk8iNpwuBm_zLPO6qqYw=.18911399-dfb8-4293-bba4-57e643561065@github.com> References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> <1ZXms0ZIxS7YIAqTp97N51dVk8iNpwuBm_zLPO6qqYw=.18911399-dfb8-4293-bba4-57e643561065@github.com> Message-ID: On Mon, 14 Oct 2024 07:19:03 GMT, Ioi Lam wrote: >> This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). >> >> **Overview** >> >> - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. >> - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. >> - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. >> - The boot classes are loaded as part of `vmClasses::resolve_all()` >> - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). >> - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. >> >> **All-or-nothing Loading** >> >> - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. >> - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: >> - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. >> - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. >> - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. >> - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exa... > > Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: > > Missed one file from last commit Still good for me - but seems to be jcheck whitespace issues. ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20843#pullrequestreview-2370819827 From duke at openjdk.org Tue Oct 15 22:44:35 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Tue, 15 Oct 2024 22:44:35 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v42] In-Reply-To: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> References: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> Message-ID: On Tue, 15 Oct 2024 10:47:55 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Fix aarch64.ad Finished reviewing `src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp`, line by line and comparing old snippets that got merged into the new function: looks good to me, every (new) case handled Only have some minor comments about comments. src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 414: > 412: // to the valid haystack bytes on the stack. > 413: { > 414: const Register haystack = rbx; Keep `rax` as index for clarity? Although it is really used as a temp.. const Register index = rax; const Register haystack = rbx; copy_to_stack(haystack, haystack_len, false, index , XMM_TMP1, _masm); src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 1568: > 1566: assert((COPIED_HAYSTACK_STACK_SIZE == 64), "Must be 64!"); > 1567: > 1568: // Copy incoming haystack onto stack Old comment was slightly more precise. Move here. i.e. `// Copy incoming haystack onto stack (haystack <= 32 bytes)` src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 1634: > 1632: > 1633: > 1634: // Copy the small (< 32 byte) haystack to the stack. Allows for vector reads without page fault Just to be pedantic, its `(<=32)` - this function also handles 32bytes case. - line 401: __ cmpq(haystack_len, 0x20); __ ja(L_bigSwitchTop); - though line 293 (`highly_optimized_short_cases`) only seems to route16-byte cases here: ```__ cmpq(haystack_len_p, isU ? 8 : 16);``` src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 1659: > 1657: Label L_moreThan8, L_moreThan16, L_moreThan24, L_adjustHaystack; > 1658: > 1659: assert(arrayOopDesc::base_offset_in_bytes(isU ? T_CHAR : T_BYTE) >= 8, If we had to also optimize for header-size 16, it might be possible to remove one jump here. Looks correct for either size. ------------- PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2370735887 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802041876 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802044880 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802088545 PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802073195 From lmesnik at openjdk.org Tue Oct 15 23:01:14 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 15 Oct 2024 23:01:14 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 10:12:21 GMT, Ramkumar Sunderbabu wrote: > Passing "-Xmx1g -Xcomp" to the LingeredApp. > Testing: tier1 The only thing that is missed it change `othervm` to `driver`. The adding -Xcomp in LingeredApp.startApp(theApp, "-Xmx1g", "-Xcomp"); should works fine except when -Xint/-Xmixed is set explicitly. So generally test like needs to have @requires vm.compMode == "null" | vm.compMode == "Xcomp" However we don't set these modes, so it might be skipped. A lot of our test set Xcomp without any requires now. Also, the vm.flagless is not required, since test support various vm flags. Limiting tests to run only -Xcomp is set is also not needed for this test. The another thing to check (unrelated to the fix) is if test is executed in tier1 and should it be there. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21519#issuecomment-2415309978 From wkemper at openjdk.org Tue Oct 15 23:03:21 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 15 Oct 2024 23:03:21 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: <_1_RPbV4VVoczxDhQYp967iOM37EHh3ZcK5b8dvKrQU=.1b9556a6-81d3-428d-8593-bd4cdced44de@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> <_1_RPbV4VVoczxDhQYp967iOM37EHh3ZcK5b8dvKrQU=.1b9556a6-81d3-428d-8593-bd4cdced44de@github.com> Message-ID: <1FBHl-vUAvyx5tv2VG7jM86Lx5DM1aaIgE9-jTNv-9s=.b68703f8-f9bf-4952-9e1f-9da7a68bb7de@github.com> On Fri, 11 Oct 2024 13:43:46 GMT, Roman Kennke wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java line 100: > >> 98: >> 99: /* >> 100: * @test id=generational > > You are making a test configuration and call it 'generational' but then one of the two run configurations doesn't actually run with generational mode. You probably want to separate the two? https://bugs.openjdk.org/browse/JDK-8342278 > test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java line 163: > >> 161: final int min = 0; >> 162: final int max = 384 * 1024; >> 163: // Each allocated int array is assumed to consume 16 bytes for alignment and header, plus > > With the upcoming 'compact headers' it's going to be only 12 bytes. If that matters, then the actual number should perhaps be a constant? Preexisting and not relevant for this PR, though. Yes, not sure that level of precision is really required for this test either. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1802109516 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1802109841 From iklam at openjdk.org Tue Oct 15 23:40:41 2024 From: iklam at openjdk.org (Ioi Lam) Date: Tue, 15 Oct 2024 23:40:41 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v15] In-Reply-To: References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> <1ZXms0ZIxS7YIAqTp97N51dVk8iNpwuBm_zLPO6qqYw=.18911399-dfb8-4293-bba4-57e643561065@github.com> Message-ID: On Tue, 15 Oct 2024 22:41:07 GMT, David Holmes wrote: > Still good for me - but seems to be jcheck whitespace issues. Thanks for noticing it. I've fixed the whitespaces (and need to propagate that to all subsequent PRs in this series). ------------- PR Comment: https://git.openjdk.org/jdk/pull/20843#issuecomment-2415345421 From iklam at openjdk.org Tue Oct 15 23:40:41 2024 From: iklam at openjdk.org (Ioi Lam) Date: Tue, 15 Oct 2024 23:40:41 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v16] In-Reply-To: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: > This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). > > **Overview** > > - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. > - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. > - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. > - The boot classes are loaded as part of `vmClasses::resolve_all()` > - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). > - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. > > **All-or-nothing Loading** > > - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. > - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: > - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. > - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. > - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. > - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exact same set of modules are visible whe... Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: Fixed whitespaces ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20843/files - new: https://git.openjdk.org/jdk/pull/20843/files/22c47d33..6bb38cb9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=14-15 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20843.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20843/head:pull/20843 PR: https://git.openjdk.org/jdk/pull/20843 From sspitsyn at openjdk.org Tue Oct 15 23:57:12 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 15 Oct 2024 23:57:12 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: <81rOWotluAxLNE9hrmhLmPRVmdeieCH8XfkbCRF3iMc=.8ea9d4b6-4678-42a9-914d-96b4e366e195@github.com> On Tue, 15 Oct 2024 20:54:45 GMT, Chris Plummer wrote: > Overall the fix looks good. I made a couple of minor suggestions for the test. Make sure you test on all platforms and with -Xcomp since the test is timing sensitive. Thank you for reviewing this! Good suggestion about an extensive testing with -Xcomp. > src/hotspot/share/prims/jvmtiThreadState.hpp line 364: > >> 362: void set_top_frame_is_exiting() { _top_frame_is_exiting = true; } >> 363: void clr_top_frame_is_exiting() { _top_frame_is_exiting = false; } >> 364: bool is_top_frame_is_exiting() { return _top_frame_is_exiting; } > > Just noticed you are using "is" twice in this API. I'm not sure of the hotspot convention here. Seems probably the first "is" should be dropped. Good catch, thanks. Fixed now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21468#issuecomment-2415360803 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802139368 From dholmes at openjdk.org Wed Oct 16 00:06:15 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 16 Oct 2024 00:06:15 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: On Sun, 13 Oct 2024 15:38:49 GMT, Simon Tooke wrote: >> This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). >> >> This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). >> >> The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. >> >> Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp > > Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: > > clean up test code Hi @stooke , I was away on vacation when you made the updates. I'm afraid I still have some issues about expected behaviour on Windows with regard to the tests. test/hotspot/gtest/runtime/test_os.cpp line 413: > 411: > 412: TEST_VM(os, realpath) { > 413: /* POSIX requires that the file exists, Windows doesn't */ I'm not sure what this comment means. I can't fully discern from https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fullpath-wfullpath?view=msvc-170 what Windows does if the path does not exist. test/hotspot/gtest/runtime/test_os.cpp line 422: > 420: errno = 0; > 421: const char* returnedBuffer = os::realpath(nosuchpath, buffer, sizeof(nosuchpath) - 2); > 422: /* Returns ENOENT on Linux, ENAMETOOLONG on Windows */ Suggestion: /* Reports ENOENT on Linux, ENAMETOOLONG on Windows */ and similarly below. test/hotspot/gtest/runtime/test_os.cpp line 425: > 423: EXPECT_TRUE(returnedBuffer == nullptr); > 424: #if defined(_WINDOWS) > 425: EXPECT_TRUE(errno == ENAMETOOLONG); Why is this the case? Our implementation does not set it and `_fullpath` makes no mention of it. ------------- PR Review: https://git.openjdk.org/jdk/pull/20683#pullrequestreview-2370878680 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1802144245 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1802139054 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1802142390 From sspitsyn at openjdk.org Wed Oct 16 00:07:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 00:07:11 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 15 Oct 2024 22:31:46 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - updated comment > - feedback Thank you for the updates. Looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20782#pullrequestreview-2370886982 From amenkov at openjdk.org Wed Oct 16 00:10:17 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 16 Oct 2024 00:10:17 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> On Fri, 11 Oct 2024 09:26:42 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > minor comment tweak The fix looks good. Added notes about the test test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 103: > 101: } > 102: } > 103: if (waitCount > 50) { Is 50 is enough here? (like in "Xcomp" mode) the cycle above exits after 1000 iterations. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 109: > 107: } > 108: } > 109: System.out.println("control has finished: " + notifyCount); Could you please update logging to use `log` or `System.out.println` in all cases? test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 43: > 41: #endif > 42: > 43: #endif This is copy of some old .c code. you don't need it in .cpp test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 45: > 43: #endif > 44: > 45: static jvmtiEnv *jvmti = NULL; NULL -> nullptr test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 49: > 47: static jvmtiEventCallbacks callbacks; > 48: static volatile jint popCount = 0; > 49: static char* lastNotifyMethod; it's accessed from different threads. should be volative at least (but better would be be use atomic). The same for `popCount` and `failed` test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 76: > 74: jclass cls = NULL; > 75: char* csig = NULL; > 76: char* name = NULL; NULL -> nullptr test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 83: > 81: check_jvmti_status(jni, err, "FramePop: Failed in JVMTI GetMethodDeclaringClass"); > 82: > 83: err =jvmti->GetClassSignature(cls, &csig, NULL); NULL -> nullptr test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 93: > 91: LOG("ERROR: FramePop event is for wrong method: expected %s, got %s\n", lastNotifyMethod, name); > 92: failed = JNI_TRUE; > 93: fatal(jni, "DBG: FramePop event in wrong method\n"); looks like "DBG" is leftover from other test? test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 161: > 159: if (isMain) { > 160: if (seenMain) { > 161: return JNI_FALSE; // Only do NotifyFramePop once for main() `deallocate(jvmti, jni, name);` test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 169: > 167: err= jvmti->NotifyFramePop(thread, 0); > 168: if (err == JVMTI_ERROR_OPAQUE_FRAME || err == JVMTI_ERROR_DUPLICATE) { > 169: return JNI_FALSE; `deallocate(jvmti, jni, name);` ------------- PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2370871906 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802134354 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802134738 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802135343 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802136401 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802138245 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802138433 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802138857 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802140636 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802144857 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802145015 From amenkov at openjdk.org Wed Oct 16 00:40:11 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 16 Oct 2024 00:40:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Fri, 11 Oct 2024 09:26:42 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > minor comment tweak test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 26: > 24: /** > 25: * @test > 26: * @summary Verifies NotifyFramePop request is cleared if JVMTI_EVENT_FRAME_POP is disabled Summary does not look correct test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 37: > 35: public class NotifyFramePopStressTest { > 36: static volatile boolean done = false; > 37: static volatile int notifyCount = 0; don't need to be volatile (actually it can be local in `control` method) test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 129: > 127: > 128: private static int foo() { > 129: return fetchInt(); The test checks name of the method being popped. I think it would be better to call different methods from `foo()` and `bar()` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802157865 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802159018 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802157540 From cjplummer at openjdk.org Wed Oct 16 00:52:11 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 16 Oct 2024 00:52:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Tue, 15 Oct 2024 23:43:16 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 103: > >> 101: } >> 102: } >> 103: if (waitCount > 50) { > > Is 50 is enough here? (like in "Xcomp" mode) the cycle above exits after 1000 iterations. It was written to fail if the count is over 50, but it will wait up to 1000 before exiting the loop to provide a bit of debugging info. If it gets to a 1000, then the test is probably stuck. If it fail let's say at 75, then maybe the test just needs an adjustment to wait for more iterations. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 169: > >> 167: err= jvmti->NotifyFramePop(thread, 0); >> 168: if (err == JVMTI_ERROR_OPAQUE_FRAME || err == JVMTI_ERROR_DUPLICATE) { >> 169: return JNI_FALSE; > > `deallocate(jvmti, jni, name);` Also add a LOG similar to the one below that is done if successful. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802168851 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802166576 From sspitsyn at openjdk.org Wed Oct 16 01:10:55 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:10:55 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v3] In-Reply-To: References: Message-ID: <9g1Q-1dxGmdV6ixxkKWsezGmK6faRcMyftc1QZfPCuc=.db46f285-48ea-4dd0-b6bc-e315bdcc90d6@github.com> > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: addressed comments from Chris: test tweaks, minor function name correction ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/c68625be..e4e54f9e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=01-02 Stats: 11 lines in 4 files changed: 0 ins; 4 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Wed Oct 16 01:16:23 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:16:23 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Tue, 15 Oct 2024 23:44:08 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 109: > >> 107: } >> 108: } >> 109: System.out.println("control has finished: " + notifyCount); > > Could you please update logging to use `log` or `System.out.println` in all cases? Good suggestion. Changed to use `log()` in all cases. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802196907 From duke at openjdk.org Wed Oct 16 01:18:23 2024 From: duke at openjdk.org (duke) Date: Wed, 16 Oct 2024 01:18:23 GMT Subject: Withdrawn: 8337517: Redacted Heap Dumps In-Reply-To: References: Message-ID: On Wed, 31 Jul 2024 19:10:41 GMT, Henry Lin wrote: > Adds a command line option `-redact` to `jcmd` and `-XX:+HeapDumpRedacted` enabling redacted heap dumps. When enabled, the output binary heap dump has zeroes written out in place of the original primitive values in the object fields. There is a new jtreg test `heapDumpRedactedTest.java` that tests that the fields are properly redacted. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20409 From sspitsyn at openjdk.org Wed Oct 16 01:27:19 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:27:19 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Tue, 15 Oct 2024 23:45:15 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 43: > >> 41: #endif >> 42: >> 43: #endif > > This is copy of some old .c code. you don't need it in .cpp Thanks, removed obsolete code. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 45: > >> 43: #endif >> 44: >> 45: static jvmtiEnv *jvmti = NULL; > > NULL -> nullptr Thanks. Fixed all occurrences. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 76: > >> 74: jclass cls = NULL; >> 75: char* csig = NULL; >> 76: char* name = NULL; > > NULL -> nullptr Fixed. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 83: > >> 81: check_jvmti_status(jni, err, "FramePop: Failed in JVMTI GetMethodDeclaringClass"); >> 82: >> 83: err =jvmti->GetClassSignature(cls, &csig, NULL); > > NULL -> nullptr Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802204640 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802206054 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802206722 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802206932 From sspitsyn at openjdk.org Wed Oct 16 01:40:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:40:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Tue, 15 Oct 2024 23:55:52 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 93: > >> 91: LOG("ERROR: FramePop event is for wrong method: expected %s, got %s\n", lastNotifyMethod, name); >> 92: failed = JNI_TRUE; >> 93: fatal(jni, "DBG: FramePop event in wrong method\n"); > > looks like "DBG" is leftover from other test? Thanks. Removed "DBG: " prefix. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 161: > >> 159: if (isMain) { >> 160: if (seenMain) { >> 161: return JNI_FALSE; // Only do NotifyFramePop once for main() > > `deallocate(jvmti, jni, name);` Fixed, thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802213563 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802214841 From sspitsyn at openjdk.org Wed Oct 16 01:49:10 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:49:10 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Wed, 16 Oct 2024 00:45:17 GMT, Chris Plummer wrote: >> test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 169: >> >>> 167: err= jvmti->NotifyFramePop(thread, 0); >>> 168: if (err == JVMTI_ERROR_OPAQUE_FRAME || err == JVMTI_ERROR_DUPLICATE) { >>> 169: return JNI_FALSE; >> >> `deallocate(jvmti, jni, name);` > > Also add a LOG similar to the one below that is done if successful. Thanks. Added lines as suggested. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802219985 From sspitsyn at openjdk.org Wed Oct 16 01:53:14 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:53:14 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 00:28:40 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 26: > >> 24: /** >> 25: * @test >> 26: * @summary Verifies NotifyFramePop request is cleared if JVMTI_EVENT_FRAME_POP is disabled > > Summary does not look correct Updated the summary, thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802222317 From sspitsyn at openjdk.org Wed Oct 16 01:59:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 01:59:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 00:28:03 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 129: > >> 127: >> 128: private static int foo() { >> 129: return fetchInt(); > > The test checks name of the method being popped. > I think it would be better to call different methods from `foo()` and `bar()` Fixed, thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802226080 From sspitsyn at openjdk.org Wed Oct 16 02:02:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 02:02:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 00:30:49 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 37: > >> 35: public class NotifyFramePopStressTest { >> 36: static volatile boolean done = false; >> 37: static volatile int notifyCount = 0; > > don't need to be volatile (actually it can be local in `control` method) Good suggestion. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802227945 From sspitsyn at openjdk.org Wed Oct 16 02:13:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 02:13:11 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Tue, 15 Oct 2024 23:50:42 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> minor comment tweak > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 49: > >> 47: static jvmtiEventCallbacks callbacks; >> 48: static volatile jint popCount = 0; >> 49: static char* lastNotifyMethod; > > it's accessed from different threads. should be volative at least (but better would be be use atomic). The same for `popCount` and `failed` Thanks. Made volatile:`lastNotifyMethod` and `failed`. Renamed according to native naming convention: `popCount` => `pop_count`, `lastNotifyMethod` => `last_notify_method` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802235396 From sspitsyn at openjdk.org Wed Oct 16 02:18:10 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 02:18:10 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v2] In-Reply-To: References: <3d2Sjn0Mylfyee8ldh1NVINlrW5oxEAja8HeEU6YuRU=.73a7e634-5b65-4a52-878c-e98e60502472@github.com> Message-ID: On Wed, 16 Oct 2024 00:49:39 GMT, Chris Plummer wrote: >> test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 103: >> >>> 101: } >>> 102: } >>> 103: if (waitCount > 50) { >> >> Is 50 is enough here? (like in "Xcomp" mode) the cycle above exits after 1000 iterations. > > It was written to fail if the count is over 50, but it will wait up to 1000 before exiting the loop to provide a bit of debugging info. If it gets to a 1000, then the test is probably stuck. If it fail let's say at 75, then maybe the test just needs an adjustment to wait for more iterations. I've changed it from 50 to 100 but this can be not enough for `-Xcomp`. I've never seen it yet failed with `-Xcomp` though. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1802239003 From sspitsyn at openjdk.org Wed Oct 16 02:28:28 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 02:28:28 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: resolved comments from Alex and Chris ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/e4e54f9e..3b82454f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=02-03 Stats: 66 lines in 2 files changed: 14 ins; 27 del; 25 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Wed Oct 16 02:28:29 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 02:28:29 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v3] In-Reply-To: <9g1Q-1dxGmdV6ixxkKWsezGmK6faRcMyftc1QZfPCuc=.db46f285-48ea-4dd0-b6bc-e315bdcc90d6@github.com> References: <9g1Q-1dxGmdV6ixxkKWsezGmK6faRcMyftc1QZfPCuc=.db46f285-48ea-4dd0-b6bc-e315bdcc90d6@github.com> Message-ID: On Wed, 16 Oct 2024 01:10:55 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: addressed comments from Chris: test tweaks, minor function name correction Chris and Alex, I believe that I've resolved all comments from you. Please, let me know if anything is still missed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21468#issuecomment-2415594359 From dholmes at openjdk.org Wed Oct 16 06:23:12 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 16 Oct 2024 06:23:12 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v3] In-Reply-To: References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> Message-ID: <_Lz4FqcQaQ7_HhbNu6zM6tVkxlEW2Jy3-69VdGi7KLo=.d04c2358-54ec-49a3-90ea-4fdf4af3c61a@github.com> On Fri, 11 Oct 2024 06:43:33 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas 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 12 additional commits since the last revision: > > - Merge tag 'jdk-24+19' into JDK-8341692 > > Added tag jdk-24+19 for changeset e7c5bf45 > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments > - Remove XCollectedHeap from HSDB > - Fix typo in TestZUncommitEvent.java > - Add missing problem-listing > - ... and 2 more: https://git.openjdk.org/jdk/compare/5efb98a4...e58b4c5a I skimmed everything and it seems okay to me. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2371314286 From alanb at openjdk.org Wed Oct 16 06:31:22 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 06:31:22 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 22:15:45 GMT, Sean Mullan wrote: >> src/java.base/share/classes/java/lang/SecurityManager.java line 72: >> >>> 70: private static class StackWalkerHolder { >>> 71: static final StackWalker STACK_WALKER = >>> 72: StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); >> >> Suggestion: >> >> StackWalker.getInstance(Set.of(Option.DROP_METHOD_INFO, Option.RETAIN_CLASS_REFERENCE)); >> >> >> Method info is not needed. > > Thanks, will fix. SecurityManager::getClassContext hasn't been needed since JDK 9 but we decided to keep the implementation in case there are older versions of logging libraries that extend SecurityManager so they can call this method. What we have not in the jep486 is okay, it would be a bit more efficient if method info is dropped, but I think mostly we want to have any remaining usages of this method to move to StackWalker. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802437558 From alanb at openjdk.org Wed Oct 16 07:01:21 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 07:01:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 22:16:27 GMT, Sean Mullan wrote: >> src/java.desktop/share/classes/java/awt/Robot.java line 433: >> >>> 431: * then a {@code SecurityException} may be thrown, >>> 432: * or the content of the returned {@code Color} is undefined. >>> 433: *

>> >> This text should not have been removed. It pertains to the desktop permissions as well as the Java SecurityManager. > > Ok, I will revert it. The description for the SecurityException thrown by these methods were adjusted to "if access to the screen is denied by desktop environment". If you bring back the paragraphs that were removed then you might have to adjust the wording a bit as otherwise the word "permissions" is ambiguous. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802471843 From dholmes at openjdk.org Wed Oct 16 07:08:24 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 16 Oct 2024 07:08:24 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v16] In-Reply-To: References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: <8O-DiOv48ck2FlSxcU0B7Q5hYUzbiNy4nzhr0WNKH0s=.9337f1a6-da8c-46d9-abe7-3115d1dba39b@github.com> On Tue, 15 Oct 2024 23:40:41 GMT, Ioi Lam wrote: >> This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). >> >> **Overview** >> >> - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. >> - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. >> - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. >> - The boot classes are loaded as part of `vmClasses::resolve_all()` >> - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). >> - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. >> >> **All-or-nothing Loading** >> >> - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. >> - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: >> - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. >> - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. >> - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. >> - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exa... > > Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: > > Fixed whitespaces Marked as reviewed by dholmes (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20843#pullrequestreview-2371393445 From alanb at openjdk.org Wed Oct 16 08:03:17 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 08:03:17 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 22:58:33 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run src/java.base/share/classes/java/lang/VirtualThread.java line 221: > 219: vthread.notifyJvmtiStart(); > 220: > 221: vthread.run(task); This doesn't look right, it needs to use try-finally. src/java.base/share/classes/java/lang/VirtualThread.java line 423: > 421: } > 422: > 423: } finally { This means an empty finally block, I assume you'll remove the try-finally here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802558723 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802559933 From alanb at openjdk.org Wed Oct 16 08:08:16 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 08:08:16 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 9 Oct 2024 22:58:33 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run src/java.base/share/classes/java/lang/VirtualThread.java line 219: > 217: public void run() { > 218: // notify JVMTI > 219: vthread.notifyJvmtiStart(); The notifyJvmtiMount and notifyJvmtiUnmount (native) methods already have the annotations. Is it really required on the caller too? I'm wondering if the comment on JvmtiMountTransition needs to be expanded to explain this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802569291 From alanb at openjdk.org Wed Oct 16 08:37:20 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 08:37:20 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 18:57:11 GMT, Phil Race wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/java.desktop/share/classes/java/awt/AWTPermission.java line 39: > >> 37: * @apiNote >> 38: * This permission cannot be used for controlling access to resources anymore >> 39: * as the Security Manager is no longer supported. > > After this JEP is integrated, I expect to deprecate AWTPermission, probably for removal JEP 486 lists deprecating the permission classes as future work. It would be very disruptive to do this now, but will be a lot easier once the JEP is integrated and the post-JEP tasks to remove the hundreds of usages in the JDK. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802617206 From rkennke at openjdk.org Wed Oct 16 09:01:34 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 09:01:34 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v42] In-Reply-To: References: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> Message-ID: <9pMfQtqoAkkOP0pYjYrqozV1umS5A-BYo2a0GsNcihA=.7779b1c5-993c-4c60-9b65-31fb3c57e659@github.com> On Tue, 15 Oct 2024 21:30:13 GMT, Volodymyr Paprotski wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix aarch64.ad > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 414: > >> 412: // to the valid haystack bytes on the stack. >> 413: { >> 414: const Register haystack = rbx; > > Keep `rax` as index for clarity? Although it is really used as a temp.. > > > const Register index = rax; > const Register haystack = rbx; > copy_to_stack(haystack, haystack_len, false, index , XMM_TMP1, _masm); I'll use rax as tmp, then. const Register tmp = rax; const Register haystack = rbx; copy_to_stack(haystack, haystack_len, false, tmp , XMM_TMP1, _masm); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802659159 From rkennke at openjdk.org Wed Oct 16 09:05:32 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 09:05:32 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v42] In-Reply-To: References: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> Message-ID: On Tue, 15 Oct 2024 22:09:54 GMT, Volodymyr Paprotski wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix aarch64.ad > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 1659: > >> 1657: Label L_moreThan8, L_moreThan16, L_moreThan24, L_adjustHaystack; >> 1658: >> 1659: assert(arrayOopDesc::base_offset_in_bytes(isU ? T_CHAR : T_BYTE) >= 8, > > If we had to also optimize for header-size 16, it might be possible to remove one jump here. Looks correct for either size. Yeah. The old code optimized for header-size >= 16. But given that compact headers will soon become the default, I don't think it's worth optimizing for the old header layout. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802665723 From kevinw at openjdk.org Wed Oct 16 09:12:56 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 16 Oct 2024 09:12:56 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames [v2] In-Reply-To: References: Message-ID: > Man page update for jcmd. > > Add updates for the filename options/arguments affected by: > 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID > > Also: > In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. > > In Description: > Each diagnostic command has its own set of options and arguments . > > Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. > > Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. Kevin Walls 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: - Update JFR commands for FILE - Merge remote-tracking branch 'upstream/master' into 8337276_jcmd_pid_manpage - 8337276: jcmd man page update for PID in output filenames ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20401/files - new: https://git.openjdk.org/jdk/pull/20401/files/c971843d..7d077a79 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20401&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20401&range=00-01 Stats: 290428 lines in 3285 files changed: 242467 ins; 29684 del; 18277 mod Patch: https://git.openjdk.org/jdk/pull/20401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20401/head:pull/20401 PR: https://git.openjdk.org/jdk/pull/20401 From kevinw at openjdk.org Wed Oct 16 09:12:56 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 16 Oct 2024 09:12:56 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames In-Reply-To: References: Message-ID: <7XUe1-il-asTCSx7afurftue8oYjbc2Ug-UGFUlLpHM=.c04dc8ad-64be-45a8-af40-5084652813ef@github.com> On Wed, 31 Jul 2024 08:30:47 GMT, Kevin Walls wrote: > Man page update for jcmd. > > Add updates for the filename options/arguments affected by: > 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID > > Also: > In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. > > In Description: > Each diagnostic command has its own set of options and arguments . > > Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. > > Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. Updating. Since JDK-8338405, JFR.dump, JFR.start, JFR.stop also now use FILE. JFR items already mention %t and %p, but we don't really want the man page and the live jcmd help giving diffrent information, so say "FILE" in the man page. (We may come back here again for JDK-8204681 if we add a more general timetamp in output filename feature.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/20401#issuecomment-2416191111 From rkennke at openjdk.org Wed Oct 16 09:16:36 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 09:16:36 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v42] In-Reply-To: References: <5x48SX55xY_BRxqqcTTvGp_ocrKDH7t5VuJY-MDQuTA=.eed6083d-e2dc-4888-a2d5-b6934f098289@github.com> Message-ID: <0wbOnb32bfMQybp2M7vDrJpuTDCIrpKzvUy0KYGHtMU=.ec15027b-8a36-4402-ac33-330383d98e48@github.com> On Tue, 15 Oct 2024 22:31:27 GMT, Volodymyr Paprotski wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix aarch64.ad > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 1634: > >> 1632: >> 1633: >> 1634: // Copy the small (< 32 byte) haystack to the stack. Allows for vector reads without page fault > > Just to be pedantic, its `(<=32)` - this function also handles 32bytes case. > > - line 401: > > __ cmpq(haystack_len, 0x20); > __ ja(L_bigSwitchTop); > > - though line 293 (`highly_optimized_short_cases`) only seems to route16-byte cases here: > ```__ cmpq(haystack_len_p, isU ? 8 : 16);``` I am not sure what you are looking at, but line 293 reads: __ cmpq(haystack_len_p, isU ? 16 : 32); for me. IOW, it routes > 32 byte cases to `L_begin`. But the following cmp/ja also routes <= 32 byte cases there, when `needle_len > 6`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1802694667 From rkennke at openjdk.org Wed Oct 16 09:31:12 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 09:31:12 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v43] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Address comments by @vpaprotsk ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/005498b1..1fd365df Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=42 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=41-42 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From sspitsyn at openjdk.org Wed Oct 16 09:56:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 09:56:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 21:26:55 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 691: > >> 689: >> 690: if (jt->is_in_VTMS_transition()) { >> 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); > > Suggestion: > > jvf = check_and_skip_hidden_frames(true, jvf); Fixed, thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802772384 From sspitsyn at openjdk.org Wed Oct 16 10:10:15 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 10:10:15 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 08:05:20 GMT, Alan Bateman wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/java.base/share/classes/java/lang/VirtualThread.java line 219: > >> 217: public void run() { >> 218: // notify JVMTI >> 219: vthread.notifyJvmtiStart(); > > The notifyJvmtiMount and notifyJvmtiUnmount (native) methods already have the annotations. Is it really required on the caller too? I'm wondering if the comment on JvmtiMountTransition needs to be expanded to explain this. The method `java/lang/VirtualThread$VThreadContinuation$1.run()` is starting and finishing in a VTMS transition. The issue is with the JVMTI `NotifyFramePop`. We need a way to disallow adding `FramePop` event requests to its frame. I'm trying to move the `notifyJvmtiStart/notifyJvmtiEnd` calls to earlier frame to reduce a little bit the scope of VTMS transition. What is the best place to explain it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802793692 From sspitsyn at openjdk.org Wed Oct 16 10:13:13 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 10:13:13 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 08:00:48 GMT, Alan Bateman wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/java.base/share/classes/java/lang/VirtualThread.java line 423: > >> 421: } >> 422: >> 423: } finally { > > This means an empty finally block, I assume you'll remove the try-finally here. Thank you for the comment. I can move the try-finally to the method `java/lang/VirtualThread$VThreadContinuation$1.run()` if you prefer. But it will play the same role functionally. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1802799611 From rsunderbabu at openjdk.org Wed Oct 16 10:30:48 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 16 Oct 2024 10:30:48 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver [v2] In-Reply-To: References: Message-ID: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> > Passing "-Xmx1g -Xcomp" to the LingeredApp. > Testing: tier1 Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: change othervm to driver, remove -Xmx1g ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21519/files - new: https://git.openjdk.org/jdk/pull/21519/files/47c105b4..7b3c8847 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21519&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21519&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21519.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21519/head:pull/21519 PR: https://git.openjdk.org/jdk/pull/21519 From kevinw at openjdk.org Wed Oct 16 11:19:18 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Wed, 16 Oct 2024 11:19:18 GMT Subject: RFR: 8342338: Remove redundant IIOPURLTest.java Message-ID: This test has been "skipping" since IIOP was removed (jdk 9). Should be removed, no impact. ------------- Commit messages: - 8342338: Remove redundant IIOPURLTest.java Changes: https://git.openjdk.org/jdk/pull/21534/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21534&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342338 Stats: 79 lines in 1 file changed: 0 ins; 79 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21534/head:pull/21534 PR: https://git.openjdk.org/jdk/pull/21534 From coleenp at openjdk.org Wed Oct 16 12:16:34 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 16 Oct 2024 12:16:34 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v43] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 09:31:12 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Address comments by @vpaprotsk We're seeing failures in our nightly testing for tests runtime/cds/appcds/SharedBaseAddress.java and runtime/cds/SharedBaseAddress.java which I'm tracking in this bug [JDK-8340212](https://bugs.openjdk.org/browse/JDK-8340212) This patch should problem list these two tests on aarch64 when UseCompactObjectHeaders is on (if possible to be that specific), or just plain problem list it until I have a fix for it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2416647209 From stooke at openjdk.org Wed Oct 16 12:38:15 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 16 Oct 2024 12:38:15 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 23:52:35 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> clean up test code > > test/hotspot/gtest/runtime/test_os.cpp line 422: > >> 420: errno = 0; >> 421: const char* returnedBuffer = os::realpath(nosuchpath, buffer, sizeof(nosuchpath) - 2); >> 422: /* Returns ENOENT on Linux, ENAMETOOLONG on Windows */ > > Suggestion: > > /* Reports ENOENT on Linux, ENAMETOOLONG on Windows */ > > and similarly below. The difference is important, thanks - fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1803022082 From stooke at openjdk.org Wed Oct 16 12:45:14 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 16 Oct 2024 12:45:14 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 00:02:13 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> clean up test code > > test/hotspot/gtest/runtime/test_os.cpp line 413: > >> 411: >> 412: TEST_VM(os, realpath) { >> 413: /* POSIX requires that the file exists, Windows doesn't */ > > I'm not sure what this comment means. I can't fully discern from > > https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fullpath-wfullpath?view=msvc-170 > > what Windows does if the path does not exist. I can only report by example - on my local machine, Windows doesn't appear to care if the file exists or not, but according to the docs you point to, Windows **does** care if the drive letter is valid. Adding an invalid drive letter test is beyond the current scope of this test. I have expanded this comment to be more explanatory: `// POSIX requires that the file exists; ` `// Windows tests for a valid drive letter but may or may not test if the file exists.` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1803033957 From stooke at openjdk.org Wed Oct 16 12:54:48 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 16 Oct 2024 12:54:48 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v21] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: clean up comments per PR review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/b7e6043f..fbafbf07 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=20 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=19-20 Stats: 14 lines in 1 file changed: 1 ins; 0 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From stooke at openjdk.org Wed Oct 16 12:54:49 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 16 Oct 2024 12:54:49 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 00:03:32 GMT, David Holmes wrote: >> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: >> >> clean up test code > > Hi @stooke , I was away on vacation when you made the updates. > > I'm afraid I still have some issues about expected behaviour on Windows with regard to the tests. @dholmes-ora thank you for your comments. I have updated the comments (and reformatted comments and #ifdef code to match the rest of the tests source. > test/hotspot/gtest/runtime/test_os.cpp line 425: > >> 423: EXPECT_TRUE(returnedBuffer == nullptr); >> 424: #if defined(_WINDOWS) >> 425: EXPECT_TRUE(errno == ENAMETOOLONG); > > Why is this the case? Our implementation does not set it and `_fullpath` makes no mention of it. This is Windows behaviour - Windows 10 with VS 2022 at least. The existence of a file is not checked, but that non-existent filename better fit into the given buffer! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20683#issuecomment-2416757362 PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1803043747 From stooke at openjdk.org Wed Oct 16 13:17:48 2024 From: stooke at openjdk.org (Simon Tooke) Date: Wed, 16 Oct 2024 13:17:48 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v22] In-Reply-To: References: Message-ID: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: clean up whitespace error ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20683/files - new: https://git.openjdk.org/jdk/pull/20683/files/fbafbf07..14679170 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=21 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20683&range=20-21 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20683.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20683/head:pull/20683 PR: https://git.openjdk.org/jdk/pull/20683 From weijun at openjdk.org Wed Oct 16 13:32:24 2024 From: weijun at openjdk.org (Weijun Wang) Date: Wed, 16 Oct 2024 13:32:24 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... `java.security.jgss`, `jdk.security.auth`, and `jdk.security.jgss` look mostly fine except for [one question](https://github.com/openjdk/jdk/pull/21498#pullrequestreview-2372476763). src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java line 31: > 29: > 30: /** > 31: * This class is for GSS security context permissions. Why is the content of _this_ class modified? I see in other permission classes the content is left unmodified. ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2372479736 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803106645 From aturbanov at openjdk.org Wed Oct 16 13:41:14 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 16 Oct 2024 13:41:14 GMT Subject: RFR: 8341436: containers/docker/TestJcmdWithSideCar.java takes needlessly long to run [v3] In-Reply-To: References: Message-ID: <0BlxZIs7lCc95XQttzPmj-v1UZSvQnXA4aUCBTwk9Vg=.3edb935f-2441-437f-af8f-243603a2eba0@github.com> On Mon, 7 Oct 2024 19:37:51 GMT, Sebastian L?vdahl wrote: >> The fix is twofold. >> >> 1. Stop the main container after an iteration is done. The main container is started with its runtime defined as 120 seconds, which means that each iteration takes 120 seconds. In reality, one iteration takes a few seconds while 115 seconds is spent waiting on the main container exiting. >> >> 2. Change the name of the main container to be unique per iteration. Containers are started with `--rm`, which means they are removed after exiting. However, the removal is done asynchronously _after_ the `stop` command has returned. This means that the second iteration may get an error if the same container name is used if the removal was not done before the container is started in the next iteration. >> >> On my machine, this cuts down the test runtime using Podman from 4m 13s to 17s. Using Docker, the runtime goes from 4m 15s to 41s. >> >> Podman only runs half the test cases (since JDK-8341310) which explain some of the difference. But there is also something strange going on in the Docker case; every `docker stop` call takes 10 seconds, and I have not been able to figure out what exactly causes it. >> >> Doing a manual `kill [container Java process PID]` gracefully terminates the Java process and container, but `docker stop` never does. Instead, it blocks for 10 seconds before abruptly killing the process using `SIGKILL`. I confirmed this with a simplified case and both >> `strace -e 'trace=!all' docker run --init eclipse-temurin:23 java ..` and `strace -e 'trace=!all' docker run eclipse-temurin:23 java ..`, no signals were ever visible when calling either `docker stop` or `docker kill`. >> >> https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ and "What is PID 1 and why does it matter?" talks about why [`--init`](https://docs.docker.com/reference/cli/docker/container/run/#init) is supposed to help. > > Sebastian L?vdahl has updated the pull request incrementally with one additional commit since the last revision: > > Have EventGeneratorLoop end after a more predictable duration test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java line 176: > 174: // 1. mount /tmp from the main container using --volumes-from. > 175: // 2. access /tmp from the main container via /proc//root/tmp. > 176: private static OutputAnalyzer runSideCar(MainContainer mainContainer, AttachStrategy attachStrategy, boolean elevated, String whatToRun, String... args) throws Exception { Suggestion: private static OutputAnalyzer runSideCar(MainContainer mainContainer, AttachStrategy attachStrategy, boolean elevated, String whatToRun, String... args) throws Exception { ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21331#discussion_r1803124755 From rkennke at openjdk.org Wed Oct 16 13:46:25 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 13:46:25 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v43] In-Reply-To: References: Message-ID: <-8DXPgoraRNtE7uJw-Pdk5Z3eJAzIbhVRJOX5JH85UY=.358823f0-a30f-4994-b566-cdf064eac8f0@github.com> On Wed, 16 Oct 2024 12:13:32 GMT, Coleen Phillimore wrote: > We're seeing failures in our nightly testing for tests runtime/cds/appcds/SharedBaseAddress.java and runtime/cds/SharedBaseAddress.java which I'm tracking in this bug [JDK-8340212](https://bugs.openjdk.org/browse/JDK-8340212) > > This patch should problem list these two tests on aarch64 when UseCompactObjectHeaders is on (if possible to be that specific), or just plain problem list it until I have a fix for it. Thanks for pointing this out. I've problem-listed both tests on aarch64. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2416881886 From rkennke at openjdk.org Wed Oct 16 13:46:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 13:46:24 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v44] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Problem-list SharedBaseAddress tests on aarch64 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/1fd365df..ec42f4d6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=43 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=42-43 Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From alanb at openjdk.org Wed Oct 16 14:41:11 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 14:41:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 10:10:16 GMT, Serguei Spitsyn wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 423: >> >>> 421: } >>> 422: >>> 423: } finally { >> >> This means an empty finally block, I assume you'll remove the try-finally here. > > Thank you for the comment. I can move the try-finally to the method `java/lang/VirtualThread$VThreadContinuation$1.run()` if you prefer. But it will play the same role functionally. Changing the run method to vthread.notifyJvmtiStart(); try { vthread.run(task); } finally { vthread.notifyJvmtiEnd(); } is okay. I was initially puzzled because the run method is already`@Hidden` but I don't think this is used by JVMTI. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803248925 From alanb at openjdk.org Wed Oct 16 14:53:15 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 14:53:15 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 10:07:31 GMT, Serguei Spitsyn wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 219: >> >>> 217: public void run() { >>> 218: // notify JVMTI >>> 219: vthread.notifyJvmtiStart(); >> >> The notifyJvmtiMount and notifyJvmtiUnmount (native) methods already have the annotations. Is it really required on the caller too? I'm wondering if the comment on JvmtiMountTransition needs to be expanded to explain this. > > The method `java/lang/VirtualThread$VThreadContinuation$1.run()` is starting and finishing in a VTMS transition. The issue is with the JVMTI `NotifyFramePop`. We need a way to disallow adding `FramePop` event requests to its frame because such requests cause problems because they are not used to post a `FramePop` events nor they are properly cleared. The annotation `@JvmtiMountTransition` is needed to help with this. I'm trying to move the `notifyJvmtiStart()/notifyJvmtiEnd()` calls to earlier frame to reduce a little bit the scope of VTMS transition. What do you think is the best place to explain it? Would placed a comment before annotation `@JvmtiMountTransition` for method `java/lang/VirtualThread$VThreadContinuation$1.run()` good enough? No issue from me on moving the notifications to the run method. My comment was more for the JvmtiMountTransition's class description as it's not easy to audit the use of this annotation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803270431 From coleenp at openjdk.org Wed Oct 16 15:32:42 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 16 Oct 2024 15:32:42 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v44] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 13:46:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Problem-list SharedBaseAddress tests on aarch64 Marked as reviewed by coleenp (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2372873633 From duke at openjdk.org Wed Oct 16 15:34:24 2024 From: duke at openjdk.org (ExE Boss) Date: Wed, 16 Oct 2024 15:34:24 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 06:28:03 GMT, Alan Bateman wrote: >> Thanks, will fix. > > SecurityManager::getClassContext hasn't been needed since JDK 9 but we decided to keep the implementation in case there are older versions of logging libraries that extend SecurityManager so they can call this method. What we have currently in the jep486 is okay, it would be a bit more efficient if method info is dropped, but I think mostly we want to have any remaining usages of this method to move to StackWalker. **SLF4J** currently?depends on?this?method when?logger?name mismatch?detection is?enabled. -------------------------------------------------------------------------------- See?also: - https://github.com/qos-ch/slf4j/pull/271#issuecomment-1288128565 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803352590 From coleenp at openjdk.org Wed Oct 16 15:45:34 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 16 Oct 2024 15:45:34 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v44] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 13:46:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Problem-list SharedBaseAddress tests on aarch64 src/hotspot/share/oops/compressedKlass.cpp line 185: > 183: #endif > 184: > 185: DEBUG_ONLY(sanity_check_after_initialization();) This is here twice. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1803363047 From alanb at openjdk.org Wed Oct 16 15:56:26 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 16 Oct 2024 15:56:26 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 15:31:49 GMT, ExE Boss wrote: >> SecurityManager::getClassContext hasn't been needed since JDK 9 but we decided to keep the implementation in case there are older versions of logging libraries that extend SecurityManager so they can call this method. What we have currently in the jep486 is okay, it would be a bit more efficient if method info is dropped, but I think mostly we want to have any remaining usages of this method to move to StackWalker. > > **SLF4J** currently?depends on?this?method when?logger?name mismatch?detection is?enabled. > > -------------------------------------------------------------------------------- > > See?also: > - https://github.com/qos-ch/slf4j/pull/271#issuecomment-1288128565 We've had logging library maintainers on the core-libs-dev several times in the last 7+ years so I hope there is good awareness of StackWalker. SM.getClassContext is legacy, shouldn't be any reason to use it in 2024. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803388208 From rkennke at openjdk.org Wed Oct 16 16:04:21 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 16 Oct 2024 16:04:21 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v45] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Remove extra sanity check ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/ec42f4d6..e4c08780 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=44 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=43-44 Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From lmesnik at openjdk.org Wed Oct 16 16:33:18 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Wed, 16 Oct 2024 16:33:18 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver [v2] In-Reply-To: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> References: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> Message-ID: On Wed, 16 Oct 2024 10:30:48 GMT, Ramkumar Sunderbabu wrote: >> Passing "-Xmx1g -Xcomp" to the LingeredApp. >> Testing: tier1 > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > change othervm to driver, remove -Xmx1g Please check that test pass with options from CI. ------------- Marked as reviewed by lmesnik (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21519#pullrequestreview-2373050348 From cjplummer at openjdk.org Wed Oct 16 17:03:13 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 16 Oct 2024 17:03:13 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver [v2] In-Reply-To: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> References: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> Message-ID: On Wed, 16 Oct 2024 10:30:48 GMT, Ramkumar Sunderbabu wrote: >> Passing "-Xmx1g -Xcomp" to the LingeredApp. >> Testing: tier1 > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > change othervm to driver, remove -Xmx1g Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21519#pullrequestreview-2373138300 From sspitsyn at openjdk.org Wed Oct 16 17:04:10 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 17:04:10 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 14:50:43 GMT, Alan Bateman wrote: >> The method `java/lang/VirtualThread$VThreadContinuation$1.run()` is starting and finishing in a VTMS transition. The issue is with the JVMTI `NotifyFramePop`. We need a way to disallow adding `FramePop` event requests to its frame because such requests cause problems because they are not used to post a `FramePop` events nor they are properly cleared. The annotation `@JvmtiMountTransition` is needed to help with this. I'm trying to move the `notifyJvmtiStart()/notifyJvmtiEnd()` calls to earlier frame to reduce a little bit the scope of VTMS transition. What do you think is the best place to explain it? Would placed a comment before annotation `@JvmtiMountTransition` for method `java/lang/VirtualThread$VThreadContinuation$1.run()` good enough? > > No issue from me on moving the notifications to the run method. My comment was more for the JvmtiMountTransition's class description as it's not easy to audit the use of this annotation. Got it, thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803494459 From sspitsyn at openjdk.org Wed Oct 16 17:18:12 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 17:18:12 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 21:21:07 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiExport.cpp line 1814: > >> 1812: } >> 1813: // pure continuations have no VTMS transitions but they use methods annotated with JvmtiMountTransition >> 1814: if ((mh->jvmti_mount_transition() && state->is_virtual()) || thread->is_in_any_VTMS_transition()) { > > Could you please explain the change (and other similar changes in jvmtiExport.cpp) > Before events were not posted for any `@JvmtiMountTransition` methods, and now only for virtual threads? I.e. events for `@JvmtiMountTransition` methods of carrier threads are posted? Good question. Some `jvmtiNotify*` notifications can be called in a context of carrier thread and exited in a context of virtual thread and vice versa. So, you are right we should not post these events for `@JvmtiMountTransition` methods, in a context of carrier threads. So, we need to adjust these conditions even more with something like below: - if ((mh->jvmti_mount_transition() && state->is_virtual()) || thread->is_in_any_VTMS_transition()) { + if ((mh->jvmti_mount_transition() && (state->is_virtual() || thread->last_continuation() == nullptr)) || + thread->is_in_any_VTMS_transition()) { return; // no events should be posted if thread is in any VTMS transition } The check for `thread->last_continuation() == nullptr` will help to skip these events for carrier threads as well but won't skip them for pure continuations. In fact, I do not like the complexity of this check. :( ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803512093 From joehw at openjdk.org Wed Oct 16 18:03:23 2024 From: joehw at openjdk.org (Joe Wang) Date: Wed, 16 Oct 2024 18:03:23 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <8MHic1Yb7xtxtU0HM8yKLAjD2pYzTWs6Z6G-Adsqcvg=.e5ea6cd4-c3bd-44cb-9b9c-c87ed2f3d0b7@github.com> On Mon, 14 Oct 2024 13:52:24 GMT, Sean Mullan wrote: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Changes in source src/java.xml, JAXP tests under test/jaxp, look good. I double-checked my notes on the test changes, they were mostly about removing the runs with Security Manager. ------------- Marked as reviewed by joehw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2373273367 From cjplummer at openjdk.org Wed Oct 16 18:20:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 16 Oct 2024 18:20:10 GMT Subject: RFR: 8342338: Remove redundant IIOPURLTest.java In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 11:14:44 GMT, Kevin Walls wrote: > This test has been "skipping" since IIOP was removed (jdk 9). Should be removed, no impact. Marked as reviewed by cjplummer (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21534#pullrequestreview-2373312903 From amenkov at openjdk.org Wed Oct 16 18:25:13 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 16 Oct 2024 18:25:13 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: <7kc-gU5npzVYw5K5U3Dk8TG9aUJIaxt6vyc73FLYyYI=.f0583411-545f-46b8-a064-e00c19143849@github.com> On Wed, 16 Oct 2024 02:28:28 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: resolved comments from Alex and Chris Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2373324281 From amenkov at openjdk.org Wed Oct 16 18:28:12 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 16 Oct 2024 18:28:12 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 02:28:28 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: resolved comments from Alex and Chris test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 160: > 158: err= jvmti->NotifyFramePop(thread, 0); > 159: if (err == JVMTI_ERROR_OPAQUE_FRAME || err == JVMTI_ERROR_DUPLICATE) { > 160: LOG("\nNotifyFramePop for method %d returned acceptable error: %s\n", name, TranslateError(err)); format for 1st arg (name) should be `%s` Suggestion: LOG("\nNotifyFramePop for method %s returned acceptable error: %s\n", name, TranslateError(err)); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803604095 From mdonovan at openjdk.org Wed Oct 16 18:52:52 2024 From: mdonovan at openjdk.org (Matthew Donovan) Date: Wed, 16 Oct 2024 18:52:52 GMT Subject: RFR: 8341927: Remove hardcoded SunJCE provider Message-ID: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> In this PR, I removed hard-coded security providers and replaced them with a system property, test.provider.name. If the property is not specified, the provider originally used in the test is used: Cipher c = Cipher.getInstance("AES/GCM/NoPadding", System.getProperty("test.provider.name", "SunJCE")); ------------- Commit messages: - 8341927: Remove hardcoded SunJCE provider Changes: https://git.openjdk.org/jdk/pull/21551/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21551&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341927 Stats: 974 lines in 224 files changed: 281 ins; 0 del; 693 mod Patch: https://git.openjdk.org/jdk/pull/21551.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21551/head:pull/21551 PR: https://git.openjdk.org/jdk/pull/21551 From mullan at openjdk.org Wed Oct 16 20:17:23 2024 From: mullan at openjdk.org (Sean Mullan) Date: Wed, 16 Oct 2024 20:17:23 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: <1Xk9_Kdo4soB1blDFYc7dL29K5w4Vzj5TFyICKG9Ryw=.bb2b91df-3119-47a4-a6e6-c52d9aa27190@github.com> On Wed, 16 Oct 2024 15:53:33 GMT, Alan Bateman wrote: >> **SLF4J** currently?depends on?this?method when?logger?name mismatch?detection is?enabled. >> >> -------------------------------------------------------------------------------- >> >> See?also: >> - https://github.com/qos-ch/slf4j/pull/271#issuecomment-1288128565 > > We've had logging library maintainers on the core-libs-dev several times in the last 7+ years so I hope there is good awareness of StackWalker. SM.getClassContext is legacy, shouldn't be any reason to use it in 2024. Ok, I'll also add an API note to `getClassContext()` to use `StackWalker` instead. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803740577 From duke at openjdk.org Wed Oct 16 20:42:31 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Wed, 16 Oct 2024 20:42:31 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v45] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 16:04:21 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Remove extra sanity check Looks good to me (reviewed just `src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp`) Thanks! ------------- Marked as reviewed by vpaprotsk at github.com (no known OpenJDK username). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2373635524 From mullan at openjdk.org Wed Oct 16 20:45:38 2024 From: mullan at openjdk.org (Sean Mullan) Date: Wed, 16 Oct 2024 20:45:38 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 06:58:40 GMT, Alan Bateman wrote: >> Ok, I will revert it. > > The description for the SecurityException thrown by these methods were adjusted to "if access to the screen is denied by desktop environment". If you bring back the paragraphs that were removed then you might have to adjust the wording a bit as otherwise the word "permissions" is ambiguous. Phil, if you have better wording for the `@throws SecurityException` of these methods, let me know; otherwise I will restore the paragraph above and below and keep the current text for `SecurityException` the same as it is now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803774792 From mullan at openjdk.org Wed Oct 16 20:54:21 2024 From: mullan at openjdk.org (Sean Mullan) Date: Wed, 16 Oct 2024 20:54:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 13:28:47 GMT, Weijun Wang wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java line 31: > >> 29: >> 30: /** >> 31: * This class is for GSS security context permissions. > > Why is the content of _this_ class modified? I see in other permission classes the content is left unmodified. In general, I tried to remove any text from the Permission classes that described behavior if the permissions were granted. So in the above I removed the text because it had words like "protect" and "accessed" and referred to `com.sun.security.jgss.ExtendedGSSContext#inquireSecContext` which no longer does a permission check. I also added the API Note to make it clear the permission could no longer be used to control access. If there are other Permission classes you think should have their text modified or removed, let me know. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1803784698 From sspitsyn at openjdk.org Wed Oct 16 21:35:13 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 21:35:13 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 08:00:12 GMT, Alan Bateman wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/java.base/share/classes/java/lang/VirtualThread.java line 221: > >> 219: vthread.notifyJvmtiStart(); >> 220: >> 221: vthread.run(task); > > This doesn't look right, it needs to use try-finally. The discussion on this is on the next comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803823069 From sspitsyn at openjdk.org Wed Oct 16 21:35:14 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 21:35:14 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 14:38:13 GMT, Alan Bateman wrote: >> Thank you for the comment. I can move the try-finally to the method `java/lang/VirtualThread$VThreadContinuation$1.run()` if you prefer. But it will play the same role functionally. > > Changing the run method to > > vthread.notifyJvmtiStart(); > try { > vthread.run(task); > } finally { > vthread.notifyJvmtiEnd(); > } > > is okay. I was initially puzzled because the run method is already`@Hidden` but I don't think this is used by JVMTI. Thanks. Yes, the annotation `@Hidden` is not used by the JVMTI. It would be tricky to use it consistently. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803823267 From cjplummer at openjdk.org Wed Oct 16 22:00:18 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 16 Oct 2024 22:00:18 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 02:28:28 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: resolved comments from Alex and Chris Have you verified that the test still detects the bug? In other words, if you disabled the fix, does the test fail? I was just a bit worried that with all the changes to it, it might not be still be properly detecting the bug, and I looked in the mach5 history and don't see this test failing for a couple of weeks now. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 26: > 24: /** > 25: * @test > 26: * @summary JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning Would be good to also add an `@bug` statement. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 84: > 82: deallocate(jvmti, jni, name); > 83: deallocate(jvmti, jni, (void*)last_notify_method); > 84: fatal(jni, "FramePop event in wrong method\n"); This is the main purpose for this test. It used to just set `failed` and then continue to run to detect additional errors, and then java side of the test calls `failed()` to detect the failure. Now you exit the test process when there is a failure. There is actually no purpose served for the `failed` flag anymore. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 99: > 97: res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_9); > 98: if (res != JNI_OK || jvmti == nullptr) { > 99: LOG("GetEnv(JVMTI_VERSION_9) failedL error(%d)", res); Suggestion: LOG("GetEnv(JVMTI_VERSION_9) failed: error(%d)", res); ------------- PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2373700405 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803809612 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803839032 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803826652 From cjplummer at openjdk.org Wed Oct 16 22:18:14 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 16 Oct 2024 22:18:14 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames [v2] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 09:12:56 GMT, Kevin Walls wrote: >> Man page update for jcmd. >> >> Add updates for the filename options/arguments affected by: >> 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID >> >> Also: >> In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. >> >> In Description: >> Each diagnostic command has its own set of options and arguments . >> >> Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. >> >> Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. > > Kevin Walls 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: > > - Update JFR commands for FILE > - Merge remote-tracking branch 'upstream/master' into 8337276_jcmd_pid_manpage > - 8337276: jcmd man page update for PID in output filenames src/jdk.jcmd/share/man/jcmd.1 line 974: > 972: \f[I]filename\f[R]: (Optional) Name of the shared archive to be dumped. > 973: If %p is specified in the filename, it is expanded to the JVM\[aq]s PID. > 974: (FILE, \[dq]java_pid%p_.jsa\[dq]) The paragraph below this goes into details on how the default path is generated even though it is implied by the above help. We don't do this extra explanation for other places where the filename has a default, so probably not needed here, but I suppose it doesn't hurt either. Also, two paragraphs below is a discussions about absolute paths that also applies to all other uses of filename. If it is necessary here, then that implies it is necessary in the other locations too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20401#discussion_r1803858444 From sspitsyn at openjdk.org Wed Oct 16 22:38:11 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 16 Oct 2024 22:38:11 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 21:59:41 GMT, Serguei Spitsyn wrote: >> src/hotspot/share/prims/jvmtiEnvBase.cpp line 692: >> >>> 690: if (jt->is_in_VTMS_transition()) { >>> 691: jvf = check_and_skip_hidden_frames(jt->is_in_VTMS_transition(), jvf); >>> 692: } else if (is_virtual) { // filter out pure continuations >> >> Not sure I follow the logic here. >> As far as I understand yield/yield need to be filtered out only for unmounted virtual threads. But `is_virtual` here means we have mounted VT? >> Looks like almost all callers call this method only if `jt->is_in_JTMS_transilition()` is true >> Exception is a call from `get_vthread_jvf()` when vthread is mounted. > > This seems to be a good catch. The call to `skip_top_jvmti_annotated_frames()` should not be needed. > It does not harm either, so I've added it for safety. > Will remove it and rerun mach5 tiers to make sure there is nothing unexpected. Please, hold on. My last comment was not fully incorrect. Not only `yield()/yield0()` need to be filtered out for virtual threads. There are more cases for a `JavaThread` which is not in a VTMS transition executing a virtual thread. All the calls below represents inconsistency and must be hidden: - `notifyJvmtiStart()`: This function is called in a VTMS MOUNT transition which it ends. So its return happens with the thread identity `VIRTUAL`. - `notifyJvmtiEnd()`: This function is called with the thread identity `VIRTUAL`. It is starting a VTMS UNMOUNT transition, so its return happens in a VTMS transition. - `notifyJvmtiMount(false)`: This call happens in a VTMS transition. It finishes the VTMS transition and its return happen with the thread identity 'VIRTUAL'. - `notifyJvmtiUnmount(true)`: This call happens with the thread identity 'VIRTUAL'. It starts a VTMS UNMOUNT transition, so its return happens in a VTMS transition. I've just discovered that we have two more cases to hide frames for carrier threads that are NOT in a VTMS transitions: - `notifyJvmtiMount(true)`: This call happens with the thread identity `CARRIER`. It starts a VTMS MOUNT transition, so its return happens in a VTMS transition. - `notifyJvmtiUnmount(false)`: This call happens in a VTMS UNMOUNT transition. It finishes transition, so its return happens with the thread identity `CARRIER`. An update is needed for these two cases. All the cases above can be potentially observed at a safepoint/handshake in a non-transitioned state. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1803874831 From amenkov at openjdk.org Wed Oct 16 22:39:12 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Wed, 16 Oct 2024 22:39:12 GMT Subject: RFR: 8342338: Remove redundant IIOPURLTest.java In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 11:14:44 GMT, Kevin Walls wrote: > This test has been "skipping" since IIOP was removed (jdk 9). Should be removed, no impact. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21534#pullrequestreview-2373803823 From sspitsyn at openjdk.org Thu Oct 17 00:49:23 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 00:49:23 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 21:36:02 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: resolved comments from Alex and Chris > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 99: > >> 97: res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_9); >> 98: if (res != JNI_OK || jvmti == nullptr) { >> 99: LOG("GetEnv(JVMTI_VERSION_9) failedL error(%d)", res); > > Suggestion: > > LOG("GetEnv(JVMTI_VERSION_9) failed: error(%d)", res); Thanks, fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803965649 From dholmes at openjdk.org Thu Oct 17 00:51:25 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 17 Oct 2024 00:51:25 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v22] In-Reply-To: References: Message-ID: <-t3ExBCWpxExd61f5HpzxvdFnAF3yG_vfwh7u_na6I8=.09807a1c-6c28-4007-8d7b-172391865a4d@github.com> On Wed, 16 Oct 2024 13:17:48 GMT, Simon Tooke wrote: >> This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). >> >> This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). >> >> The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. >> >> Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp > > Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: > > clean up whitespace error Marked as reviewed by dholmes (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20683#pullrequestreview-2373927879 From dholmes at openjdk.org Thu Oct 17 00:51:26 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 17 Oct 2024 00:51:26 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v20] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 12:49:34 GMT, Simon Tooke wrote: >> test/hotspot/gtest/runtime/test_os.cpp line 425: >> >>> 423: EXPECT_TRUE(returnedBuffer == nullptr); >>> 424: #if defined(_WINDOWS) >>> 425: EXPECT_TRUE(errno == ENAMETOOLONG); >> >> Why is this the case? Our implementation does not set it and `_fullpath` makes no mention of it. > > This is Windows behaviour - Windows 10 with VS 2022 at least. The existence of a file is not checked, but that non-existent filename better fit into the given buffer! Okay. This behaviour is not specified but the test passed on our CI on Windows Server 2016 and 2019. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1803965341 From sspitsyn at openjdk.org Thu Oct 17 00:53:18 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 00:53:18 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: <3Av7YLB236vlrbJjE38hZ91dj8_fIs3uB7VUD3IKnwM=.030427c4-87f8-490d-9e82-a2d599e143c0@github.com> On Wed, 16 Oct 2024 21:16:53 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: resolved comments from Alex and Chris > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java line 26: > >> 24: /** >> 25: * @test >> 26: * @summary JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning > > Would be good to also add an `@bug` statement. Thanks. Added @bug line. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803967533 From sspitsyn at openjdk.org Thu Oct 17 01:00:18 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 01:00:18 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 21:50:19 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: resolved comments from Alex and Chris > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 84: > >> 82: deallocate(jvmti, jni, name); >> 83: deallocate(jvmti, jni, (void*)last_notify_method); >> 84: fatal(jni, "FramePop event in wrong method\n"); > > This is the main purpose for this test. It used to just set `failed` and then continue to run to detect additional errors, and then java side of the test calls `failed()` to detect the failure. Now you exit the test process when there is a failure. There is actually no purpose served for the `failed` flag anymore. > Have you verified that the test still detects the bug? In other words, if you disabled the fix, does the test fail? I was just a bit worried that with all the changes to it, it might not be still be properly detecting the bug, and I looked in the mach5 history and don't see this test failing for a couple of weeks now. The test is failing locally with event in a wrong method as expected. But the latest changes broke the test. Now it is failing at `deallocate(jvmti, jni, csig)`. I suspect it is related to the latest changes for `last_notify_method` but have not proved it yet. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803970580 From sspitsyn at openjdk.org Thu Oct 17 01:00:19 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 01:00:19 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: <_6ruhHPFGx8cuBC9HW3kKVEhMmBjLfodszknBr5GniE=.feb866ba-4c3e-4dad-bb1e-82f508d35d4e@github.com> On Thu, 17 Oct 2024 00:55:58 GMT, Serguei Spitsyn wrote: >> test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 84: >> >>> 82: deallocate(jvmti, jni, name); >>> 83: deallocate(jvmti, jni, (void*)last_notify_method); >>> 84: fatal(jni, "FramePop event in wrong method\n"); >> >> This is the main purpose for this test. It used to just set `failed` and then continue to run to detect additional errors, and then java side of the test calls `failed()` to detect the failure. Now you exit the test process when there is a failure. There is actually no purpose served for the `failed` flag anymore. > >> Have you verified that the test still detects the bug? In other words, if you disabled the fix, does the test fail? I was just a bit worried that with all the changes to it, it might not be still be properly detecting the bug, and I looked in the mach5 history and don't see this test failing for a couple of weeks now. > > The test is failing locally with event in a wrong method as expected. > But the latest changes broke the test. Now it is failing at `deallocate(jvmti, jni, csig)`. > I suspect it is related to the latest changes for `last_notify_method` but have not proved it yet. > This is the main purpose for this test. It used to just set failed and then continue to run to detect additional errors, and then java side of the test calls failed() to detect the failure. Now you exit the test process when there is a failure. There is actually no purpose served for the failed flag anymore. Okay, I'll try to remove `fatal()` and retest it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1803971275 From sspitsyn at openjdk.org Thu Oct 17 02:33:01 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 02:33:01 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review test tweaks: add @bug tag; a reliability update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/3b82454f..dc457681 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=03-04 Stats: 12 lines in 2 files changed: 4 ins; 3 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From alanb at openjdk.org Thu Oct 17 05:57:21 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 17 Oct 2024 05:57:21 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: <1Xk9_Kdo4soB1blDFYc7dL29K5w4Vzj5TFyICKG9Ryw=.bb2b91df-3119-47a4-a6e6-c52d9aa27190@github.com> References: <1Xk9_Kdo4soB1blDFYc7dL29K5w4Vzj5TFyICKG9Ryw=.bb2b91df-3119-47a4-a6e6-c52d9aa27190@github.com> Message-ID: <2YtkErzuokjAVm0p8GOt4-nAmWQt2vNo6WU70ObWcZo=.41863526-1125-452f-aed0-44daccb7fead@github.com> On Wed, 16 Oct 2024 20:14:07 GMT, Sean Mullan wrote: >> We've had logging library maintainers on the core-libs-dev several times in the last 7+ years so I hope there is good awareness of StackWalker. SM.getClassContext is legacy, shouldn't be any reason to use it in 2024. > > Ok, I'll also add an API note to `getClassContext()` to use `StackWalker` instead. Okay, it already has `@see StackWalker`. My guess is that anything extending SM to call getClassContext is very old code. If that old code is compiled with JDK 17+ then they should get a warning. In any case, we replaced the implementation to use StackWalker so getClassContext will continue to work until the SM class is removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1804151450 From duke at openjdk.org Thu Oct 17 07:16:16 2024 From: duke at openjdk.org (duke) Date: Thu, 17 Oct 2024 07:16:16 GMT Subject: RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v22] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 13:17:48 GMT, Simon Tooke wrote: >> This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). >> >> This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). >> >> The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. >> >> Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp > > Simon Tooke has updated the pull request incrementally with one additional commit since the last revision: > > clean up whitespace error @stooke Your change (at version 1467917002d5efd11ebbdb8825cb0e4789b9225c) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20683#issuecomment-2418745864 From kevinw at openjdk.org Thu Oct 17 08:04:16 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 17 Oct 2024 08:04:16 GMT Subject: RFR: 8342338: Remove redundant IIOPURLTest.java In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 11:14:44 GMT, Kevin Walls wrote: > This test has been "skipping" since IIOP was removed (jdk 9). Should be removed, no impact. Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21534#issuecomment-2418837171 From kevinw at openjdk.org Thu Oct 17 08:04:17 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 17 Oct 2024 08:04:17 GMT Subject: Integrated: 8342338: Remove redundant IIOPURLTest.java In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 11:14:44 GMT, Kevin Walls wrote: > This test has been "skipping" since IIOP was removed (jdk 9). Should be removed, no impact. This pull request has now been integrated. Changeset: 8862ca07 Author: Kevin Walls URL: https://git.openjdk.org/jdk/commit/8862ca076f9be1c0b5f4bc2639ab9c1f60de308c Stats: 79 lines in 1 file changed: 0 ins; 79 del; 0 mod 8342338: Remove redundant IIOPURLTest.java Reviewed-by: cjplummer, amenkov ------------- PR: https://git.openjdk.org/jdk/pull/21534 From stooke at openjdk.org Thu Oct 17 08:09:25 2024 From: stooke at openjdk.org (Simon Tooke) Date: Thu, 17 Oct 2024 08:09:25 GMT Subject: Integrated: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows In-Reply-To: References: Message-ID: On Thu, 22 Aug 2024 18:36:39 GMT, Simon Tooke wrote: > This PR changes the status of realpath() from a Posix-specific API to a globally available API, i.e. adding it to the "Hotspot Porting API". Code would refer to os::realpath() instead of os::Posix::realpath(). > > This requires a Windows implementation of realpath(), using Windows _fullpath(), and renaming os::Posix::realpath() to os::realpath(). > > The main difference between POSIX and Windows behaviour is that POSIX actually requires an existing accessible file, while Windows will happily work with made-up filenames. > > Please note that guidelines for doing this appear in src/hotspot/share/runtime/os.hpp This pull request has now been integrated. Changeset: 7a64fbbb Author: Simon Tooke URL: https://git.openjdk.org/jdk/commit/7a64fbbb9292f4d65a6970206dec1a7d7645046b Stats: 133 lines in 11 files changed: 109 ins; 10 del; 14 mod 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows Reviewed-by: dholmes, stuefe, jwaters ------------- PR: https://git.openjdk.org/jdk/pull/20683 From sspitsyn at openjdk.org Thu Oct 17 09:13:51 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 09:13:51 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v4] In-Reply-To: References: Message-ID: <21dTiM5lJRCrNIKslnwjIZB4AQBGLiGjPYg4Qckw4OM=.17fa4363-2f09-49eb-898d-47ce71fb0107@github.com> > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: tweaked disabler for carrier threads; more hiddenjvmti_mount_transition frames ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/3317ea81..0ad3fd7a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=02-03 Stats: 45 lines in 3 files changed: 16 ins; 17 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sspitsyn at openjdk.org Thu Oct 17 09:16:31 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 09:16:31 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v5] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: moved notifyJvmtiStart/notifyJvmtiEnd calls from VirtualThread.run to the caller ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/0ad3fd7a..f8d05152 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=03-04 Stats: 20 lines in 2 files changed: 0 ins; 5 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From mli at openjdk.org Thu Oct 17 10:07:35 2024 From: mli at openjdk.org (Hamlin Li) Date: Thu, 17 Oct 2024 10:07:35 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v43] In-Reply-To: <-8DXPgoraRNtE7uJw-Pdk5Z3eJAzIbhVRJOX5JH85UY=.358823f0-a30f-4994-b566-cdf064eac8f0@github.com> References: <-8DXPgoraRNtE7uJw-Pdk5Z3eJAzIbhVRJOX5JH85UY=.358823f0-a30f-4994-b566-cdf064eac8f0@github.com> Message-ID: On Wed, 16 Oct 2024 13:42:42 GMT, Roman Kennke wrote: >> We're seeing failures in our nightly testing for tests runtime/cds/appcds/SharedBaseAddress.java and runtime/cds/SharedBaseAddress.java which I'm tracking in this bug [JDK-8340212](https://bugs.openjdk.org/browse/JDK-8340212) >> >> This patch should problem list these two tests on aarch64 when UseCompactObjectHeaders is on (if possible to be that specific), or just plain problem list it until I have a fix for it. > >> We're seeing failures in our nightly testing for tests runtime/cds/appcds/SharedBaseAddress.java and runtime/cds/SharedBaseAddress.java which I'm tracking in this bug [JDK-8340212](https://bugs.openjdk.org/browse/JDK-8340212) >> >> This patch should problem list these two tests on aarch64 when UseCompactObjectHeaders is on (if possible to be that specific), or just plain problem list it until I have a fix for it. > > Thanks for pointing this out. I've problem-listed both tests on aarch64. @rkennke Here is the [riscv implementation](https://github.com/rkennke/jdk/compare/JDK-8305895-v4...rivosinc:jdk-compact-2:compact-header-riscv?expand=1#diff-5808bc502bdf55f1ae7ba30504c8ee6eb92527f0c11670a35d6279d671b52c6bR271), could you help to include it in this pr? Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2419103904 From duke at openjdk.org Thu Oct 17 10:36:14 2024 From: duke at openjdk.org (duke) Date: Thu, 17 Oct 2024 10:36:14 GMT Subject: RFR: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver [v2] In-Reply-To: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> References: <2W5k0luFAQlvL7CHOruTy7IAT0LM4EkA4_lyboCki0M=.37c62f45-f251-4f5b-87e0-1918c8657a0a@github.com> Message-ID: <75ucx7V8fP7CjAj65aFAqq6W1U_qaAMl7Klx6otIDtg=.c88742bf-1424-4d87-bdf1-6360936f8bc4@github.com> On Wed, 16 Oct 2024 10:30:48 GMT, Ramkumar Sunderbabu wrote: >> Passing "-Xmx1g -Xcomp" to the LingeredApp. >> Testing: tier1 > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > change othervm to driver, remove -Xmx1g @rsunderbabu Your change (at version 7b3c8847d388c75bece32645d51399399a9e92ef) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21519#issuecomment-2419163375 From rkennke at openjdk.org Thu Oct 17 10:57:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 17 Oct 2024 10:57:24 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Compact header riscv (#3) Implement compact headers on RISCV --------- Co-authored-by: hamlin ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/e4c08780..1b907cc8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=45 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=44-45 Stats: 136 lines in 10 files changed: 76 ins; 31 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From alanb at openjdk.org Thu Oct 17 10:58:20 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 17 Oct 2024 10:58:20 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 17:01:38 GMT, Serguei Spitsyn wrote: >> No issue from me on moving the notifications to the run method. My comment was more for the JvmtiMountTransition's class description as it's not easy to audit the use of this annotation. > > Got it, thanks. The updated changes to VirtualThread look fine. I'm still wondering about JvmtiMountTransition's class description. There's nothing obvious in yield and yield0 that they start/end a VTMS. Maybe for a future PR but I think the description could be expanded as the same questions will come up each time that anything using this annotation changes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1804553428 From weijun at openjdk.org Thu Oct 17 11:27:23 2024 From: weijun at openjdk.org (Weijun Wang) Date: Thu, 17 Oct 2024 11:27:23 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 20:51:49 GMT, Sean Mullan wrote: >> src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java line 31: >> >>> 29: >>> 30: /** >>> 31: * This class is for GSS security context permissions. >> >> Why is the content of _this_ class modified? I see in other permission classes the content is left unmodified. > > In general, I tried to remove any text from the Permission classes that described behavior if the permissions were granted. So in the above I removed the text because it had words like "protect" and "accessed" and referred to `com.sun.security.jgss.ExtendedGSSContext#inquireSecContext` which no longer does a permission check. I also added the API Note to make it clear the permission could no longer be used to control access. > > If there are other Permission classes you think should have their text modified or removed, let me know. All JGSS permission classes follow the same style: In `javax.security.auth.kerberos.DelegationPermission`: * This class is used to restrict the usage of the Kerberos * delegation model, ie: forwardable and proxiable tickets. ``` In `javax.security.auth.kerberos.DelegationPermission`: * This class is used to restrict the usage of the Kerberos * delegation model, ie: forwardable and proxiable tickets. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1804590136 From tschatzl at openjdk.org Thu Oct 17 12:35:37 2024 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Thu, 17 Oct 2024 12:35:37 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin Mostly only looked at gc files. ------------- Marked as reviewed by tschatzl (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2375093923 From yzheng at openjdk.org Thu Oct 17 13:07:32 2024 From: yzheng at openjdk.org (Yudi Zheng) Date: Thu, 17 Oct 2024 13:07:32 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: <1Bg-C0suC9IfxXU-2Yw5pvXwySVaEFCg6EpiVgsSw70=.f6f0d596-b465-4137-99de-fba8236e8908@github.com> On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin JVMCI changes look good! ------------- Marked as reviewed by yzheng (Committer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2375182126 From rsunderbabu at openjdk.org Thu Oct 17 14:38:23 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Thu, 17 Oct 2024 14:38:23 GMT Subject: Integrated: 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 10:12:21 GMT, Ramkumar Sunderbabu wrote: > Passing "-Xmx1g -Xcomp" to the LingeredApp. > Testing: tier1 This pull request has now been integrated. Changeset: d915ac2a Author: Ramkumar Sunderbabu Committer: Leonid Mesnik URL: https://git.openjdk.org/jdk/commit/d915ac2abda9ff4cd8c7a628f08d7964bcf3f472 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8339871: serviceability/sa/TestDebugInfoDecode.java should be driver Reviewed-by: cjplummer, lmesnik ------------- PR: https://git.openjdk.org/jdk/pull/21519 From sspitsyn at openjdk.org Thu Oct 17 15:44:16 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 15:44:16 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: <09K5FdOPqPuBS_V-2vF_Nl3nUIcdvXcjcGG_c3ZbyXk=.7d4908fd-e657-4277-99ee-ae651a0da19d@github.com> On Thu, 17 Oct 2024 02:33:01 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review test tweaks: add @bug tag; a reliability update Alex and Chris, thank you a lot for review and comments! Need a re-approval from you for integration. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21468#issuecomment-2419894743 From sspitsyn at openjdk.org Thu Oct 17 15:44:20 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 15:44:20 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: <_6ruhHPFGx8cuBC9HW3kKVEhMmBjLfodszknBr5GniE=.feb866ba-4c3e-4dad-bb1e-82f508d35d4e@github.com> References: <_6ruhHPFGx8cuBC9HW3kKVEhMmBjLfodszknBr5GniE=.feb866ba-4c3e-4dad-bb1e-82f508d35d4e@github.com> Message-ID: <3bcalYUPl07gyas5jERmqH6tbVAbHtwzCOHEhSqLpPg=.bacd6509-733b-4aa6-9529-33ad52b2d45b@github.com> On Thu, 17 Oct 2024 00:57:12 GMT, Serguei Spitsyn wrote: >>> Have you verified that the test still detects the bug? In other words, if you disabled the fix, does the test fail? I was just a bit worried that with all the changes to it, it might not be still be properly detecting the bug, and I looked in the mach5 history and don't see this test failing for a couple of weeks now. >> >> The test is failing locally with event in a wrong method as expected. >> But the latest changes broke the test. Now it is failing at `deallocate(jvmti, jni, csig)`. >> I suspect it is related to the latest changes for `last_notify_method` but have not proved it yet. > >> This is the main purpose for this test. It used to just set failed and then continue to run to detect additional errors, and then java side of the test calls failed() to detect the failure. Now you exit the test process when there is a failure. There is actually no purpose served for the failed flag anymore. > > Okay, I'll try to remove `fatal()` and retest it. Fixed the test and re-tested. It looks good now. Mach5 tiers 1-6 are passed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805011968 From sspitsyn at openjdk.org Thu Oct 17 15:44:21 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 15:44:21 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v4] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 18:25:46 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: resolved comments from Alex and Chris > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 160: > >> 158: err= jvmti->NotifyFramePop(thread, 0); >> 159: if (err == JVMTI_ERROR_OPAQUE_FRAME || err == JVMTI_ERROR_DUPLICATE) { >> 160: LOG("\nNotifyFramePop for method %d returned acceptable error: %s\n", name, TranslateError(err)); > > format for 1st arg (name) should be `%s` > Suggestion: > > LOG("\nNotifyFramePop for method %s returned acceptable error: %s\n", name, TranslateError(err)); Thanks. I've also discovered and fixed it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805014234 From sspitsyn at openjdk.org Thu Oct 17 15:56:18 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 15:56:18 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v5] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 09:16:31 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: moved notifyJvmtiStart/notifyJvmtiEnd calls from VirtualThread.run to the caller I believe, I've resolved almost all review comments. Please, let me know if anything is missed or there are some issues in my latest updates. The mach5 tiers 1-6 are good. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21397#issuecomment-2419922957 From sspitsyn at openjdk.org Thu Oct 17 15:56:20 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 15:56:20 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v3] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 21:26:26 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 588: > >> 586: // There should not be any VTMS transition here. This is for safety. >> 587: if (java_thread->is_in_VTMS_transition()) { >> 588: jvf = JvmtiEnvBase::check_and_skip_hidden_frames(java_thread, jvf); > > The code now checks `java_thread->is_in_VTMS_transition()`, so it may be simplified to > Suggestion: > > jvf = JvmtiEnvBase::check_and_skip_hidden_frames(true, jvf); Thank you for the comment. Unfortunately, with my latest update it is not relevant anymore. > src/hotspot/share/prims/jvmtiEnvBase.cpp line 753: > >> 751: // Skip hidden frames only for carrier threads >> 752: // which are in non-temporary VTMS transition. >> 753: jvf = check_and_skip_hidden_frames(jt, jvf); > > Can be > Suggestion: > > jvf = check_and_skip_hidden_frames(true, jvf); Thank you for the comment. Unfortunately, with my latest update it is not relevant anymore. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1805031938 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1805032070 From kevinw at openjdk.org Thu Oct 17 15:59:17 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 17 Oct 2024 15:59:17 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames [v2] In-Reply-To: References: Message-ID: <0kHkeULIoGx9dIFezrlO04UaHlu8BI1kWpNi32bduOg=.69f957b3-1f79-4750-b2cd-5257b708e109@github.com> On Wed, 16 Oct 2024 22:15:05 GMT, Chris Plummer wrote: >> Kevin Walls 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: >> >> - Update JFR commands for FILE >> - Merge remote-tracking branch 'upstream/master' into 8337276_jcmd_pid_manpage >> - 8337276: jcmd man page update for PID in output filenames > > src/jdk.jcmd/share/man/jcmd.1 line 974: > >> 972: \f[I]filename\f[R]: (Optional) Name of the shared archive to be dumped. >> 973: If %p is specified in the filename, it is expanded to the JVM\[aq]s PID. >> 974: (FILE, \[dq]java_pid%p_.jsa\[dq]) > > The paragraph below this goes into details on how the default path is generated even though it is implied by the above help. We don't do this extra explanation for other places where the filename has a default, so probably not needed here, but I suppose it doesn't hurt either. > > Also, two paragraphs below is a discussions about absolute paths that also applies to all other uses of filename. If it is necessary here, then that implies it is necessary in the other locations too. Yes - both of those paragraphs are _not_very_ useful. "If `filename` is not specified, a default file name is chosen using the pid..." - this explains how the default filename works. " If `filename` is not specified as an absolute path, the archive file is created in a directory relative to.." -- Well yes, we are saying that is if it's not absolute, it's relative... Hmm... This does not add much value either. The good thing is these are not in the live help output, so deleting them does not make the help any more inconsistent. I think these can both be removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20401#discussion_r1805040920 From kevinw at openjdk.org Thu Oct 17 16:12:26 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 17 Oct 2024 16:12:26 GMT Subject: RFR: 8337276: jcmd man page update for PID in output filenames [v3] In-Reply-To: References: Message-ID: <-QbZdgT3weWFl9ZbNsf_CTxTcTf1c6A9OK1_F0uSFEk=.7bbad5c6-c546-4c7e-a578-3b804bc96ca8@github.com> > Man page update for jcmd. > > Add updates for the filename options/arguments affected by: > 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID > > Also: > In the initial "command" summary, remove the text about "If the pid is 0.." as it is completely duplicated very shortly afterwards in the COMMANDS FOR JCMD section. > > In Description: > Each diagnostic command has its own set of options and arguments . > > Added "options and" because arguments and options are different and this can still be confusing. Mentioning them as being different may help. > > Similarly, added a short section describing that jcmds "may take options and arguments" and further spelling out that options are name=value and arguments are not, as this can still be confusing. Kevin Walls has updated the pull request incrementally with one additional commit since the last revision: VM.cds remove unnecessary text ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20401/files - new: https://git.openjdk.org/jdk/pull/20401/files/7d077a79..9c39c6c9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20401&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20401&range=01-02 Stats: 8 lines in 1 file changed: 0 ins; 8 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20401/head:pull/20401 PR: https://git.openjdk.org/jdk/pull/20401 From mullan at openjdk.org Thu Oct 17 18:03:17 2024 From: mullan at openjdk.org (Sean Mullan) Date: Thu, 17 Oct 2024 18:03:17 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 11:24:56 GMT, Weijun Wang wrote: >> In general, I tried to remove any text from the Permission classes that described behavior if the permissions were granted. So in the above I removed the text because it had words like "protect" and "accessed" and referred to `com.sun.security.jgss.ExtendedGSSContext#inquireSecContext` which no longer does a permission check. I also added the API Note to make it clear the permission could no longer be used to control access. >> >> If there are other Permission classes you think should have their text modified or removed, let me know. > > All JGSS permission classes follow the same style: > > In `javax.security.auth.kerberos.DelegationPermission`: > > * This class is used to restrict the usage of the Kerberos > * delegation model, ie: forwardable and proxiable tickets. > ``` > In `javax.security.auth.kerberos.DelegationPermission`: > > * This class is used to restrict the usage of the Kerberos > * delegation model, ie: forwardable and proxiable tickets. I assume for the second one above you mean `javax.security.auth.kerberos.ServicePermission`. These classes still have a lot of words like "grant" and "trust". I will make some changes to the class descriptions of those classes, please review them in the next update. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1805188374 From amenkov at openjdk.org Thu Oct 17 20:31:39 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 17 Oct 2024 20:31:39 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 02:33:01 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review test tweaks: add @bug tag; a reliability update test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 62: > 60: jmethodID method, jboolean wasPoppedByException) { > 61: jvmtiError err; > 62: char* expected_method = (char*)last_notify_method; I don't think caching `last_notify_method` adds any reliability. `notifyFramePop` deallocates the memory. test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 87: > 85: } > 86: deallocate(jvmti, jni, csig); > 87: deallocate(jvmti, jni, name); on error `csig` and `name` are deallocated twice test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 171: > 169: } else { > 170: char* old_notify_method = (char*)last_notify_method; > 171: last_notify_method = name; I don't think this adds reliability. Control thread suspends main test thread before call this method. AFAIU suspend cannot complete before FramePop callback is completed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805369268 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805370875 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805388024 From cjplummer at openjdk.org Thu Oct 17 21:22:23 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 17 Oct 2024 21:22:23 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 20:27:13 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review test tweaks: add @bug tag; a reliability update > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 171: > >> 169: } else { >> 170: char* old_notify_method = (char*)last_notify_method; >> 171: last_notify_method = name; > > I don't think this adds reliability. > Control thread suspends main test thread before call this method. AFAIU suspend cannot complete before FramePop callback is completed. Yes, this is all very synchronous. The control thread suspends the thread, we call NotifyFramePop on the thread, the control thread resumes the thread and then waits for confirmation of the FRAME_POP before repeating the process. I'm not sure what motivated the change to add old_notify_method. Maybe there was some other issue that was misunderstood. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805444716 From wkemper at openjdk.org Thu Oct 17 21:41:45 2024 From: wkemper at openjdk.org (William Kemper) Date: Thu, 17 Oct 2024 21:41:45 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 21:21:57 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 396: >> >>> 394: } >>> 395: >>> 396: inline bool ShenandoahHeap::is_old(oop obj) const { >> >> What is the difference between this method and the above is_in_old()? Why does it need to check that active generation is young? > > This is just a bad, confusing method name. I'll fix this. https://bugs.openjdk.org/browse/JDK-8342560 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1805475522 From amenkov at openjdk.org Thu Oct 17 21:53:56 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 17 Oct 2024 21:53:56 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> On Thu, 17 Oct 2024 21:18:23 GMT, Chris Plummer wrote: >> test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 171: >> >>> 169: } else { >>> 170: char* old_notify_method = (char*)last_notify_method; >>> 171: last_notify_method = name; >> >> I don't think this adds reliability. >> Control thread suspends main test thread before call this method. AFAIU suspend cannot complete before FramePop callback is completed. > > Yes, this is all very synchronous. The control thread suspends the thread, we call NotifyFramePop on the thread, the control thread resumes the thread and then waits for confirmation of the FRAME_POP before repeating the process. I'm not sure what motivated the change to add old_notify_method. Maybe there was some other issue that was misunderstood. Control thread waits until pop_count is updated and FramePop callback updates it at the beginning, so control thread can start next iteration (i.e. call SuspentThread) before FramePop is completed. But my understanding that SuspentThread cannot return before FramePop completed, so there is no synchronization issues here ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805488341 From cjplummer at openjdk.org Thu Oct 17 22:01:46 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 17 Oct 2024 22:01:46 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> References: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> Message-ID: On Thu, 17 Oct 2024 21:50:39 GMT, Alex Menkov wrote: >> Yes, this is all very synchronous. The control thread suspends the thread, we call NotifyFramePop on the thread, the control thread resumes the thread and then waits for confirmation of the FRAME_POP before repeating the process. I'm not sure what motivated the change to add old_notify_method. Maybe there was some other issue that was misunderstood. > > Control thread waits until pop_count is updated and FramePop callback updates it at the beginning, so control thread can start next iteration (i.e. call SuspentThread) before FramePop is completed. > But my understanding that SuspentThread cannot return before FramePop completed, so there is no synchronization issues here Actually I'm not so sure of your last statement. I think while in the FramePop callback the thread can do things that allow it to be suspended. So if the control thread has already detected that FramePop callback has been called, it may move on to the next iteration before the FramePop callback completes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805493986 From sspitsyn at openjdk.org Thu Oct 17 22:50:32 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 22:50:32 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v6] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: remake the reliability update with a raw monitor ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/dc457681..c2eb37d1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=04-05 Stats: 10 lines in 1 file changed: 4 ins; 4 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Thu Oct 17 22:50:33 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 22:50:33 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 20:08:44 GMT, Alex Menkov wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review test tweaks: add @bug tag; a reliability update > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 62: > >> 60: jmethodID method, jboolean wasPoppedByException) { >> 61: jvmtiError err; >> 62: char* expected_method = (char*)last_notify_method; > > I don't think caching `last_notify_method` adds any reliability. > `notifyFramePop` deallocates the memory. Agreed, thanks. Please, see my comment below. > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 87: > >> 85: } >> 86: deallocate(jvmti, jni, csig); >> 87: deallocate(jvmti, jni, name); > > on error `csig` and `name` are deallocated twice Agreed, thanks. Removed the deallocation on error. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805537772 PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805538666 From sspitsyn at openjdk.org Thu Oct 17 23:11:22 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 23:11:22 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v7] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: no need in raw monitor - removed ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/c2eb37d1..9a08d9cc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=05-06 Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Thu Oct 17 23:15:55 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 23:15:55 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> Message-ID: On Thu, 17 Oct 2024 21:58:18 GMT, Chris Plummer wrote: >> Control thread waits until pop_count is updated and FramePop callback updates it at the beginning, so control thread can start next iteration (i.e. call SuspentThread) before FramePop is completed. >> But my understanding that SuspentThread cannot return before FramePop completed, so there is no synchronization issues here > > Actually I'm not so sure of your last statement. I think while in the FramePop callback the thread can do things that allow it to be suspended. So if the control thread has already detected that FramePop callback has been called, it may move on to the next iteration before the FramePop callback completes. Agreed, thanks. The suspend should happen in the `ThreadInVMfromJava()` destructor that is a part of the `JRT_BLOCK` macro. I've pushed the fix now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805571025 From cjplummer at openjdk.org Thu Oct 17 23:21:30 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 17 Oct 2024 23:21:30 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v7] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 23:11:22 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > no need in raw monitor - removed test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 66: > 64: char* name = nullptr; > 65: > 66: pop_count++; I think there is still a concern that once this increment is done, the next iteration in control() can start. It will try to suspend this thread, which I think can happen in the 3 JVMTI calls below, and controll() will then call NotifyFramePop(), which will clobber last_notify_method. I think just moving this increment to the end will resolve that issue, or at least move it to after the last_notify_method reference. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805577010 From sspitsyn at openjdk.org Thu Oct 17 23:21:30 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 23:21:30 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> Message-ID: On Thu, 17 Oct 2024 23:11:34 GMT, Serguei Spitsyn wrote: >> Actually I'm not so sure of your last statement. I think while in the FramePop callback the thread can do things that allow it to be suspended. So if the control thread has already detected that FramePop callback has been called, it may move on to the next iteration before the FramePop callback completes. > > Agreed, thanks. > The interesting suspend point is in the `ThreadInVMfromJava()` destructor that is a part of the `JRT_BLOCK` macro. I've pushed the fix now. > I'm not sure what motivated the change to add old_notify_method. Maybe there was some other issue that was misunderstood. The mach5 test runs hit some strange crashes in `deallocate()` and I've made a wrong conclusion. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805579127 From sspitsyn at openjdk.org Thu Oct 17 23:28:14 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 23:28:14 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v7] In-Reply-To: References: Message-ID: <2KADrIgSlGHjNjIsQbjPHdF623k3fNF3pF2V7H8TDgM=.2e27d4f7-0e90-4550-88db-1edf1b3f0c6c@github.com> On Thu, 17 Oct 2024 23:14:50 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> no need in raw monitor - removed > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 66: > >> 64: char* name = nullptr; >> 65: >> 66: pop_count++; > > I think there is still a concern that once this increment is done, the next iteration in control() can start. It will try to suspend this thread, which I think can happen in the 3 JVMTI calls below, and controll() will then call NotifyFramePop(), which will clobber last_notify_method. I think just moving this increment to the end will resolve that issue, or at least move it to after the last_notify_method reference. I agree, it is more safe to move the increment to the end. Moved now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805583958 From sspitsyn at openjdk.org Thu Oct 17 23:35:44 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 17 Oct 2024 23:35:44 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v5] In-Reply-To: References: <0mhh437_vpQ86hZPBKWccX7aVh6CZQPaSk4jxSxLBMU=.0ec660aa-6f9b-4900-9c44-9e16cd2d946b@github.com> Message-ID: <8aCXOKQPML-IxA066wHyEd0AxRNACuHdCtyA2y3rifs=.ffa62944-7a4d-40c7-be9c-5b55c249ed94@github.com> On Thu, 17 Oct 2024 23:17:48 GMT, Serguei Spitsyn wrote: >> Agreed, thanks. >> The interesting suspend point is in the `ThreadInVMfromJava()` destructor that is a part of the `JRT_BLOCK` macro. I've pushed the fix now. > >> I'm not sure what motivated the change to add old_notify_method. Maybe there was some other issue that was misunderstood. > > The mach5 test runs hit some strange crashes in `deallocate()` and I've made a wrong conclusion. > So if the control thread has already detected that FramePop callback has been called, it may move on to the next iteration before the FramePop callback completes. This is important point to understand about the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805589349 From sspitsyn at openjdk.org Fri Oct 18 00:28:51 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 00:28:51 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v8] In-Reply-To: References: Message-ID: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: move pop_count++ to the end of FramePop handler for more safety ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/9a08d9cc..6895abbd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=06-07 Stats: 3 lines in 1 file changed: 1 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From cjplummer at openjdk.org Fri Oct 18 00:43:47 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 18 Oct 2024 00:43:47 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v8] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 00:28:51 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: move pop_count++ to the end of FramePop handler for more safety test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 73: > 71: > 72: name = get_method_name(jvmti, jni, method); > 73: LOG("FramePop(%d) event from method: %s %s\n", pop_count, csig, name); I just noticed this pop_count reference here. Probably best to change it to pop_count + 1. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805661610 From sspitsyn at openjdk.org Fri Oct 18 00:53:37 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 00:53:37 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v6] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: clarify the use of annotation @JvmtiMountTransition in yield/yield0 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/f8d05152..94862c30 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=04-05 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sspitsyn at openjdk.org Fri Oct 18 01:11:32 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 01:11:32 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v9] In-Reply-To: References: Message-ID: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: minor tweaks in test log and static vars initialization ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21468/files - new: https://git.openjdk.org/jdk/pull/21468/files/6895abbd..722fdc33 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21468&range=07-08 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21468.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21468/head:pull/21468 PR: https://git.openjdk.org/jdk/pull/21468 From sspitsyn at openjdk.org Fri Oct 18 01:11:32 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 01:11:32 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v8] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 00:40:38 GMT, Chris Plummer wrote: >> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: >> >> review: move pop_count++ to the end of FramePop handler for more safety > > test/hotspot/jtreg/serviceability/jvmti/events/NotifyFramePopStressTest/libNotifyFramePopStressTest.cpp line 73: > >> 71: >> 72: name = get_method_name(jvmti, jni, method); >> 73: LOG("FramePop(%d) event from method: %s %s\n", pop_count, csig, name); > > I just noticed this pop_count reference here. Probably best to change it to pop_count + 1. Nice catch. Fixed now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21468#discussion_r1805680619 From cjplummer at openjdk.org Fri Oct 18 01:33:03 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Fri, 18 Oct 2024 01:33:03 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v9] In-Reply-To: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> References: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> Message-ID: <1YTS85cAYTsx2b5DeZc2D9d7kvWebQfRbtchv_HW_mY=.eb2ce1ee-0a71-4002-ba03-b67b8ec27250@github.com> On Fri, 18 Oct 2024 01:11:32 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: minor tweaks in test log and static vars initialization Looks good. Thanks for all the updates to the test. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2376723248 From aboldtch at openjdk.org Fri Oct 18 06:46:22 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Fri, 18 Oct 2024 06:46:22 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v4] In-Reply-To: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> Message-ID: <0wC3rZqgWGF5Pyjs9yfUPEXpkU_Q-uYE1gUth7jGfew=.ee3e19a3-3951-4cde-ac19-b8a0b089508b@github.com> > This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Merge tag 'jdk-24+20' into JDK-8341692 Added tag jdk-24+20 for changeset 7a64fbbb - Merge tag 'jdk-24+19' into JDK-8341692 Added tag jdk-24+19 for changeset e7c5bf45 - LargeWindowPaintTest.java fix id typo - Fix problem-listed @requires typo - Fix @requires !vm.gc.Z, must use vm.gc != "Z" - Reorder z_globals options: product > diagnostic product > develop - Consistent albite special code style - Consistent order between ZArguments and GCArguments - Remove XCollectedHeap from HSDB - Fix typo in TestZUncommitEvent.java - ... and 3 more: https://git.openjdk.org/jdk/compare/7a64fbbb...76c5d0c6 ------------- Changes: https://git.openjdk.org/jdk/pull/21401/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21401&range=03 Stats: 39433 lines in 406 files changed: 155 ins; 39008 del; 270 mod Patch: https://git.openjdk.org/jdk/pull/21401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21401/head:pull/21401 PR: https://git.openjdk.org/jdk/pull/21401 From stefank at openjdk.org Fri Oct 18 07:24:40 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Fri, 18 Oct 2024 07:24:40 GMT Subject: RFR: 8341692: Implement JEP 490: ZGC: Remove the Non-Generational Mode [v4] In-Reply-To: <0wC3rZqgWGF5Pyjs9yfUPEXpkU_Q-uYE1gUth7jGfew=.ee3e19a3-3951-4cde-ac19-b8a0b089508b@github.com> References: <8f9QplKu0Rm5E0mw08AOKygdGEBnUtBlTiEZV8N8pgQ=.081af70d-9b69-429f-b0b1-7914c935c893@github.com> <0wC3rZqgWGF5Pyjs9yfUPEXpkU_Q-uYE1gUth7jGfew=.ee3e19a3-3951-4cde-ac19-b8a0b089508b@github.com> Message-ID: <-V8KgQ0UJkawIutURV9UhV1kmb8Yh4oDumTryF069cA=.0be23393-ced1-4c14-9113-bf1a819b1d9a@github.com> On Fri, 18 Oct 2024 06:46:22 GMT, Axel Boldt-Christmas wrote: >> This is the implementation task for `JEP 490: ZGC: Remove the Non-Generational Mode`. See the JEP for details. [JDK-8335850](https://bugs.openjdk.org/browse/JDK-8335850) > > Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: > > - Merge tag 'jdk-24+20' into JDK-8341692 > > Added tag jdk-24+20 for changeset 7a64fbbb > - Merge tag 'jdk-24+19' into JDK-8341692 > > Added tag jdk-24+19 for changeset e7c5bf45 > - LargeWindowPaintTest.java fix id typo > - Fix problem-listed @requires typo > - Fix @requires !vm.gc.Z, must use vm.gc != "Z" > - Reorder z_globals options: product > diagnostic product > develop > - Consistent albite special code style > - Consistent order between ZArguments and GCArguments > - Remove XCollectedHeap from HSDB > - Fix typo in TestZUncommitEvent.java > - ... and 3 more: https://git.openjdk.org/jdk/compare/7a64fbbb...76c5d0c6 Marked as reviewed by stefank (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21401#pullrequestreview-2377217619 From alanb at openjdk.org Fri Oct 18 07:57:05 2024 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 18 Oct 2024 07:57:05 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v6] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 00:53:37 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: clarify the use of annotation @JvmtiMountTransition in yield/yield0 src/java.base/share/classes/jdk/internal/vm/annotation/JvmtiMountTransition.java line 35: > 33: * The Continuation yield and yield0 frames normally are in VTMS transition > 34: * but can be found out of transition in an unmounted virtual thread. > 35: * This inconsistency is the reason why they also need this annotation. In ChangesCurrentThread, Hidden and the other annotations, the description explains where they must be used. The JvmtiMountTransition description isn't very clear as it's explain why the Continuation yield methods need the annotation. It's okay if the description is re-worked in some future PR, my comment is just that the current description is very confusing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1806047399 From amenkov at openjdk.org Fri Oct 18 18:18:53 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Fri, 18 Oct 2024 18:18:53 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v9] In-Reply-To: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> References: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> Message-ID: On Fri, 18 Oct 2024 01:11:32 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: minor tweaks in test log and static vars initialization Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21468#pullrequestreview-2378712908 From wkemper at openjdk.org Fri Oct 18 18:21:33 2024 From: wkemper at openjdk.org (William Kemper) Date: Fri, 18 Oct 2024 18:21:33 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v4] In-Reply-To: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: > This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 487 commits: - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux - 8342214: GenShen: Reduce code duplication in shFreeSet with iterator abstraction Reviewed-by: kdnilsen, ysr - 8342239: GenShen: Revert changes in adaptive heuristic to avoid overflow on 32 bit Reviewed-by: ysr - 8342278: GenShen: Move non-generational mode test out of generational test configuration Reviewed-by: ysr - 8342255: GenShen: Remove unnecessary enum initial values Reviewed-by: ysr - 8342001: GenShen: Factor cases for allocation type into separate methods Reviewed-by: ysr, kdnilsen - 8341992: GenShen: Fix formatting, remove unreachable code, unused imports and unnecessary comments Reviewed-by: ysr - Merge - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux - Fix merge error - ... and 477 more: https://git.openjdk.org/jdk/compare/3da68900...b3e4b4ca ------------- Changes: https://git.openjdk.org/jdk/pull/21273/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21273&range=03 Stats: 22819 lines in 229 files changed: 21077 ins; 890 del; 852 mod Patch: https://git.openjdk.org/jdk/pull/21273.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21273/head:pull/21273 PR: https://git.openjdk.org/jdk/pull/21273 From sspitsyn at openjdk.org Fri Oct 18 18:29:40 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 18:29:40 GMT Subject: RFR: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning [v9] In-Reply-To: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> References: <-_5H_mHfXeNGTBcdEigKzA50yEkO4kLrtKO1rhLNySE=.ef621c7a-37b2-4b36-897b-7a8ca486e655@github.com> Message-ID: On Fri, 18 Oct 2024 01:11:32 GMT, Serguei Spitsyn wrote: >> There is a race between JVMTI NotifyFramePop function and FramePop event posting code. >> The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. >> >> Testing: >> - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` >> - TBD: mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: minor tweaks in test log and static vars initialization Chris and Alex, thank you for review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21468#issuecomment-2423012469 From mullan at openjdk.org Fri Oct 18 19:03:30 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:03:30 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". - Sanitize the class descriptions of DelegationPermission and ServicePermission by removing text that refers to granting permissions, but avoid changes that affect the API specification, such as the description and format of input parameters. - Restored methods in RMIConnection to throw SecurityExceptions again but with adjusted text that avoids the word "permission". - Add text to class description of MBeanServer stating that implementations may throw SecurityException if authorization doesn't allow access to resource. - Restore text about needing permissions from the desktop environment in the getPixelColor and createScreenCapture methods. - Add api note to getClassContext to use StackWalker instead and add DROP_METHOD_INFO option to StackWalker. - Change checkAccess() methods to be no-ops, rather than throwing SecurityException. - Merge - Merge - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 ------------- Changes: https://git.openjdk.org/jdk/pull/21498/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21498&range=01 Stats: 63792 lines in 1825 files changed: 932 ins; 59211 del; 3649 mod Patch: https://git.openjdk.org/jdk/pull/21498.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21498/head:pull/21498 PR: https://git.openjdk.org/jdk/pull/21498 From sspitsyn at openjdk.org Fri Oct 18 19:38:09 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 18 Oct 2024 19:38:09 GMT Subject: Integrated: 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning In-Reply-To: References: Message-ID: On Fri, 11 Oct 2024 08:39:42 GMT, Serguei Spitsyn wrote: > There is a race between JVMTI NotifyFramePop function and FramePop event posting code. > The fix is to return JVMTI_ERROR_OPAQUE_FRAME if if a FramePop event with depth 0 is requested by NotifyFramePop at the time when the target frame is in exit epilogue, and MethodExit/FramePop events are being posted for it. > > Testing: > - verified locally with new test (developed by Chris): `serviceability/jvmti/events/NotifyFramePopStressTest` > - TBD: mach5 tiers 1-6 This pull request has now been integrated. Changeset: 85911094 Author: Serguei Spitsyn URL: https://git.openjdk.org/jdk/commit/8591109419efc8f71544a98bdb04a48cb1afc47e Stats: 340 lines in 6 files changed: 339 ins; 0 del; 1 mod 8340698: JVMTI FRAME_POP event is sometimes missed if NotifyFramePop is called as a method is returning Reviewed-by: cjplummer, amenkov ------------- PR: https://git.openjdk.org/jdk/pull/21468 From pchilanomate at openjdk.org Fri Oct 18 19:41:27 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Fri, 18 Oct 2024 19:41:27 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning Message-ID: This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. In order to make the code review easier the changes have been split into the following initial 4 commits: - Changes to allow unmounting a virtual thread that is currently holding monitors. - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. - Changes to tests, JFR pinned event, and other changes in the JDK libraries. The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. ## Summary of changes ### Unmount virtual thread while holding monitors As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. #### General notes about this part: - Since virtual threads don't need to worry about holding monitors anymore, we don't need to count them, except for `LM_LEGACY`. So the majority of the platform dependent changes in this commit have to do with correcting this. - Zero and x86 (32 bits) where counting monitors even though they don't implement continuations, so I fixed that to stop counting. The idea is to remove all the counting code once we remove `LM_LEGACY`. - Macro `LOOM_MONITOR_SUPPORT` was added at the time to exclude ports that implement continuations but don't yet implement monitor support. It is removed later with the ppc commit changes. - Since now a virtual thread can be unmounted while holding monitors, JVMTI methods `GetOwnedMonitorInfo` and `GetOwnedMonitorStackDepthInfo` had to be adapted. #### Notes specific to the tid changes: - The tid is cached in the JavaThread object under `_lock_id`. It is set on JavaThread creation and changed on mount/unmount. - Changes in the ObjectMonitor class in this commit are pretty much exclusively related to changing `_owner` and `_succ` from `void*` and `JavaThread*` respectively to `int64_t`. - Although we are not trying to fix `LM_LEGACY` the tid changes apply to it as well since the inflated path is shared. Thus, in case of inflation by a contending thread, the `BasicLock*` cannot be stored in the `_owner` field as before. The `_owner` is instead set to anonymous as we do in `LM_LIGHTWEIGHT`, and the `BasicLock*` is stored in the new field `_stack_locker`. - We already assume 32 bit platforms can handle 64 bit atomics, including `cmpxchg` ([JDK-8318776](https://bugs.openjdk.org/browse/JDK-8318776)) so the shared code can stay the same. The assembly code for the c2 fast paths has to be adapted though. On arm (32bits) we already jump directly to the slow path on inflated monitor case so there is nothing to do. For x86 (32bits), since the port is moving towards deprecation ([JDK-8338285](https://bugs.openjdk.org/browse/JDK-8338285)) there is no point in trying to optimize, so the code was changed to do the same thing we do for arm (32bits). ### Unmounting a virtual thread blocked on synchronized Currently virtual thread unmounting is always started from Java, either because of a voluntarily call to `Thread.yield()` or because of performing some blocking operation such as I/O. Now we allow to unmount from inside the VM too, specifically when facing contention trying to acquire a Java monitor. On failure to acquire a monitor inside `ObjectMonitor::enter` a virtual thread will call freeze to copy all Java frames to the heap. We will add the virtual thread to the ObjectMonitor's queue and return back to Java. Instead of continue execution in Java though, the virtual thread will jump to a preempt stub which will clear the frames copied from the physical stack, and will return to `Continuation.run()` to proceed with the unmount logic. Once the owner releases the monitor and selects it as the next successor the virtual thread will be added again to the scheduler queue to run again. The virtual thread will run and attempt to acquire the monitor again. If it succeeds then it will thaw frames as usual to continue execution back were it left off. If it fails it will unmount and wait again to be unblocked. #### General notes about this part: - The easiest way to review these changes is to start from the monitorenter call in the interpreter and follow all the flow of the virtual thread, from unmounting to running again. - Currently we use a dedicated unblocker thread to submit the virtual threads back to the scheduler queue. This avoids calls to Java from monitorexit. We are experimenting on removing this limitation, but that will be left as an enhancement for a future change. - We cannot unmount the virtual thread when the monitor enter call is coming from `jni_enter()` or `ObjectLocker` since we would need to freeze native frames. - If freezing fails, which almost always will be due to having native frames on the stack, the virtual thread will follow the normal platform thread logic but will do a timed-park instead. This is to alleviate some deadlocks cases where the successor picked is an unmounted virtual thread that cannot run, which can happen during class loading or class initiatialization. - After freezing all frames, and while adding itself to the `_cxq` the virtual thread could?have successfully acquired the monitor. In that case we mark the preemption as cancelled. The virtual thread will still need to go back to the preempt stub to cleanup the physical stack but instead of unmounting it will call thaw to continue execution. - The way we jump to the preempt stub is slightly different in the compiler and interpreter. For the compiled case we just patch a return address, so no new code is added. For the interpreter we cannot do this on all platforms so we just check a flag back in the interpreter. For the latter we also need to manually restore some state after we finally acquire the monitor and resume execution. All that logic is contained in new assembler method `call_VM_preemptable()`. #### Notes specific to JVMTI changes: - Since we are not unmounting from Java, there is no call to `VirtualThread.yieldContinuation()`. This means that we have to execute the equivalent of `notifyJvmtiUnmount(/*hide*/true)` for unmount, and of `notifyJvmtiMount(/*hide*/false)` for mount in the VM. The former is implemented with `JvmtiUnmountBeginMark` in `Continuation::try_preempt()`. The latter is implemented in method `jvmti_mount_end()` in `ContinuationFreezeThaw` at the end of thaw. - When unmounting from Java the vthread unmount event is posted before we try to freeze the continuation. If that fails then we post the mount event. This all happens in `VirtualThread.yieldContinuation()`. When unmounting from the VM we only post the event once we know the freeze succeeded. Since at that point we are in the middle of the VTMS transition, posting the event is done in `JvmtiVTMSTransitionDisabler::VTMS_unmount_end()` after the transition finishes. Maybe the same thing should be done when unmounting from Java. ### Unmounting a virtual thread blocked on `Object.wait()` This commit just extends the previous mechanism to be able to unmount inside the VM on `ObjectMonitor::wait`. #### General notes about this part: - The mechanism works as before with the difference that now the call will come from the native wrapper. This requires to add support to the continuation code to handle native wrapper frames, which is a main part of the changes in this commit. - Both the compiled and interpreted native wrapper code will check for preemption on return from the wait call, after we have transitioned back to `_thread_in_Java`. #### Note specific to JVMTI changes: - If the monitor waited event is enabled we need to post it after the wait is done but before re-acquiring the monitor. Since the virtual thread is inside the VTMS transition at that point, we cannot do that directly. Currently in the code we end the transition, post the event and start the transition again. This is not ideal, and maybe we should unmount, post the event and then run again to try reacquire the monitor. ### Test changes + JFR Updates + Library code changes #### Tests - The tests in `java/lang/Thread/virtual` are updated to add more tests for monitor enter/exit and Object.wait/notify. New tests are added for JFR events, synchronized native methods, and stress testing for several scenarios. - `test/hotspot/gtest/nmt/test_vmatree.cpp` is changed due to an alias that conflicts. - A small number of tests, e.g.` test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java` and `test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002`, are updated so they are in sync with the JDK code. - A number of JVMTI tests are updated to fix various issues, e.g. some tests saved a JNIEnv in a static. #### Diagnosing remaining pinning issues - The diagnostic option `jdk.tracePinnedThreads` is removed. - The JFR `jdk.VirtualThreadPinned` event is changed so that it's now recorded in the VM, and for the following cases: parking when pinned, blocking in monitor enter when pinned, Object.wait when pinned, and waiting for a class to be initialized by another thread. The changes to object monitors should mean that only a few events are recorded. Future work may change this to a sampling approach. #### Other changes to VirtualThread class The VirtualThread implementation includes a few robustness changes. The `park/parkNanos` methods now park on the carrier if the freeze throws OOME. Moreover, the use of transitions is reduced so that the call out to the scheduler no longer requires a temporary transition. #### Other changes to libraries: - `ReferenceQueue` is reverted to use `synchronized`, the subclass based on `ReentrantLock` is removed. This change is done now because the changes for object monitors impact this area when there is preemption polling a reference queue. - `java.io` is reverted to use `synchronized`. This change has been important for testing virtual threads. There will be follow-up cleanup in main-line after the JEP is integrated to remove `InternalLock` and its uses in `java.io`. - The epoll and kqueue based Selectors are changed to preempt when doing blocking selects. This has been useful for testing virtual threads with some libraries, e.g. JDBC drivers. We could potentially separate this update if needed but it has been included in all testing and EA builds. - `sun.security.ssl.X509TrustManagerImpl` is changed to eagerly initialize AnchorCertificates, a forced change due to deadlocks in this code when testing. ## Testing The changes have been running in the Loom pipeline for several months now. They have also been included in EA builds throughout the year at different stages (EA builds from earlier this year did not had Object.wait() support yet but more recent ones did) so there has been some external exposure too. The current patch has been run through mach5 tiers 1-8. I'll keep running tests periodically until integration time. ------------- Commit messages: - Add PPC64 support - Test changes + JFR Updates + Library code changes - Allow virtual threads to unmount when blocked on Object.wait() - Allow virtual threads to unmount when blocked on synchronized - Allow virtual threads to unmount while holding monitors Changes: https://git.openjdk.org/jdk/pull/21565/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8338383 Stats: 9459 lines in 242 files changed: 6942 ins; 1400 del; 1117 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From dholmes at openjdk.org Fri Oct 18 19:41:28 2024 From: dholmes at openjdk.org (David Holmes) Date: Fri, 18 Oct 2024 19:41:28 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 14:28:30 GMT, Patricio Chilano Mateo wrote: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... src/hotspot/share/runtime/javaThread.hpp line 165: > 163: // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the > 164: // current _vthread object, except during creation of the primordial and JNI > 165: // attached thread cases where this field can have a temporal value. Suggestion: // attached thread cases where this field can have a temporary value. Presumably this is for when the attaching thread is executing the Thread constructor? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1805616004 From pchilanomate at openjdk.org Fri Oct 18 19:41:28 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Fri, 18 Oct 2024 19:41:28 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning In-Reply-To: References: Message-ID: <3qGV4MlDsr4MwwWUIE7w7MI3ZGhhujpzYw-1qFzGVVY=.93a8c704-3817-424e-8ac6-99b4e17ee8e4@github.com> On Fri, 18 Oct 2024 00:09:59 GMT, David Holmes wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > src/hotspot/share/runtime/javaThread.hpp line 165: > >> 163: // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the >> 164: // current _vthread object, except during creation of the primordial and JNI >> 165: // attached thread cases where this field can have a temporal value. > > Suggestion: > > // attached thread cases where this field can have a temporary value. > > Presumably this is for when the attaching thread is executing the Thread constructor? Exactly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1805830255 From mullan at openjdk.org Fri Oct 18 19:46:48 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:46:48 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <2YtkErzuokjAVm0p8GOt4-nAmWQt2vNo6WU70ObWcZo=.41863526-1125-452f-aed0-44daccb7fead@github.com> References: <1Xk9_Kdo4soB1blDFYc7dL29K5w4Vzj5TFyICKG9Ryw=.bb2b91df-3119-47a4-a6e6-c52d9aa27190@github.com> <2YtkErzuokjAVm0p8GOt4-nAmWQt2vNo6WU70ObWcZo=.41863526-1125-452f-aed0-44daccb7fead@github.com> Message-ID: On Thu, 17 Oct 2024 05:54:24 GMT, Alan Bateman wrote: >> Ok, I'll also add an API note to `getClassContext()` to use `StackWalker` instead. > > Okay, it already has `@see StackWalker`. My guess is that anything extending SM to call getClassContext is very old code. If that old code is compiled with JDK 17+ then they should get a warning. In any case, we replaced the implementation to use StackWalker so getClassContext will continue to work until the SM class is removed. Fixed in https://github.com/openjdk/jdk/pull/21498/commits/7ea65a6febd18ad8f8fa99cfbb8687e761558594 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806946629 From mullan at openjdk.org Fri Oct 18 19:46:49 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:46:49 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 20:42:11 GMT, Sean Mullan wrote: >> The description for the SecurityException thrown by these methods were adjusted to "if access to the screen is denied by desktop environment". If you bring back the paragraphs that were removed then you might have to adjust the wording a bit as otherwise the word "permissions" is ambiguous. > > Phil, if you have better wording for the `@throws SecurityException` of these methods, let me know; otherwise I will restore the paragraph above and below and keep the current text for `SecurityException` the same as it is now. I restored the text in https://github.com/openjdk/jdk/pull/21498/commits/adf5ed789b0437fa57c87f29e6a4e6b6f7f0c92b. I've left the `@throws SecurityException` text the same, but let me know if you want that changed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806948352 From mullan at openjdk.org Fri Oct 18 19:46:49 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:46:49 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 17:01:59 GMT, Sean Mullan wrote: >>> While making `LogManager.checkAccess` be a no-op might be more convenient, it could unconditionally permit operations that formerly required a permission check: clearly a bad idea. Always throwing a `SecurityException` is the safest option. >> >> It's not about convenience _or_ safety; this part of the change has a provably flawed logical basis. >> >> These methods would no longer called from within the JDK after this change. All three of these methods were already previously defined to be a no-op when no security manager was installed (specifically when `System.getSecurityManager() == null`). Since no security manager may be installed after this change, this method will always return `null`. Thus, a no-op is still the most correct behavior and does not permit any operation that previously required a permission check (since it was already a no-op any time no security manager was installed, which will now be the only possible scenario). Therefore it is provably no safer to throw `SecurityException` here, since this will only prompt library developers to introduce the workaround I posted above when their tests fail, yielding the exact same result (except with a minor inconvenience to library developers). >> >> Either way is fine (as I said, the workaround is trivial), but IMO it's best to be conscious of the correct reasoning lest flawed assumptions _do_ end up enabling the introduction of unsafe changes elsewhere in the code. We don't have to make any assumptions about safety or previous behavior because it's all statically provable. > > I see your point now. We have strived to preserve compatibility with libraries that follow well known code patterns as described in the JEP, so I will discuss this with others who are more familiar with the compatibility risk of making this change. I have changed `LogManager.checkAccess`, `Thread.checkAccess`, `ThreadGroup.checkAccess` to always do nothing. See the fixes in https://github.com/openjdk/jdk/pull/21498/commits/2ebb6de50194770658462507cee28b785fb30dbd and https://github.com/openjdk/jdk/pull/21498/commits/16e17b89b3dbce4f49706c032c315977dd54c315. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806950866 From mullan at openjdk.org Fri Oct 18 19:56:17 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:56:17 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 14:50:54 GMT, Daniel Fuchs wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnection.java line 159: > >> 157: * is specified for the MBean. >> 158: * @throws IOException if a general communication exception occurred. >> 159: * @throws UnsupportedOperationException if {@code delegationSubject} is non-null. > > Maybe we should revert those changes, or word them differently. AFAIU, is is still possible for a JMXConnectorServer to implement coarse grained authorization by setting up an `MBeanServerAccessController`, and in fact, the default JMX Agent does that. The JDK has a built-in implementation of `MBeanServerAccessController`, `MBeanServerFileAccessController`, which will throw `SecurityException` if access is denied by the `MBeanServerFileAccessController`. I believe this will result in the `RMIConnection` throwing `SecurityException` if the operation is denied by the `MBeanServerAccessController`. > > So I believe - in all methods here and in `RMIConnectionImpl`, we should leave the door open for `SecurityException` to get thrown. > > An alternative could be to cover that use case with a blanket statement, here, in `RMIConnectionImpl`, in `MBeanServer`, and in `MBeanServerConnection`. I restored the changes to `RMIConnection` to throw `SecurityException` but adjusted the text to say "is not authorized" instead of "does not have permission". See https://github.com/openjdk/jdk/pull/21498/commits/86ff71461ef1d695c02497626facda63c496a287. As we discussed offline, I also added a sentence to the `MBeanServer` class description to state that it and its subclasses may throw `SecurityException`s if the implementation doesn't authorize access to the underlying resource: https://github.com/openjdk/jdk/pull/21498/commits/44432e56a91a992150ee873e81282d1fe21e69ea. > src/java.management/share/classes/javax/management/remote/JMXAuthenticator.java line 67: > >> 65: */ >> 66: public Subject authenticate(Object credentials); >> 67: } > > Should this be reverted? Authentication has not been removed. Yes. See the fix in https://github.com/openjdk/jdk/pull/21498/commits/23a43e0d90aff8754909785f582ba0666046cf6c. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806952922 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806953524 From mullan at openjdk.org Fri Oct 18 19:56:18 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:56:18 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Tue, 15 Oct 2024 22:14:00 GMT, Sean Mullan wrote: >> src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java line 225: >> >>> 223: */ >>> 224: public static JMXConnector connect(JMXServiceURL serviceURL) >>> 225: throws IOException { >> >> I wonder if these changes should also be reverted, on the ground that a server may have authentication in place and may refuse the connection. Same below. > > Yes, good catches, I will revert some of these JMX methods that can also throw SecurityExceptions for non-SM reasons. Yes, see the fix in https://github.com/openjdk/jdk/pull/21498/commits/23a43e0d90aff8754909785f582ba0666046cf6c. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806953911 From mullan at openjdk.org Fri Oct 18 19:56:19 2024 From: mullan at openjdk.org (Sean Mullan) Date: Fri, 18 Oct 2024 19:56:19 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 17:59:20 GMT, Sean Mullan wrote: >> All JGSS permission classes follow the same style: >> >> In `javax.security.auth.kerberos.DelegationPermission`: >> >> * This class is used to restrict the usage of the Kerberos >> * delegation model, ie: forwardable and proxiable tickets. >> ``` >> In `javax.security.auth.kerberos.ServicePermission`: >> >> * This class is used to protect Kerberos services and the >> * credentials necessary to access those services. There is a one to >> >> (Updated) > > I assume for the second one above you mean `javax.security.auth.kerberos.ServicePermission`. These classes still have a lot of words like "grant" and "trust". I will make some changes to the class descriptions of those classes, please review them in the next update. See the changes I made in https://github.com/openjdk/jdk/pull/21498/commits/9dd59a12e984c347a34a25e6fd820340b1e12505. Sometimes it is difficult to remove all text about granting the permission, which is why we added the API note in all Permission subclasses stating that the permission can no longer be used to protect resources. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1806957907 From duke at openjdk.org Fri Oct 18 20:16:43 2024 From: duke at openjdk.org (David M. Lloyd) Date: Fri, 18 Oct 2024 20:16:43 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Marked as reviewed by dmlloyd at github.com (no known OpenJDK username). ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2378900585 From duke at openjdk.org Fri Oct 18 20:43:43 2024 From: duke at openjdk.org (Robert Toyonaga) Date: Fri, 18 Oct 2024 20:43:43 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: On Sat, 12 Oct 2024 18:42:34 GMT, Afshin Zafari wrote: >> Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update src/hotspot/share/utilities/vmError.cpp >> >> Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> > > Just an important test or comparison is needed here. Do you have any comparison of the performance before and after this PR change set? Even if no degrading is expected, better to test it. Hi @afshin-zafari! I haven't compared the performance yet. I can try to look into this next week. But I don't think there should be any difference because we've only switched out the lock. Maybe there would even be an improvement because the lock is less coarse (but probably not much difference since it's only locking around virtual memory, not mallocs). ------------- PR Comment: https://git.openjdk.org/jdk/pull/20852#issuecomment-2423201201 From kevinw at openjdk.org Fri Oct 18 20:54:30 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Fri, 18 Oct 2024 20:54:30 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Thanks for updating the wording on the JMX/management classes, looks good. src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java No longer has any changes other than (C), so that should be reverted also. 8-) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2423214468 From jbechberger at openjdk.org Fri Oct 18 23:41:31 2024 From: jbechberger at openjdk.org (Johannes Bechberger) Date: Fri, 18 Oct 2024 23:41:31 GMT Subject: Integrated: 8336401: Remove the option onjcmd from the jdwp agent In-Reply-To: References: Message-ID: On Mon, 7 Oct 2024 11:47:12 GMT, Johannes Bechberger wrote: > Remove the support for on-demand debugging via the onjcmd option. This pull request has now been integrated. Changeset: 309b9291 Author: Johannes Bechberger URL: https://git.openjdk.org/jdk/commit/309b929147e7dddfa27879ff31b1eaad271def85 Stats: 241 lines in 5 files changed: 0 ins; 239 del; 2 mod 8336401: Remove the option onjcmd from the jdwp agent Reviewed-by: cjplummer, mbaesken ------------- PR: https://git.openjdk.org/jdk/pull/21387 From alanb at openjdk.org Sat Oct 19 11:56:53 2024 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 19 Oct 2024 11:56:53 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 There are a couple of micro benchmarks in test/micro that fork with `jvmArgsPrepend={"-Djava.security.manager=allow"})`, they will need to be examined. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2423661302 From syan at openjdk.org Sun Oct 20 02:17:13 2024 From: syan at openjdk.org (SendaoYan) Date: Sun, 20 Oct 2024 02:17:13 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY Message-ID: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Hi all, In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. So the below test command will print error: make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" Building target 'test' in configuration 'linux-x86_64-server-release' JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. RunTests.gmk:206: *** Cannot continue. Stop. So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. ------------- Commit messages: - 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY Changes: https://git.openjdk.org/jdk/pull/21594/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21594&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342646 Stats: 5 lines in 4 files changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/21594.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21594/head:pull/21594 PR: https://git.openjdk.org/jdk/pull/21594 From stefank at openjdk.org Mon Oct 21 07:49:23 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 21 Oct 2024 07:49:23 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin The following test crashes `java/lang/StringBuffer/ECoreIndexOf.java#id1` when running with -XX:+UseCompactObjectHeaders. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2425878646 From aturbanov at openjdk.org Mon Oct 21 08:05:12 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 21 Oct 2024 08:05:12 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 14:28:30 GMT, Patricio Chilano Mateo wrote: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... test/jdk/java/lang/Thread/virtual/JfrEvents.java line 323: > 321: var started2 = new AtomicBoolean(); > 322: > 323: Thread vthread1 = Thread.ofVirtual().unstarted(() -> { Suggestion: Thread vthread1 = Thread.ofVirtual().unstarted(() -> { ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808287799 From aturbanov at openjdk.org Mon Oct 21 08:36:10 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 21 Oct 2024 08:36:10 GMT Subject: RFR: 8341927: Remove hardcoded SunJCE provider In-Reply-To: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> References: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> Message-ID: On Wed, 16 Oct 2024 18:47:44 GMT, Matthew Donovan wrote: > In this PR, I removed hard-coded security providers and replaced them with a system property, test.provider.name. If the property is not specified, the provider originally used in the test is used: > > Cipher c = Cipher.getInstance("AES/GCM/NoPadding", System.getProperty("test.provider.name", "SunJCE")); test/jdk/javax/security/auth/login/Configuration/GetInstance.java line 88: > 86: // get an instance of JavaLoginConfig from SUN > 87: Configuration c = Configuration.getInstance(JAVA_CONFIG, null, > 88: System.getProperty("test.provider.name","SUN")); Suggestion: System.getProperty("test.provider.name", "SUN")); test/jdk/javax/security/auth/login/Configuration/GetInstance.java line 94: > 92: try { > 93: c = Configuration.getInstance(JAVA_CONFIG, null, > 94: System.getProperty("test.provider.name","SunRsaSign")); Suggestion: System.getProperty("test.provider.name", "SunRsaSign")); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21551#discussion_r1808334456 PR Review Comment: https://git.openjdk.org/jdk/pull/21551#discussion_r1808334626 From kevinw at openjdk.org Mon Oct 21 09:28:44 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 21 Oct 2024 09:28:44 GMT Subject: RFR: 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir Message-ID: Test update: HashedPasswordFileTest.java was using System.getProperty("test.src") as a place to _create_ a file. jtreg gives us the current working directory for the test invocation as a scratch directory. Create files there, without reading any property to find another location. ------------- Commit messages: - 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir Changes: https://git.openjdk.org/jdk/pull/21602/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21602&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342633 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21602.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21602/head:pull/21602 PR: https://git.openjdk.org/jdk/pull/21602 From stuefe at openjdk.org Mon Oct 21 12:21:17 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Mon, 21 Oct 2024 12:21:17 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v23] In-Reply-To: References: <0BrAbBTKmpqTGDrc--2znzO8t07yoqabwa6g2K05GHI=.d3c17fd5-4770-4623-8d2f-604816afc033@github.com> Message-ID: <7CtwplIs-ILCZhSpPwPtZr-GPCd_XxtOnYwku9zIQTY=.8d8a96e1-9627-4da6-ae57-b692e0580598@github.com> On Fri, 20 Sep 2024 17:46:21 GMT, Coleen Phillimore wrote: >> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge remote-tracking branch 'lilliput/JEP-450-temporary-fix-branch-2' into JDK-8305895-v4 >> - review feedback > > src/hotspot/share/memory/metaspace.cpp line 799: > >> 797: >> 798: // Set up compressed class pointer encoding. >> 799: // In CDS=off mode, we give the JVM some leeway to choose a favorable base/shift combination. > > I don't know why this comment is here. Seems out of place. Its not, but maybe too vague. There are two ways to initialize CompressedKlassPointers : - `CompressedKlassPointers::initialize(address, size)` - called here - is used for no CDS case and allows the JVM to freely pick encoding base and shift. - `CompressedKlassPointers::initialize_for_given_encoding` is called when encoding base and shift are predetermined (when using CDS). Then, the JVM has no freedom at all, it just does sanity checks. The comment basically says "since here we are not using CDS, we are calling CompressedKlassPointers::initialize(address, size) to give the JVM some freedom when choosing encoding base and shift". Is this clearer? Should I just remove the code? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1808683312 From mullan at openjdk.org Mon Oct 21 12:44:12 2024 From: mullan at openjdk.org (Sean Mullan) Date: Mon, 21 Oct 2024 12:44:12 GMT Subject: RFR: 8341927: Remove hardcoded SunJCE provider In-Reply-To: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> References: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> Message-ID: On Wed, 16 Oct 2024 18:47:44 GMT, Matthew Donovan wrote: > In this PR, I removed hard-coded security providers and replaced them with a system property, test.provider.name. If the property is not specified, the provider originally used in the test is used: > > Cipher c = Cipher.getInstance("AES/GCM/NoPadding", System.getProperty("test.provider.name", "SunJCE")); You are changing more than SunJCE providers, so the title of this bug should not be specific to SunJCE. Suggest: "Replace hardcoded security providers with new test.provider.name system property". Are there any cases where a test has more than one hardcoded provider? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21551#issuecomment-2426563352 From stuefe at openjdk.org Mon Oct 21 12:53:13 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Mon, 21 Oct 2024 12:53:13 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v44] In-Reply-To: References: Message-ID: On Wed, 16 Oct 2024 15:37:59 GMT, Coleen Phillimore wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Problem-list SharedBaseAddress tests on aarch64 > > src/hotspot/share/oops/compressedKlass.cpp line 185: > >> 183: #endif >> 184: >> 185: DEBUG_ONLY(sanity_check_after_initialization();) > > This is here twice. sanity_check_after_initialization is called from both initialization routines, but we only call either one or the other. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1808735324 From erikj at openjdk.org Mon Oct 21 12:53:54 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Mon, 21 Oct 2024 12:53:54 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY In-Reply-To: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Sun, 20 Oct 2024 02:11:11 GMT, SendaoYan wrote: > Hi all, > In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. > > So the below test command will print error: > > make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" > > > Building target 'test' in configuration 'linux-x86_64-server-release' > JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. > Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. > RunTests.gmk:206: *** Cannot continue. Stop. > > > So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage001.java line 66: > 64: // Virtual threads are not supported by GetObjectMonitorUsage. > 65: // Correct the expected values if the test is executed with > 66: // TEST_THREAD_FACTORY=Virtual. Perhaps these references should use the full `JTREG=TEST_THREAD_FACTORY=Virtual` to make it clearer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21594#discussion_r1808734633 From ihse at openjdk.org Mon Oct 21 13:05:13 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 21 Oct 2024 13:05:13 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2382030332 From stefank at openjdk.org Mon Oct 21 13:05:14 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 21 Oct 2024 13:05:14 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. ? 762 __ movq(index, needle_len); ? ? 763 __ andq(index, 0xf); // nLen % 16 ? 764 __ movq(offset, 0x10); ? 765 __ subq(offset, index); // 16 - (nLen % 16) ? 766 __ movq(index, offset); ? 767 __ shlq(offset, 1); // * 2 ? 768 __ negq(index); // -(16 - (nLen % 16)) ? ? 769 __ xorq(wr_index, wr_index); ? 770 ? 771 __ bind(L_top); ? 772 // load needle and expand ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); We're reading this address: (SEGV_MAPERR), si_addr: 0x00000007cffffffe which is just before the start of the heap: Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 When this crashed I had: needle: 0x00000007d000000c needle_len = 0x12 index = 0xfffffffffffffffe There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 https://github.com/openjdk/jdk/pull/20677/commits/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0 maybe we need something similar for the needle. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2426614072 From coleenp at openjdk.org Mon Oct 21 13:05:14 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Mon, 21 Oct 2024 13:05:14 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: <5bn9rl6P9_im5yuUGUuMF6Pn8bcn8nHt1xX6q3b03L4=.0d8ed88a-9599-42b1-9eec-fbab93cf3e37@github.com> On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin I think a lot of copyright headers need to be updated. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2426605597 From ihse at openjdk.org Mon Oct 21 13:05:55 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 21 Oct 2024 13:05:55 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY In-Reply-To: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Sun, 20 Oct 2024 02:11:11 GMT, SendaoYan wrote: > Hi all, > In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. > > So the below test command will print error: > > make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" > > > Building target 'test' in configuration 'linux-x86_64-server-release' > JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. > Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. > RunTests.gmk:206: *** Cannot continue. Stop. > > > So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21594#pullrequestreview-2382036363 From syan at openjdk.org Mon Oct 21 13:12:55 2024 From: syan at openjdk.org (SendaoYan) Date: Mon, 21 Oct 2024 13:12:55 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY [v2] In-Reply-To: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: > Hi all, > In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. > > So the below test command will print error: > > make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" > > > Building target 'test' in configuration 'linux-x86_64-server-release' > JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. > Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. > RunTests.gmk:206: *** Cannot continue. Stop. > > > So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. SendaoYan has updated the pull request incrementally with two additional commits since the last revision: - JTREG="TEST_THREAD_FACTORY=Virtual" - Use JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" to make comment more cleaner ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21594/files - new: https://git.openjdk.org/jdk/pull/21594/files/f1aab5dc..7c6a7bb4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21594&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21594&range=00-01 Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21594.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21594/head:pull/21594 PR: https://git.openjdk.org/jdk/pull/21594 From syan at openjdk.org Mon Oct 21 13:12:56 2024 From: syan at openjdk.org (SendaoYan) Date: Mon, 21 Oct 2024 13:12:56 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY [v2] In-Reply-To: References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Mon, 21 Oct 2024 12:48:55 GMT, Erik Joelsson wrote: >> SendaoYan has updated the pull request incrementally with two additional commits since the last revision: >> >> - JTREG="TEST_THREAD_FACTORY=Virtual" >> - Use JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" to make comment more cleaner > > test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage001.java line 66: > >> 64: // Virtual threads are not supported by GetObjectMonitorUsage. >> 65: // Correct the expected values if the test is executed with >> 66: // TEST_THREAD_FACTORY=Virtual. > > Perhaps these references should use the full `JTREG=TEST_THREAD_FACTORY=Virtual` to make it clearer. Thanks for the review, use `JTREG="TEST_THREAD_FACTORY=Virtual"` to make comment more clearer ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21594#discussion_r1808787158 From ihse at openjdk.org Mon Oct 21 13:21:25 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 21 Oct 2024 13:21:25 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY [v2] In-Reply-To: References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Mon, 21 Oct 2024 13:12:55 GMT, SendaoYan wrote: >> Hi all, >> In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. >> >> So the below test command will print error: >> >> make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" >> >> >> Building target 'test' in configuration 'linux-x86_64-server-release' >> JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. >> Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. >> RunTests.gmk:206: *** Cannot continue. Stop. >> >> >> So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. > > SendaoYan has updated the pull request incrementally with two additional commits since the last revision: > > - JTREG="TEST_THREAD_FACTORY=Virtual" > - Use JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" to make comment more cleaner Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21594#pullrequestreview-2382087028 From dfuchs at openjdk.org Mon Oct 21 13:32:28 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 21 Oct 2024 13:32:28 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Thanks for the changes in JMX and java.logging. Looks good to me. ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2382119997 From weijun at openjdk.org Mon Oct 21 13:40:29 2024 From: weijun at openjdk.org (Weijun Wang) Date: Mon, 21 Oct 2024 13:40:29 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <-Bc_cBbnZLLWUhNTjFI_T-LLSRXSnDUS-EnV0DTQwVc=.460efd25-1595-4ff6-a262-3c1c90c7ebd0@github.com> On Fri, 18 Oct 2024 19:52:35 GMT, Sean Mullan wrote: >> I assume for the second one above you mean `javax.security.auth.kerberos.ServicePermission`. These classes still have a lot of words like "grant" and "trust". I will make some changes to the class descriptions of those classes, please review them in the next update. > > See the changes I made in https://github.com/openjdk/jdk/pull/21498/commits/9dd59a12e984c347a34a25e6fd820340b1e12505. Sometimes it is difficult to remove all text about granting the permission, which is why we added the API note in all Permission subclasses stating that the permission can no longer be used to protect resources. I see. I was wondering why some files are modified and some are not. The new text looks fine to me. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1808841888 From rkennke at openjdk.org Mon Oct 21 13:56:35 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 21 Oct 2024 13:56:35 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Thu, 17 Oct 2024 10:57:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin > I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. > > ``` > ? 762 __ movq(index, needle_len); > ? > ? 763 __ andq(index, 0xf); // nLen % 16 > ? 764 __ movq(offset, 0x10); > ? 765 __ subq(offset, index); // 16 - (nLen % 16) > ? 766 __ movq(index, offset); > ? 767 __ shlq(offset, 1); // * 2 > ? 768 __ negq(index); // -(16 - (nLen % 16)) > ? > ? 769 __ xorq(wr_index, wr_index); > ? 770 > ? 771 __ bind(L_top); > ? 772 // load needle and expand > ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); > ``` > > We're reading this address: > > ``` > (SEGV_MAPERR), si_addr: 0x00000007cffffffe > ``` > > which is just before the start of the heap: > > ``` > Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 > ``` > > When this crashed I had: > > ``` > needle: 0x00000007d000000c > needle_len = 0x12 > index = 0xfffffffffffffffe > ``` > > There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) > > maybe we need something similar for the needle. @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2426754934 From erikj at openjdk.org Mon Oct 21 14:10:24 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Mon, 21 Oct 2024 14:10:24 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY [v2] In-Reply-To: References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Mon, 21 Oct 2024 13:12:55 GMT, SendaoYan wrote: >> Hi all, >> In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. >> >> So the below test command will print error: >> >> make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" >> >> >> Building target 'test' in configuration 'linux-x86_64-server-release' >> JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. >> Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. >> RunTests.gmk:206: *** Cannot continue. Stop. >> >> >> So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. > > SendaoYan has updated the pull request incrementally with two additional commits since the last revision: > > - JTREG="TEST_THREAD_FACTORY=Virtual" > - Use JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" to make comment more cleaner Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21594#pullrequestreview-2382234395 From duke at openjdk.org Mon Oct 21 14:23:53 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Mon, 21 Oct 2024 14:23:53 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: <-mco1SNkDsaGs1iPfVA_rYxd2rjKseRvjMMMO1KkDog=.ca9caf95-e6c7-4456-ace6-183c4ef45554@github.com> On Mon, 21 Oct 2024 13:53:58 GMT, Roman Kennke wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Compact header riscv (#3) >> >> Implement compact headers on RISCV >> --------- >> >> Co-authored-by: hamlin > >> I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. >> >> ``` >> ? 762 __ movq(index, needle_len); >> ? >> ? 763 __ andq(index, 0xf); // nLen % 16 >> ? 764 __ movq(offset, 0x10); >> ? 765 __ subq(offset, index); // 16 - (nLen % 16) >> ? 766 __ movq(index, offset); >> ? 767 __ shlq(offset, 1); // * 2 >> ? 768 __ negq(index); // -(16 - (nLen % 16)) >> ? >> ? 769 __ xorq(wr_index, wr_index); >> ? 770 >> ? 771 __ bind(L_top); >> ? 772 // load needle and expand >> ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); >> ``` >> >> We're reading this address: >> >> ``` >> (SEGV_MAPERR), si_addr: 0x00000007cffffffe >> ``` >> >> which is just before the start of the heap: >> >> ``` >> Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 >> ``` >> >> When this crashed I had: >> >> ``` >> needle: 0x00000007d000000c >> needle_len = 0x12 >> index = 0xfffffffffffffffe >> ``` >> >> There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) >> >> maybe we need something similar for the needle. > > @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. @rkennke looking! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2426828440 From jwaters at openjdk.org Mon Oct 21 14:40:23 2024 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 21 Oct 2024 14:40:23 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 Message-ID: After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did. This will require reviews from core-libs, awt, security, accessibility, jpackage, and whatever team is responsible for HotSpot debugging. This fix requires C++17, so it will have to wait for the switch to C++17. I will be working towards that in the meantime and addressing the issues that come with changing the language standard elsewhere. This will only go in once the JDK actually starts using C++17 ------------- Commit messages: - Compile as C++17 - 8342682 Changes: https://git.openjdk.org/jdk/pull/21616/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21616&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342682 Stats: 72 lines in 25 files changed: 25 ins; 1 del; 46 mod Patch: https://git.openjdk.org/jdk/pull/21616.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21616/head:pull/21616 PR: https://git.openjdk.org/jdk/pull/21616 From jwaters at openjdk.org Mon Oct 21 14:40:24 2024 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 21 Oct 2024 14:40:24 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 14:34:30 GMT, Julian Waters wrote: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did. This will require reviews from core-libs, awt, security, accessibility, jpackage, and whatever team is responsible for HotSpot debugging. > > This fix requires C++17, so it will have to wait for the switch to C++17. I will be working towards that in the meantime and addressing the issues that come with changing the language standard elsewhere. This will only go in once the JDK actually starts using C++17 src/java.desktop/share/native/common/awt/debug/debug_trace.h line 66: > 64: /* each file includes this flag indicating module trace status */ > 65: #ifdef __cplusplus > 66: [[maybe_unused]] I don't particularly like this one, but I haven't managed to find a cleaner solution. This is because a static global in a header is not great to begin with. It's practically begging for an unused-variable error to happen ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1808952439 From weijun at openjdk.org Mon Oct 21 14:57:39 2024 From: weijun at openjdk.org (Weijun Wang) Date: Mon, 21 Oct 2024 14:57:39 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 The security-related test updates seem good to me. I noticed a few minor issues and pushed three commits (https://github.com/openjdk/jdk-sandbox/commit/807eb6e363cd78f7051ab2512fbb9fe7f72a036c, https://github.com/openjdk/jdk-sandbox/commit/b4f68e36260cba4cb9e3f72e86674666ee04f15b, and https://github.com/openjdk/jdk-sandbox/commit/02b4bf177555eaf2fa732e918448af9ff1efa8bf). ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2426923546 From dfuchs at openjdk.org Mon Oct 21 15:25:20 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 21 Oct 2024 15:25:20 GMT Subject: RFR: 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 09:21:35 GMT, Kevin Walls wrote: > Test update: HashedPasswordFileTest.java was using System.getProperty("test.src") as a place to _create_ a file. > > jtreg gives us the current working directory for the test invocation as a scratch directory. Create files there, without reading any property to find another location. LGTM ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21602#pullrequestreview-2382461596 From dfuchs at openjdk.org Mon Oct 21 15:41:44 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 21 Oct 2024 15:41:44 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 For the record I have also reviewed the `java.naming` and `jdk.httpserver` source changes. They look good to me. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2427040743 From pchilanomate at openjdk.org Mon Oct 21 15:45:21 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Mon, 21 Oct 2024 15:45:21 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v2] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: - Adjust spacing in test JfrEvents.java - Adjust comment in JavaThread.hpp - RISC-V: Avoid return misprediction ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/6a81ccdc..8c196acd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=00-01 Stats: 16 lines in 7 files changed: 2 ins; 1 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Mon Oct 21 15:49:21 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Mon, 21 Oct 2024 15:49:21 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v2] In-Reply-To: <3qGV4MlDsr4MwwWUIE7w7MI3ZGhhujpzYw-1qFzGVVY=.93a8c704-3817-424e-8ac6-99b4e17ee8e4@github.com> References: <3qGV4MlDsr4MwwWUIE7w7MI3ZGhhujpzYw-1qFzGVVY=.93a8c704-3817-424e-8ac6-99b4e17ee8e4@github.com> Message-ID: On Fri, 18 Oct 2024 04:21:57 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/javaThread.hpp line 165: >> >>> 163: // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the >>> 164: // current _vthread object, except during creation of the primordial and JNI >>> 165: // attached thread cases where this field can have a temporal value. >> >> Suggestion: >> >> // attached thread cases where this field can have a temporary value. >> >> Presumably this is for when the attaching thread is executing the Thread constructor? > > Exactly. Comment adjusted. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809072960 From pchilanomate at openjdk.org Mon Oct 21 15:49:23 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Mon, 21 Oct 2024 15:49:23 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v2] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 08:01:09 GMT, Andrey Turbanov wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: >> >> - Adjust spacing in test JfrEvents.java >> - Adjust comment in JavaThread.hpp >> - RISC-V: Avoid return misprediction > > test/jdk/java/lang/Thread/virtual/JfrEvents.java line 323: > >> 321: var started2 = new AtomicBoolean(); >> 322: >> 323: Thread vthread1 = Thread.ofVirtual().unstarted(() -> { > > Suggestion: > > Thread vthread1 = Thread.ofVirtual().unstarted(() -> { Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809073267 From wkemper at openjdk.org Mon Oct 21 15:57:38 2024 From: wkemper at openjdk.org (William Kemper) Date: Mon, 21 Oct 2024 15:57:38 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v4] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Fri, 11 Oct 2024 21:17:59 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 579: >> >>> 577: st->print("Status: "); >>> 578: if (has_forwarded_objects()) st->print("has forwarded objects, "); >>> 579: if (is_concurrent_mark_in_progress()) st->print("marking, "); >> >> What is this printing when not running with generational mode? > > It will print "young marking". We can change this. https://bugs.openjdk.org/browse/JDK-8342564 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1809085061 From kevinw at openjdk.org Mon Oct 21 16:12:28 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 21 Oct 2024 16:12:28 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Reviewing for management, src and test changes look good. ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2382585178 From aboldtch at openjdk.org Mon Oct 21 16:26:27 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Mon, 21 Oct 2024 16:26:27 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v2] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 15:45:21 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: > > - Adjust spacing in test JfrEvents.java > - Adjust comment in JavaThread.hpp > - RISC-V: Avoid return misprediction I've done an initial look through of the hotspot changes. In addition to my comments, I have looked at two more things. One is to remove the _waiters reference counter from deflation and only use the _contentions reference counter. As well as tying the _contentions reference counter to the ObjectWaiter, so that it is easier to follow its lifetime, instead of these naked add_to_contentions, now that the ObjectWaiter does not have a straight forward scope, but can be frozen, and thawed on different threads. 46dacdf96999154e808d21e80b4d4e87f73bc802 Then I looked at typing up the thread / lock ids as an enum class 34221f4a50a492cad4785cfcbb4bef8fa51d6f23 Either of these could be future RFEs. src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp line 231: > 229: > 230: StubFrame::~StubFrame() { > 231: __ epilogue(_use_pop_on_epilogue); Can we not hook the `_use_pop_on_epilogue` into `return_state_t`, simplify the constructors and keep the old should_not_reach_here guard for stubs which should not return? e.g. ```C++ enum return_state_t { does_not_return, requires_return, requires_pop_epilogue_return }; StubFrame::~StubFrame() { if (_return_state == does_not_return) { __ should_not_reach_here(); } else { __ epilogue(_return_state == requires_pop_epilogue_return); } } src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 115: > 113: // The object's monitor m is unlocked iff m->owner == nullptr, > 114: // otherwise m->owner may contain a thread id, a stack address for LM_LEGACY, > 115: // or the ANONYMOUS_OWNER constant for LM_LIGHTWEIGHT. Comment seems out of place in `LockingMode != LM_LIGHTWEIGHT` code. src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 380: > 378: lea(t2_owner_addr, owner_address); > 379: > 380: // CAS owner (null => current thread id). I think we should be more careful when and where we talk about thread id and lock id respectively. Given that `switchToCarrierThread` switches the thread, but not the lock id. We should probably define and talk about the lock id when it comes to locking, as saying thread id may be incorrect. Then there is also the different thread ids, the OS level one, and the java level one. (But not sure how to reconcile this without causing confusion) src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 300: > 298: CodeBlob* cb = top.cb(); > 299: > 300: if (cb->frame_size() == 2) { Is this a filter to identify c2 runtime stubs? Is there some other property we can check or assert here? This assumes that no other runtime frame will have this size. src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 313: > 311: > 312: log_develop_trace(continuations, preempt)("adjusted sp for c2 runtime stub, initial sp: " INTPTR_FORMAT " final sp: " INTPTR_FORMAT > 313: " fp: " INTPTR_FORMAT, p2i(sp + frame::metadata_words), p2i(sp), sp[-2]); Is there a reason for the mix of `2` and `frame::metadata_words`? Maybe this could be ```C++ intptr_t* const unadjusted_sp = sp; sp -= frame::metadata_words; sp[-2] = unadjusted_sp[-2]; sp[-1] = unadjusted_sp[-1]; log_develop_trace(continuations, preempt)("adjusted sp for c2 runtime stub, initial sp: " INTPTR_FORMAT " final sp: " INTPTR_FORMAT " fp: " INTPTR_FORMAT, p2i(unadjusted_sp), p2i(sp), sp[-2]); src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp line 1275: > 1273: void SharedRuntime::continuation_enter_cleanup(MacroAssembler* masm) { > 1274: ::continuation_enter_cleanup(masm); > 1275: } Now that `continuation_enter_cleanup` is a static member function, just merge the static free function with this static member function. src/hotspot/cpu/x86/assembler_x86.cpp line 2866: > 2864: emit_int32(0); > 2865: } > 2866: } Is it possible to make this more general and explicit instead of a sequence of bytes? Something along the lines of: ```C++ const address tar = L.is_bound() ? target(L) : pc(); const Address adr = Address(checked_cast(tar - pc()), tar, relocInfo::none); InstructionMark im(this); emit_prefix_and_int8(get_prefixq(adr, dst), (unsigned char)0x8D); if (!L.is_bound()) { // Patch @0x8D opcode L.add_patch_at(code(), CodeBuffer::locator(offset() - 1, sect())); } // Register and [rip+disp] operand emit_modrm(0b00, raw_encode(dst), 0b101); // Adjust displacement by sizeof lea instruction int32_t disp = adr.disp() - checked_cast(pc() - inst_mark() + sizeof(int32_t)); assert(is_simm32(disp), "must be 32bit offset [rip+offset]"); emit_int32(disp); and then in `pd_patch_instruction` simply match `op == 0x8D /* lea */`. src/hotspot/share/oops/stackChunkOop.cpp line 471: > 469: } > 470: } > 471: } Can we turn these three very similar loops into one? In my opinion, it is easier to parse. ```C++ void stackChunkOopDesc::copy_lockstack(oop* dst) { const int cnt = lockstack_size(); const bool requires_gc_barriers = is_gc_mode() || requires_barriers(); const bool requires_uncompress = requires_gc_barriers && has_bitmap() && UseCompressedOops; const auto get_obj = [&](intptr_t* at) -> oop { if (requires_gc_barriers) { if (requires_uncompress) { return HeapAccess<>::oop_load(reinterpret_cast(at)); } return HeapAccess<>::oop_load(reinterpret_cast(at)); } return *reinterpret_cast(at); }; intptr_t* lockstack_start = start_address(); for (int i = 0; i < cnt; i++) { oop mon_owner = get_obj(&lockstack_start[i]); assert(oopDesc::is_oop(mon_owner), "not an oop"); dst[i] = mon_owner; } } src/hotspot/share/prims/jvmtiExport.cpp line 1681: > 1679: EVT_TRIG_TRACE(EXT_EVENT_VIRTUAL_THREAD_UNMOUNT, ("[%p] Trg Virtual Thread Unmount event triggered", vthread)); > 1680: > 1681: // On preemption JVMTI state rebinding has already happened so get it always direclty from the oop. Suggestion: // On preemption JVMTI state rebinding has already happened so get it always directly from the oop. src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2538: > 2536: Method* m = hf.interpreter_frame_method(); > 2537: // For native frames we need to count parameters, possible alignment, plus the 2 extra words (temp oop/result handler). > 2538: const int locals = !m->is_native() ? m->max_locals() : m->size_of_parameters() + frame::align_wiggle + 2; Is it possible to have these extra native frame slots size be a named constant / enum value on `frame`? I think it is used in a couple of places. src/hotspot/share/runtime/frame.cpp line 535: > 533: assert(get_register_address_in_stub(f, SharedRuntime::thread_register()) == (address)thread_addr, "wrong thread address"); > 534: return thread_addr; > 535: #endif With this ifdef, it seems like this belongs in the platform dependent part of the frame class. src/hotspot/share/runtime/javaThread.cpp line 1545: > 1543: if (is_vthread_mounted()) { > 1544: // _lock_id is the thread ID of the mounted virtual thread > 1545: st->print_cr(" Carrying virtual thread #" INT64_FORMAT, lock_id()); What is the interaction here with `switchToCarrierThread` and the window between? carrier.setCurrentThread(carrier); Thread.setCurrentLockId(this.threadId()); Will we print the carrier threads id as a virtual threads id? (I am guessing that is_vthread_mounted is true when switchToCarrierThread is called). src/hotspot/share/runtime/objectMonitor.hpp line 184: > 182: // - We test for anonymous owner by testing for the lowest bit, therefore > 183: // DEFLATER_MARKER must *not* have that bit set. > 184: static const int64_t DEFLATER_MARKER = 2; The comments here should be updated / removed. They are talking about the lower bits of the owner being unset which is no longer true. (And talks about doing bit tests, which I do not think is done anywhere even without this patch). src/hotspot/share/runtime/objectMonitor.hpp line 186: > 184: static const int64_t DEFLATER_MARKER = 2; > 185: > 186: int64_t volatile _owner; // Either tid of owner, ANONYMOUS_OWNER_MARKER or DEFLATER_MARKER. Suggestion: int64_t volatile _owner; // Either tid of owner, NO_OWNER, ANONYMOUS_OWNER or DEFLATER_MARKER. src/hotspot/share/runtime/synchronizer.cpp line 1467: > 1465: markWord dmw = inf->header(); > 1466: assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value()); > 1467: if (inf->is_owner_anonymous() && inflating_thread != nullptr) { Are these `LM_LEGACY` + `ANONYMOUS_OWNER` changes still required now that `LM_LEGACY` does no freeze? ------------- PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2381051930 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808181783 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808189977 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808208652 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808282892 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808261926 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808318304 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808358874 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808706427 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808809374 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1808460330 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809032469 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809065834 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809091338 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809092367 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809111830 From duke at openjdk.org Mon Oct 21 16:56:35 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Mon, 21 Oct 2024 16:56:35 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 13:53:58 GMT, Roman Kennke wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Compact header riscv (#3) >> >> Implement compact headers on RISCV >> --------- >> >> Co-authored-by: hamlin > >> I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. >> >> ``` >> ? 762 __ movq(index, needle_len); >> ? >> ? 763 __ andq(index, 0xf); // nLen % 16 >> ? 764 __ movq(offset, 0x10); >> ? 765 __ subq(offset, index); // 16 - (nLen % 16) >> ? 766 __ movq(index, offset); >> ? 767 __ shlq(offset, 1); // * 2 >> ? 768 __ negq(index); // -(16 - (nLen % 16)) >> ? >> ? 769 __ xorq(wr_index, wr_index); >> ? 770 >> ? 771 __ bind(L_top); >> ? 772 // load needle and expand >> ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); >> ``` >> >> We're reading this address: >> >> ``` >> (SEGV_MAPERR), si_addr: 0x00000007cffffffe >> ``` >> >> which is just before the start of the heap: >> >> ``` >> Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 >> ``` >> >> When this crashed I had: >> >> ``` >> needle: 0x00000007d000000c >> needle_len = 0x12 >> index = 0xfffffffffffffffe >> ``` >> >> There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) >> >> maybe we need something similar for the needle. > > @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. @rkennke Could you post the full command you used please? And perhaps also the seed that gets printed.. having trouble getting it to fail.. So far I added a few options and perrmitations of: `./build/linux-x86_64-server-fastdebug/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+EnableX86ECoreOpts -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders test/jdk/java/lang/StringBuffer/ECoreIndexOf.java` and lo luck.. IndexOf.java test checks "all interesting" lengths of haystack and needle and can't get it to fail either. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427232140 From mullan at openjdk.org Mon Oct 21 17:24:32 2024 From: mullan at openjdk.org (Sean Mullan) Date: Mon, 21 Oct 2024 17:24:32 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <60NR4UYtz57FWH8yTBMSS5SPQVOGpXcoZ-9AP7o9y14=.6eb65796-4e30-4093-866d-226334d9977c@github.com> On Sat, 19 Oct 2024 07:54:07 GMT, Alan Bateman wrote: > There are a couple of micro benchmarks in test/micro that fork with `jvmArgsPrepend={"-Djava.security.manager=allow"})`, they will need to be examined. Fixed, will be in next drop. There are a couple of other micro tests that test the performance of `AccessController.doPrivileged` and `getContext` which probably don't make sense anymore, but I've left them for now to be looked at later. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2427301539 From rkennke at openjdk.org Mon Oct 21 18:04:53 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 21 Oct 2024 18:04:53 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 13:53:58 GMT, Roman Kennke wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Compact header riscv (#3) >> >> Implement compact headers on RISCV >> --------- >> >> Co-authored-by: hamlin > >> I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. >> >> ``` >> ? 762 __ movq(index, needle_len); >> ? >> ? 763 __ andq(index, 0xf); // nLen % 16 >> ? 764 __ movq(offset, 0x10); >> ? 765 __ subq(offset, index); // 16 - (nLen % 16) >> ? 766 __ movq(index, offset); >> ? 767 __ shlq(offset, 1); // * 2 >> ? 768 __ negq(index); // -(16 - (nLen % 16)) >> ? >> ? 769 __ xorq(wr_index, wr_index); >> ? 770 >> ? 771 __ bind(L_top); >> ? 772 // load needle and expand >> ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); >> ``` >> >> We're reading this address: >> >> ``` >> (SEGV_MAPERR), si_addr: 0x00000007cffffffe >> ``` >> >> which is just before the start of the heap: >> >> ``` >> Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 >> ``` >> >> When this crashed I had: >> >> ``` >> needle: 0x00000007d000000c >> needle_len = 0x12 >> index = 0xfffffffffffffffe >> ``` >> >> There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) >> >> maybe we need something similar for the needle. > > @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. > @rkennke Could you post the full command you used please? And perhaps also the seed that gets printed.. having trouble getting it to fail.. > > So far I added a few options and perrmitations of: `./build/linux-x86_64-server-fastdebug/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+EnableX86ECoreOpts -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders test/jdk/java/lang/StringBuffer/ECoreIndexOf.java` and lo luck.. IndexOf.java test checks "all interesting" lengths of haystack and needle and can't get it to fail either. I could reproduce on 3rd try with a fastdebug build with: make test TEST=java/lang/StringBuffer/ECoreIndexOf.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseSerialGC" It prints: Seed set to 636754923980405411 It probably depends on GC operation: It would only fail when the array happens to be the very first object in the heap. The relevant GC/heap configs would be: InitialHeapSize = 805306368 MaxHeapSize = 805306368 MaxNewSize = 268435456 So you should probably also add `-Xmx805306368 -Xms805306368 -Xmn268435456` ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427375886 From duke at openjdk.org Mon Oct 21 18:55:52 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Mon, 21 Oct 2024 18:55:52 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 18:00:14 GMT, Roman Kennke wrote: >>> I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. >>> >>> ``` >>> ? 762 __ movq(index, needle_len); >>> ? >>> ? 763 __ andq(index, 0xf); // nLen % 16 >>> ? 764 __ movq(offset, 0x10); >>> ? 765 __ subq(offset, index); // 16 - (nLen % 16) >>> ? 766 __ movq(index, offset); >>> ? 767 __ shlq(offset, 1); // * 2 >>> ? 768 __ negq(index); // -(16 - (nLen % 16)) >>> ? >>> ? 769 __ xorq(wr_index, wr_index); >>> ? 770 >>> ? 771 __ bind(L_top); >>> ? 772 // load needle and expand >>> ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); >>> ``` >>> >>> We're reading this address: >>> >>> ``` >>> (SEGV_MAPERR), si_addr: 0x00000007cffffffe >>> ``` >>> >>> which is just before the start of the heap: >>> >>> ``` >>> Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 >>> ``` >>> >>> When this crashed I had: >>> >>> ``` >>> needle: 0x00000007d000000c >>> needle_len = 0x12 >>> index = 0xfffffffffffffffe >>> ``` >>> >>> There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) >>> >>> maybe we need something similar for the needle. >> >> @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. > >> @rkennke Could you post the full command you used please? And perhaps also the seed that gets printed.. having trouble getting it to fail.. >> >> So far I added a few options and perrmitations of: `./build/linux-x86_64-server-fastdebug/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+EnableX86ECoreOpts -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders test/jdk/java/lang/StringBuffer/ECoreIndexOf.java` and lo luck.. IndexOf.java test checks "all interesting" lengths of haystack and needle and can't get it to fail either. > > I could reproduce on 3rd try with a fastdebug build with: > > make test TEST=java/lang/StringBuffer/ECoreIndexOf.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseSerialGC" > > > It prints: > > Seed set to 636754923980405411 > > > It probably depends on GC operation: It would only fail when the array happens to be the very first object in the heap. The relevant GC/heap configs would be: > > InitialHeapSize = 805306368 > MaxHeapSize = 805306368 > MaxNewSize = 268435456 > > > So you should probably also add `-Xmx805306368 -Xms805306368 -Xmn268435456` Thanks @rkennke able to reproduce now.. Sandhya will have a patch soon and I will re-verify ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427477113 From mdonovan at openjdk.org Mon Oct 21 19:12:44 2024 From: mdonovan at openjdk.org (Matthew Donovan) Date: Mon, 21 Oct 2024 19:12:44 GMT Subject: RFR: 8341927: Remove hardcoded SunJCE provider [v2] In-Reply-To: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> References: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> Message-ID: > In this PR, I removed hard-coded security providers and replaced them with a system property, test.provider.name. If the property is not specified, the provider originally used in the test is used: > > Cipher c = Cipher.getInstance("AES/GCM/NoPadding", System.getProperty("test.provider.name", "SunJCE")); Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: Updated a few more tests. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21551/files - new: https://git.openjdk.org/jdk/pull/21551/files/5f07cd8f..83599700 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21551&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21551&range=00-01 Stats: 12 lines in 6 files changed: 3 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/21551.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21551/head:pull/21551 PR: https://git.openjdk.org/jdk/pull/21551 From sviswanathan at openjdk.org Mon Oct 21 19:26:39 2024 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Mon, 21 Oct 2024 19:26:39 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 18:52:46 GMT, Volodymyr Paprotski wrote: > Thanks @rkennke able to reproduce now.. Sandhya will have a patch soon and I will re-verify @rkennke @vpaprotsk Please find attached the patch which should fix the problem. [smallneedlefix.patch](https://github.com/user-attachments/files/17466073/smallneedlefix.patch) ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427536012 From rkennke at openjdk.org Mon Oct 21 20:34:41 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Mon, 21 Oct 2024 20:34:41 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 18:00:14 GMT, Roman Kennke wrote: >>> I've managed to reproduce the ECoreIndexOf crash locally by running with -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders. The crash happens on line 773 when reading past the needle. >>> >>> ``` >>> ? 762 __ movq(index, needle_len); >>> ? >>> ? 763 __ andq(index, 0xf); // nLen % 16 >>> ? 764 __ movq(offset, 0x10); >>> ? 765 __ subq(offset, index); // 16 - (nLen % 16) >>> ? 766 __ movq(index, offset); >>> ? 767 __ shlq(offset, 1); // * 2 >>> ? 768 __ negq(index); // -(16 - (nLen % 16)) >>> ? >>> ? 769 __ xorq(wr_index, wr_index); >>> ? 770 >>> ? 771 __ bind(L_top); >>> ? 772 // load needle and expand >>> ? 773 __ vpmovzxbw(xmm0, Address(needle, index, Address::times_1), Assembler::AVX_256bit); >>> ``` >>> >>> We're reading this address: >>> >>> ``` >>> (SEGV_MAPERR), si_addr: 0x00000007cffffffe >>> ``` >>> >>> which is just before the start of the heap: >>> >>> ``` >>> Heap address: 0x00000007d0000000, size: 768 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 >>> ``` >>> >>> When this crashed I had: >>> >>> ``` >>> needle: 0x00000007d000000c >>> needle_len = 0x12 >>> index = 0xfffffffffffffffe >>> ``` >>> >>> There has been previous fix to not read past the haystack: Fix header < 16 bytes in indexOf intrinsic, by @sviswa7 [f65ef5d](https://github.com/openjdk/jdk/commit/f65ef5dc325212155a50a2fc3a7f4aad18b8d9d0) >>> >>> maybe we need something similar for the needle. >> >> @sviswa7 @vpaprotsk could you have a look? If we can have a reasonable fix for this soon, we could ship it in this PR, otherwise I'd defer it to a follow-up issue and disable indexOf intrinsic when running with +UseCompactObjectHeaders. > >> @rkennke Could you post the full command you used please? And perhaps also the seed that gets printed.. having trouble getting it to fail.. >> >> So far I added a few options and perrmitations of: `./build/linux-x86_64-server-fastdebug/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+EnableX86ECoreOpts -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders test/jdk/java/lang/StringBuffer/ECoreIndexOf.java` and lo luck.. IndexOf.java test checks "all interesting" lengths of haystack and needle and can't get it to fail either. > > I could reproduce on 3rd try with a fastdebug build with: > > make test TEST=java/lang/StringBuffer/ECoreIndexOf.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseSerialGC" > > > It prints: > > Seed set to 636754923980405411 > > > It probably depends on GC operation: It would only fail when the array happens to be the very first object in the heap. The relevant GC/heap configs would be: > > InitialHeapSize = 805306368 > MaxHeapSize = 805306368 > MaxNewSize = 268435456 > > > So you should probably also add `-Xmx805306368 -Xms805306368 -Xmn268435456` > > Thanks @rkennke able to reproduce now.. Sandhya will have a patch soon and I will re-verify > > @rkennke @vpaprotsk Please find attached the patch which should fix the problem. > > [smallneedlefix.patch](https://github.com/user-attachments/files/17466073/smallneedlefix.patch) Testing now. Runs the reproducer in a loop since half an hour without crashing. I'll let it run overnight, and if @vpaprotsk approves the changes, then I'll intergrate them tomorrow morning. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427660618 From iklam at openjdk.org Mon Oct 21 20:46:56 2024 From: iklam at openjdk.org (Ioi Lam) Date: Mon, 21 Oct 2024 20:46:56 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v17] In-Reply-To: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: > This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). > > **Overview** > > - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. > - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. > - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. > - The boot classes are loaded as part of `vmClasses::resolve_all()` > - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). > - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. > > **All-or-nothing Loading** > > - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. > - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: > - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. > - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. > - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. > - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exact same set of modules are visible whe... Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: @calvinccheung review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20843/files - new: https://git.openjdk.org/jdk/pull/20843/files/6bb38cb9..9d3d8bd9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20843&range=15-16 Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/20843.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20843/head:pull/20843 PR: https://git.openjdk.org/jdk/pull/20843 From iklam at openjdk.org Mon Oct 21 20:46:59 2024 From: iklam at openjdk.org (Ioi Lam) Date: Mon, 21 Oct 2024 20:46:59 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v12] In-Reply-To: References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: On Mon, 23 Sep 2024 17:56:39 GMT, Calvin Cheung wrote: >> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: >> >> - Merge branch 'jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver' into jep-483-step-03-8329706-implement-xx-aot-class-linking >> - @dholmes-ora comments >> - @dholmes-ora comments >> - Fixed ZERO build >> - minor comment fix >> - @ashu-mehra comment: move code outside of call_initPhase2(); also renamed BOOT/BOOT2 to BOOT1/BOOT2 and refactored code related to AOTLinkedClassCategory >> - @ashu-mehra reviews >> - @ashu-mehra comments >> - @adinn comments >> - @dholmes-ora comments: logging indents >> - ... and 5 more: https://git.openjdk.org/jdk/compare/49dbfa6a...6029b35f > > src/hotspot/share/cds/metaspaceShared.cpp line 1536: > >> 1534: if (lsh.is_enabled()) { >> 1535: lsh.print("Using AOT-linked classes: %s (static archive: %s aot-linked classes", >> 1536: CDSConfig::is_using_aot_linked_classes() ? "true" : "false", > > Suggestion: > `BOOL_TO_STR(CDSConfig::is_using_aot_linked_classes()),` Fixed. > test/hotspot/jtreg/runtime/cds/appcds/jvmti/ClassFileLoadHookTest.java line 100: > >> 98: TestCommon.checkExec(out); >> 99: >> 100: // JEP 483: if dumped with -XX:+AOTClassLinking, cannot use archive when CFLH > > Suggestion: > `..., cannot use archive when CFLH is enabled` Fixed. > test/lib/jdk/test/lib/cds/CDSAppTester.java line 50: > >> 48: public CDSAppTester(String name) { >> 49: if (CDSTestUtils.DYNAMIC_DUMP) { >> 50: throw new jtreg.SkippedException("Tests based on CDSAppTester should be excluded when -Dtest.dynamic.cds.archive is specified"); > > You could omit the `jtreg.` in the above throw statement. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20843#discussion_r1809504196 PR Review Comment: https://git.openjdk.org/jdk/pull/20843#discussion_r1809504427 PR Review Comment: https://git.openjdk.org/jdk/pull/20843#discussion_r1809504306 From duke at openjdk.org Mon Oct 21 20:48:23 2024 From: duke at openjdk.org (Robert Toyonaga) Date: Mon, 21 Oct 2024 20:48:23 GMT Subject: RFR: 8304824: NMT should not use ThreadCritical [v8] In-Reply-To: References: Message-ID: On Sat, 12 Oct 2024 18:42:34 GMT, Afshin Zafari wrote: >> Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update src/hotspot/share/utilities/vmError.cpp >> >> Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com> > > Just an important test or comparison is needed here. Do you have any comparison of the performance before and after this PR change set? Even if no degrading is expected, better to test it. Hi @afshin-zafari, I made a [simple test](https://gist.github.com/roberttoyonaga/b2315de83f62ef0f4cef8e4d08ba18d3) and could not find any significant difference in performance. The test basically spawns 16 threads (on my 16 core amd linux machine) and each thread reserves and commits memory thousands of times before finishing. I record how long it takes for all the threads to finish. The after 10 trials, the average difference between with/without the mutex change is ~3%, which is less than the stdev (5% of the average values). It's a pretty rough test, but at least it supports our expectation and shows that there's no obvious degradation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20852#issuecomment-2427685056 From ccheung at openjdk.org Mon Oct 21 20:59:41 2024 From: ccheung at openjdk.org (Calvin Cheung) Date: Mon, 21 Oct 2024 20:59:41 GMT Subject: RFR: 8329706: Implement -XX:+AOTClassLinking [v17] In-Reply-To: References: <5cstSdLtxGHWY5aAvTT0RlSVOkuqf5IZ1aN4_VeEHyM=.018c626f-495c-4d49-82ce-712737307701@github.com> Message-ID: On Mon, 21 Oct 2024 20:46:56 GMT, Ioi Lam wrote: >> This is the 3rd PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737). >> >> **Overview** >> >> - A new `-XX:+AOTClassLinking` flag is added. See [JEP 498](https://bugs.openjdk.org/browse/JDK-8315737) and the [CSR](https://bugs.openjdk.org/browse/JDK-8339506) for a discussion of this command-line option, its default value, and its impact on compatibility. >> - When this flag is enabled during the creation of an AOT cache (aka CDS archive), an `AOTLinkedClassTable` is added to the cache to include all classes that are AOT-linked. For this PR, only classes for the boot/platform/application loaders are eligible. The main logic is in `aotClassLinker.cpp`. >> - When an AOT archive is loaded in a production run, all classes in the `AOTLinkedClassTable` are loaded into their respective class loaders at the earliest opportunity. The main logic is in `aotLinkedClassBulkLoader.cpp`. >> - The boot classes are loaded as part of `vmClasses::resolve_all()` >> - The platform/application classes are loaded after the module graph is restored (see changes in `threads.cpp`). >> - Since all classes in a `AOTLinkedClassTable` are loaded before any user-code is executed, we can resolve constant pool entries that refer to these classes during AOT cache creation. See changes in `AOTConstantPoolResolver::is_class_resolution_deterministic()`. >> >> **All-or-nothing Loading** >> >> - Because AOT-linked classes can refer to each other, using direct C++ pointers, all AOT-linked classes must be loaded together. Otherwise we will have dangling C++ pointers in the class metadata structures. >> - During a production run, we check during VM start-up for incompatible VM options that would prevent some of the AOT-linked classes from being loaded. For example: >> - If the VM is started with an JVMTI agent that has ClassFileLoadHook capabilities, it could replace some of the AOT-linked classes with alternative versions. >> - If the VM is started with certain module options, such as `--patch-module` or `--module`, some AOT-linked classes may be replaced with patched versions, or may become invisible and cannot be loaded into the JVM. >> - When incompatible VM options are detected, the JVM will refuse to load an AOT cache that has AOT-linked classes. See `FileMapInfo::validate_aot_class_linking()`. >> - For simplfication, `FileMapInfo::validate_aot_class_linking()` requires `CDSConfig::is_using_full_module_graph()` to be true. This means that the exa... > > Ioi Lam has updated the pull request incrementally with one additional commit since the last revision: > > @calvinccheung review comments Marked as reviewed by ccheung (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20843#pullrequestreview-2383296080 From duke at openjdk.org Mon Oct 21 21:09:38 2024 From: duke at openjdk.org (Volodymyr Paprotski) Date: Mon, 21 Oct 2024 21:09:38 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v46] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 20:31:28 GMT, Roman Kennke wrote: >>> @rkennke Could you post the full command you used please? And perhaps also the seed that gets printed.. having trouble getting it to fail.. >>> >>> So far I added a few options and perrmitations of: `./build/linux-x86_64-server-fastdebug/images/jdk/bin/java -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+EnableX86ECoreOpts -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders test/jdk/java/lang/StringBuffer/ECoreIndexOf.java` and lo luck.. IndexOf.java test checks "all interesting" lengths of haystack and needle and can't get it to fail either. >> >> I could reproduce on 3rd try with a fastdebug build with: >> >> make test TEST=java/lang/StringBuffer/ECoreIndexOf.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseSerialGC" >> >> >> It prints: >> >> Seed set to 636754923980405411 >> >> >> It probably depends on GC operation: It would only fail when the array happens to be the very first object in the heap. The relevant GC/heap configs would be: >> >> InitialHeapSize = 805306368 >> MaxHeapSize = 805306368 >> MaxNewSize = 268435456 >> >> >> So you should probably also add `-Xmx805306368 -Xms805306368 -Xmn268435456` > >> > Thanks @rkennke able to reproduce now.. Sandhya will have a patch soon and I will re-verify >> >> @rkennke @vpaprotsk Please find attached the patch which should fix the problem. >> >> [smallneedlefix.patch](https://github.com/user-attachments/files/17466073/smallneedlefix.patch) > > Testing now. Runs the reproducer in a loop since half an hour without crashing. I'll let it run overnight, and if @vpaprotsk approves the changes, then I'll intergrate them tomorrow morning. @rkennke I've been running the patch too, for about 2.5 hours now, looks good to me. Also looked things over again, looks good. Just to explain/document what I reviewed.. - Looked at other uses of the needle (that code didn't change, so not exhaustive claim). Typically size of the needle being less then 16 'doesnt matter'.. i.e. broadcast first char, last char, if first/last character mask matches, switch-table for comparing middle - i.e. no reading headers needed - The case Sandhya fixes, handles UL special case (i.e. haystack unicode, needle regular). For cases of needle less then 32 bytes, copy the needle to the stack, and expand 8->16 so regular UU code can be used. Previous code looped 256bit loads at a time, now we loop 128 instead. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2427718674 From wkemper at openjdk.org Mon Oct 21 21:16:50 2024 From: wkemper at openjdk.org (William Kemper) Date: Mon, 21 Oct 2024 21:16:50 GMT Subject: RFR: 8337511: Implement JEP-404: Generational Shenandoah (Experimental) [v5] In-Reply-To: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: > This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 492 commits: - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux - Merge - 8342560: GenShen: Fix confusing method name Reviewed-by: ysr - 8342564: GenShen: Only reference young/old generation names in generational mode Reviewed-by: xpeng, ysr - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux - 8342214: GenShen: Reduce code duplication in shFreeSet with iterator abstraction Reviewed-by: kdnilsen, ysr - 8342239: GenShen: Revert changes in adaptive heuristic to avoid overflow on 32 bit Reviewed-by: ysr - 8342278: GenShen: Move non-generational mode test out of generational test configuration Reviewed-by: ysr - 8342255: GenShen: Remove unnecessary enum initial values Reviewed-by: ysr - ... and 482 more: https://git.openjdk.org/jdk/compare/71583222...2a2aa408 ------------- Changes: https://git.openjdk.org/jdk/pull/21273/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21273&range=04 Stats: 22825 lines in 229 files changed: 21084 ins; 889 del; 852 mod Patch: https://git.openjdk.org/jdk/pull/21273.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21273/head:pull/21273 PR: https://git.openjdk.org/jdk/pull/21273 From prr at openjdk.org Mon Oct 21 21:24:30 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 21 Oct 2024 21:24:30 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <0hopUxCsiLaaoyBfNaj3hnNsGq-at7ttBqERS6OfGLI=.280f52c2-d171-455e-aefd-a983fe33e0cf@github.com> On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/imageio/CachePremissionsTest/CachePermissionsTest.java line 55: > 53: * @run main/othervm -Djava.security.manager=allow CachePermissionsTest false w.policy > 54: * @run main/othervm -Djava.security.manager=allow CachePermissionsTest false rw.policy > 55: * @run main/othervm -Djava.security.manager=allow CachePermissionsTest true rwd.policy Looks to me like we should delete these 3 policy files. Also this test isn't about Permissions anymore. So should be renamed to CacheUsedTest Then we can get rid of the misspelt directory. in a follow up.Probably do this test/jdk/javax/imageio/CachePremissionsTest/CachePermissionsTest.java line 76: > 74: System.out.println("java.io.tmpdir is " + System.getProperty("java.io.tmpdir")); > 75: > 76: if (args.length > 1) { The isFileCacheExpected logic does not make sense. The test sets set to use the cache but then reads whether to expect it based on the args[0]. If that were set to false the test will fail. So why is it there ? Also the messing around with exceptions at the end of the test is pointless ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1809540920 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1809544420 From amenkov at openjdk.org Tue Oct 22 00:44:15 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 22 Oct 2024 00:44:15 GMT Subject: RFR: 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir In-Reply-To: References: Message-ID: <7nsVEtFl6mygeAPpKe-1ENJGpur2fZjmyDu29qtaPGY=.745fa80d-74d3-4df3-99da-01d430c6d392@github.com> On Mon, 21 Oct 2024 09:21:35 GMT, Kevin Walls wrote: > Test update: HashedPasswordFileTest.java was using System.getProperty("test.src") as a place to _create_ a file. > > jtreg gives us the current working directory for the test invocation as a scratch directory. Create files there, without reading any property to find another location. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21602#pullrequestreview-2383533706 From jwaters at openjdk.org Tue Oct 22 01:46:19 2024 From: jwaters at openjdk.org (Julian Waters) Date: Tue, 22 Oct 2024 01:46:19 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: References: Message-ID: <-zfrUge_9zAFIlJQB-L2oytEBTLluINYiNlbkCFkCTE=.db445cce-343f-4792-bfa7-1ea22d453d46@github.com> On Tue, 22 Oct 2024 01:40:11 GMT, David Holmes wrote: > > and whatever team is responsible for HotSpot debugging. > > I don't see anything hotspot related here. > > I think you would be better off splitting this up into distinct issues and PRs for different areas. I expect the client team in particular would prefer that. Aren't the dt_shmem and jdwp changes related to HotSpot? But I guess I'll split it up in that case, I thought it might have been quicker to group it all together in one shot. This particular Pull Request I'll probably reserve for jdwp and the like, core-libs and client (And everything else) I'll move to their own PRs ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2428041172 From dholmes at openjdk.org Tue Oct 22 01:46:19 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 22 Oct 2024 01:46:19 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 14:34:30 GMT, Julian Waters wrote: > and whatever team is responsible for HotSpot debugging. I don't see anything hotspot related here. I think you would be better off splitting this up into distinct issues and PRs for different areas. I expect the client team in particular would prefer that. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2428037844 From pchilanomate at openjdk.org Tue Oct 22 02:14:23 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 02:14:23 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: - Fix comments in objectMonitor.hpp - Move frame::saved_thread_address() to platform dependent files - Fix typo in jvmtiExport.cpp - remove usage of frame::metadata_words in possibly_adjust_frame() - Fix comments in c2 locking paths - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/8c196acd..23d1a2be Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=01-02 Stats: 253 lines in 19 files changed: 122 ins; 97 del; 34 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Tue Oct 22 02:14:24 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 02:14:24 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 06:38:28 GMT, Axel Boldt-Christmas wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp line 231: > >> 229: >> 230: StubFrame::~StubFrame() { >> 231: __ epilogue(_use_pop_on_epilogue); > > Can we not hook the `_use_pop_on_epilogue` into `return_state_t`, simplify the constructors and keep the old should_not_reach_here guard for stubs which should not return? > e.g. > ```C++ > enum return_state_t { > does_not_return, requires_return, requires_pop_epilogue_return > }; > > StubFrame::~StubFrame() { > if (_return_state == does_not_return) { > __ should_not_reach_here(); > } else { > __ epilogue(_return_state == requires_pop_epilogue_return); > } > } Yes, that's much better. I changed it in both aarch64 and riscv. > src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 115: > >> 113: // The object's monitor m is unlocked iff m->owner == nullptr, >> 114: // otherwise m->owner may contain a thread id, a stack address for LM_LEGACY, >> 115: // or the ANONYMOUS_OWNER constant for LM_LIGHTWEIGHT. > > Comment seems out of place in `LockingMode != LM_LIGHTWEIGHT` code. I removed this comment about what other values might be stored in _owner since we don't need to handle those cases here. > src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 380: > >> 378: lea(t2_owner_addr, owner_address); >> 379: >> 380: // CAS owner (null => current thread id). > > I think we should be more careful when and where we talk about thread id and lock id respectively. Given that `switchToCarrierThread` switches the thread, but not the lock id. We should probably define and talk about the lock id when it comes to locking, as saying thread id may be incorrect. > > Then there is also the different thread ids, the OS level one, and the java level one. (But not sure how to reconcile this without causing confusion) Fixed the comments to refer to _lock_id. Even without the switchToCarrierThread case I think that's the correct thing to do. > src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 313: > >> 311: >> 312: log_develop_trace(continuations, preempt)("adjusted sp for c2 runtime stub, initial sp: " INTPTR_FORMAT " final sp: " INTPTR_FORMAT >> 313: " fp: " INTPTR_FORMAT, p2i(sp + frame::metadata_words), p2i(sp), sp[-2]); > > Is there a reason for the mix of `2` and `frame::metadata_words`? > > Maybe this could be > ```C++ > intptr_t* const unadjusted_sp = sp; > sp -= frame::metadata_words; > sp[-2] = unadjusted_sp[-2]; > sp[-1] = unadjusted_sp[-1]; > > log_develop_trace(continuations, preempt)("adjusted sp for c2 runtime stub, initial sp: " INTPTR_FORMAT " final sp: " INTPTR_FORMAT > " fp: " INTPTR_FORMAT, p2i(unadjusted_sp), p2i(sp), sp[-2]); I removed the use of frame::metadata_words from the log statement instead to make it consistent, since we would still implicitly be assuming metadata_words it's 2 words when we do the copying. We could use a memcpy and refer to metadata_words, but I think it is clear this way since we are explicitly talking about the 2 extra words missing from the runtime frame as the comment explains. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809745804 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809746249 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809746397 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809747046 From pchilanomate at openjdk.org Tue Oct 22 02:23:16 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 02:23:16 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 07:57:31 GMT, Axel Boldt-Christmas wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 300: > >> 298: CodeBlob* cb = top.cb(); >> 299: >> 300: if (cb->frame_size() == 2) { > > Is this a filter to identify c2 runtime stubs? Is there some other property we can check or assert here? This assumes that no other runtime frame will have this size. We could also check the caller of the runtime frame, something like: #ifdef ASSERT RegisterMap map(JavaThread::current(), RegisterMap::UpdateMap::skip, RegisterMap::ProcessFrames::skip, RegisterMap::WalkContinuation::skip); frame caller = top.sender(&map); assert(caller.is_compiled_frame(), ""); assert(cb->frame_size() > 2 || caller.cb()->as_nmethod()->is_compiled_by_c2(), ""); #endif Ideally we would want to check if cb->frame_size() is different than the actual?size of the physical frame. > src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp line 1275: > >> 1273: void SharedRuntime::continuation_enter_cleanup(MacroAssembler* masm) { >> 1274: ::continuation_enter_cleanup(masm); >> 1275: } > > Now that `continuation_enter_cleanup` is a static member function, just merge the static free function with this static member function. Since we have 3 free static functions to handle the continuation entry(create, fill, cleanup) I would prefer to keep the cleanup one for consistency. We could also change them all to be members of SharedRuntime. But except for the exception I added for continuation_enter_cleanup(), all these are called by gen_continuation_enter/gen_continuation_yield() which are also static free functions. > src/hotspot/cpu/x86/assembler_x86.cpp line 2866: > >> 2864: emit_int32(0); >> 2865: } >> 2866: } > > Is it possible to make this more general and explicit instead of a sequence of bytes? > > Something along the lines of: > ```C++ > const address tar = L.is_bound() ? target(L) : pc(); > const Address adr = Address(checked_cast(tar - pc()), tar, relocInfo::none); > > InstructionMark im(this); > emit_prefix_and_int8(get_prefixq(adr, dst), (unsigned char)0x8D); > if (!L.is_bound()) { > // Patch @0x8D opcode > L.add_patch_at(code(), CodeBuffer::locator(offset() - 1, sect())); > } > // Register and [rip+disp] operand > emit_modrm(0b00, raw_encode(dst), 0b101); > // Adjust displacement by sizeof lea instruction > int32_t disp = adr.disp() - checked_cast(pc() - inst_mark() + sizeof(int32_t)); > assert(is_simm32(disp), "must be 32bit offset [rip+offset]"); > emit_int32(disp); > > > and then in `pd_patch_instruction` simply match `op == 0x8D /* lea */`. I'll test it out but looks fine. > src/hotspot/share/prims/jvmtiExport.cpp line 1681: > >> 1679: EVT_TRIG_TRACE(EXT_EVENT_VIRTUAL_THREAD_UNMOUNT, ("[%p] Trg Virtual Thread Unmount event triggered", vthread)); >> 1680: >> 1681: // On preemption JVMTI state rebinding has already happened so get it always direclty from the oop. > > Suggestion: > > // On preemption JVMTI state rebinding has already happened so get it always directly from the oop. Fixed. > src/hotspot/share/runtime/frame.cpp line 535: > >> 533: assert(get_register_address_in_stub(f, SharedRuntime::thread_register()) == (address)thread_addr, "wrong thread address"); >> 534: return thread_addr; >> 535: #endif > > With this ifdef, it seems like this belongs in the platform dependent part of the frame class. I moved it to the platform dependent files. > src/hotspot/share/runtime/objectMonitor.hpp line 184: > >> 182: // - We test for anonymous owner by testing for the lowest bit, therefore >> 183: // DEFLATER_MARKER must *not* have that bit set. >> 184: static const int64_t DEFLATER_MARKER = 2; > > The comments here should be updated / removed. They are talking about the lower bits of the owner being unset which is no longer true. (And talks about doing bit tests, which I do not think is done anywhere even without this patch). Removed the comments. > src/hotspot/share/runtime/objectMonitor.hpp line 186: > >> 184: static const int64_t DEFLATER_MARKER = 2; >> 185: >> 186: int64_t volatile _owner; // Either tid of owner, ANONYMOUS_OWNER_MARKER or DEFLATER_MARKER. > > Suggestion: > > int64_t volatile _owner; // Either tid of owner, NO_OWNER, ANONYMOUS_OWNER or DEFLATER_MARKER. Fixed. > src/hotspot/share/runtime/synchronizer.cpp line 1467: > >> 1465: markWord dmw = inf->header(); >> 1466: assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value()); >> 1467: if (inf->is_owner_anonymous() && inflating_thread != nullptr) { > > Are these `LM_LEGACY` + `ANONYMOUS_OWNER` changes still required now that `LM_LEGACY` does no freeze? Yes, it's just a consequence of using tid as the owner, not really related to freezing. So when a thread inflates a monitor that is already owned we cannot store the BasicLock* in the _owner field anymore, since it can clash with some tid, so we mark it as anonymously owned instead. The owner will fix it here when trying to get the monitor, as we do with LM_LIGHTWEIGHT. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809753868 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809749481 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809749657 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809749805 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809750408 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809750552 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809750685 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1809754940 From rkennke at openjdk.org Tue Oct 22 07:32:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 22 Oct 2024 07:32:24 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v47] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Fix needle copying in indexOf intrinsic for smaller headers ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/1b907cc8..8c4eb6d6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=46 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=45-46 Stats: 16 lines in 1 file changed: 0 ins; 0 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From dholmes at openjdk.org Tue Oct 22 07:44:22 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 22 Oct 2024 07:44:22 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv First, congratulations on an exceptional piece of work @pchilano . Also thank you for the very clear breakdown and description in the PR as that helps immensely with trying to digest a change of this size. The overall operational behaviour of this change seems very solid. My only concern is whether the unparker thread may become a bottleneck in some scenarios, but that is a bridge we will have to cross if we come to it. My initial comments mainly come from just trying to understand the top-level changes around the use of the thread-id as the monitor owner. I have a number of suggestions on naming (mainly `is_x` versus `has_x`) and on documenting the API methods more clearly. None of which are showstoppers and some of which pre-exist. Unfortunately though you will need to fix the spelling of `succesor`. Thanks src/hotspot/share/runtime/objectMonitor.hpp line 47: > 45: // ParkEvent instead. Beware, however, that the JVMTI code > 46: // knows about ObjectWaiters, so we'll have to reconcile that code. > 47: // See next_waiter(), first_waiter(), etc. This to-do is likely no longer relevant with the current changes. src/hotspot/share/runtime/objectMonitor.hpp line 288: > 286: // Returns true if this OM has an owner, false otherwise. > 287: bool has_owner() const; > 288: int64_t owner() const; // Returns null if DEFLATER_MARKER is observed. null is not an int64_t value. src/hotspot/share/runtime/objectMonitor.hpp line 292: > 290: > 291: static int64_t owner_for(JavaThread* thread); > 292: static int64_t owner_for_oop(oop vthread); Some comments describing this API would be good. I'm struggling a bit with the "owner for" terminology. I think `owner_from` would be better. And can't these just overload rather than using different names? src/hotspot/share/runtime/objectMonitor.hpp line 302: > 300: // Simply set _owner field to new_value; current value must match old_value. > 301: void set_owner_from_raw(int64_t old_value, int64_t new_value); > 302: void set_owner_from(int64_t old_value, JavaThread* current); Again some comments describing API would good. The old API had vague names like old_value and new_value because of the different forms the owner value could take. Now it is always a thread-id we can do better I think. The distinction between the raw and non-raw forms is unclear and the latter is not covered by the initial comment. src/hotspot/share/runtime/objectMonitor.hpp line 303: > 301: void set_owner_from_raw(int64_t old_value, int64_t new_value); > 302: void set_owner_from(int64_t old_value, JavaThread* current); > 303: // Simply set _owner field to current; current value must match basic_lock_p. Comment is no longer accurate src/hotspot/share/runtime/objectMonitor.hpp line 309: > 307: // _owner field. Returns the prior value of the _owner field. > 308: int64_t try_set_owner_from_raw(int64_t old_value, int64_t new_value); > 309: int64_t try_set_owner_from(int64_t old_value, JavaThread* current); Similar to set_owner* need better comments describing API. src/hotspot/share/runtime/objectMonitor.hpp line 311: > 309: int64_t try_set_owner_from(int64_t old_value, JavaThread* current); > 310: > 311: bool is_succesor(JavaThread* thread); I think `has_successor` is more appropriate here as it is not the monitor that is the successor. src/hotspot/share/runtime/objectMonitor.hpp line 315: > 313: void set_succesor(oop vthread); > 314: void clear_succesor(); > 315: bool has_succesor(); Sorry but `successor` has two `s` before `or`. src/hotspot/share/runtime/objectMonitor.hpp line 317: > 315: bool has_succesor(); > 316: > 317: bool is_owner(JavaThread* thread) const { return owner() == owner_for(thread); } Again `has_owner` seems more appropriate src/hotspot/share/runtime/objectMonitor.hpp line 323: > 321: } > 322: > 323: bool is_owner_anonymous() const { return owner_raw() == ANONYMOUS_OWNER; } Again I struggle with the pre-existing `is_owner` formulation here. The target of the expression is a monitor and we are asking if the monitor has an anonymous owner. src/hotspot/share/runtime/objectMonitor.hpp line 333: > 331: bool is_stack_locker(JavaThread* current); > 332: BasicLock* stack_locker() const; > 333: void set_stack_locker(BasicLock* locker); Again `is` versus `has`, plus some general comments describing the API. src/hotspot/share/runtime/threadIdentifier.cpp line 30: > 28: > 29: // starting at 3, excluding reserved values defined in ObjectMonitor.hpp > 30: static const int64_t INITIAL_TID = 3; Can we express this in terms of those reserved values, or are they inaccessible? src/java.base/share/classes/java/lang/Thread.java line 731: > 729: > 730: if (attached && VM.initLevel() < 1) { > 731: this.tid = 3; // primordial thread The comment before the `ThreadIdentifiers` class needs updating to account for this change. src/java.base/share/classes/java/lang/VirtualThread.java line 109: > 107: * > 108: * RUNNING -> BLOCKING // blocking on monitor enter > 109: * BLOCKING -> BLOCKED // blocked on monitor enter Should this say something similar to the parked case, about the "yield" being successful? src/java.base/share/classes/java/lang/VirtualThread.java line 110: > 108: * RUNNING -> BLOCKING // blocking on monitor enter > 109: * BLOCKING -> BLOCKED // blocked on monitor enter > 110: * BLOCKED -> UNBLOCKED // unblocked, may be scheduled to continue Does this mean it now owns the monitor, or just it is able to re-contest for monitor entry? src/java.base/share/classes/java/lang/VirtualThread.java line 111: > 109: * BLOCKING -> BLOCKED // blocked on monitor enter > 110: * BLOCKED -> UNBLOCKED // unblocked, may be scheduled to continue > 111: * UNBLOCKED -> RUNNING // continue execution after blocked on monitor enter Presumably this one means it acquired the monitor? src/java.base/share/classes/java/lang/VirtualThread.java line 115: > 113: * RUNNING -> WAITING // transitional state during wait on monitor > 114: * WAITING -> WAITED // waiting on monitor > 115: * WAITED -> BLOCKED // notified, waiting to be unblocked by monitor owner Waiting to re-enter the monitor? src/java.base/share/classes/java/lang/VirtualThread.java line 178: > 176: // timed-wait support > 177: private long waitTimeout; > 178: private byte timedWaitNonce; Strange name - what does this mean? src/java.base/share/classes/java/lang/VirtualThread.java line 530: > 528: && carrier == Thread.currentCarrierThread(); > 529: carrier.setCurrentThread(carrier); > 530: Thread.setCurrentLockId(this.threadId()); // keep lock ID of virtual thread I'm struggling to understand the different threads in play when this is called and what the method actual does to which threads. ?? ------------- Changes requested by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2384039238 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810025380 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810027786 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810029858 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810032387 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810033016 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810035434 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810037658 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810036007 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810041017 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810046285 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810049295 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810068395 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810076019 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810111255 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810113028 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810113953 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810114488 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810116177 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810131339 From psadhukhan at openjdk.org Tue Oct 22 08:11:35 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 08:11:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JComboBox/8080972/TestBasicComboBoxEditor.java line 26: > 24: import javax.swing.SwingUtilities; > 25: import javax.swing.plaf.basic.BasicComboBoxEditor; > 26: /* I think we have finally decided that jtreg tag will come after copyright and before imports...Applicable for all modified javax_swing tests in this PR... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810185617 From psadhukhan at openjdk.org Tue Oct 22 08:19:29 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 08:19:29 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java line 49: > 47: SwingUtilities.invokeAndWait(TestJEditor::testJEditorPane); > 48: } > 49: Is there any need to catch the exception and rethrow RuntimeException below? I think we can remove try-catch block altogether... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810199838 From kevinw at openjdk.org Tue Oct 22 08:32:20 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 22 Oct 2024 08:32:20 GMT Subject: RFR: 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 09:21:35 GMT, Kevin Walls wrote: > Test update: HashedPasswordFileTest.java was using System.getProperty("test.src") as a place to _create_ a file. > > jtreg gives us the current working directory for the test invocation as a scratch directory. Create files there, without reading any property to find another location. Thanks for reviewing, Daniel and Alex! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21602#issuecomment-2428610104 From kevinw at openjdk.org Tue Oct 22 08:32:20 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 22 Oct 2024 08:32:20 GMT Subject: Integrated: 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 09:21:35 GMT, Kevin Walls wrote: > Test update: HashedPasswordFileTest.java was using System.getProperty("test.src") as a place to _create_ a file. > > jtreg gives us the current working directory for the test invocation as a scratch directory. Create files there, without reading any property to find another location. This pull request has now been integrated. Changeset: de441c2b Author: Kevin Walls URL: https://git.openjdk.org/jdk/commit/de441c2b6891ad475f516d14b793efbe65f1477c Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod 8342633: javax/management/security/HashedPasswordFileTest.java creates tmp file in src dir Reviewed-by: dfuchs, amenkov ------------- PR: https://git.openjdk.org/jdk/pull/21602 From psadhukhan at openjdk.org Tue Oct 22 09:01:38 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 09:01:38 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <1EhcQfR-j3LoYCg_GkqbbJGXZEEF7PQgXtEfq_MZFZw=.6db08c42-646e-4cc1-b704-07820ae128bb@github.com> On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JOptionPane/8081019/bug8081019.java line 31: > 29: /** > 30: * @test > 31: * @key headful javadoc style /** at the beginning ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810285947 From psadhukhan at openjdk.org Tue Oct 22 09:07:51 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 09:07:51 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java line 48: > 46: test.setupUI(); > 47: test.testApplication(); > 48: test.testApplet(); I guess we can only remove this `testApplet` as SM is invoked there only....we can still test `testApplication`, right? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810297085 From psadhukhan at openjdk.org Tue Oct 22 09:12:33 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 09:12:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java line 66: > 64: } > 65: > 66: // Show popup as if from an applet remove applet ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810309276 From psadhukhan at openjdk.org Tue Oct 22 09:19:31 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 09:19:31 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <1rvnBCeqVl1aLtZcR0YYv7abOQlZ7WNQrOQgH359CVw=.ad43bb44-7be8-429b-aea7-ea4cd8ad507c@github.com> On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java line 117: > 115: } > 116: popup.setVisible(false); > 117: frame.dispose(); The error condition is checked and exception thrown before disposing the frame and popup, guess this 2 should be in finally block.. test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java line 29: > 27: * @test > 28: * @bug 6622002 > 29: * @author Alexander Potochkin remove @author tag ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810327184 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810331078 From psadhukhan at openjdk.org Tue Oct 22 09:32:33 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 22 Oct 2024 09:32:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/UIDefaults/6795356/TableTest.java line 45: > 43: JTable table = new JTable(); > 44: TableCellEditor de = table.getDefaultEditor(Double.class); > 45: if (de == null) { I guess we can test this without SM since it tests SwingLazyValue? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810353747 From dholmes at openjdk.org Tue Oct 22 09:43:41 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 22 Oct 2024 09:43:41 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: <-zfrUge_9zAFIlJQB-L2oytEBTLluINYiNlbkCFkCTE=.db445cce-343f-4792-bfa7-1ea22d453d46@github.com> References: <-zfrUge_9zAFIlJQB-L2oytEBTLluINYiNlbkCFkCTE=.db445cce-343f-4792-bfa7-1ea22d453d46@github.com> Message-ID: <3kfD7hXMBKj93H04sYwW60CpKwCJUbwgfBpDnC9aMj8=.84120ba5-8e46-4711-b220-ec23d5d5f296@github.com> On Tue, 22 Oct 2024 01:43:50 GMT, Julian Waters wrote: > Aren't the dt_shmem and jdwp changes related to HotSpot? Nope. That's core-svc - the non-hotspot side of serviceability. :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2428793636 From kevinw at openjdk.org Tue Oct 22 10:16:20 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Tue, 22 Oct 2024 10:16:20 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 15 Oct 2024 22:31:46 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - updated comment > - feedback test/hotspot/jtreg/serviceability/attach/AttachAPIv2/CompatTest.java line 48: > 46: public static void main(String[] args) throws Exception { > 47: // if the test (client part) in the "compat" mode > 48: boolean clientCompat = "true".equals(System.getProperty("jdk.attach.compat")); Boolean.getBoolean("jdk.attach.compat") ignores case for us as well. But more generally, are we happy with "jdk.attach.compat" as a boolean flag, or would "jdk.attach.version" be better? (which is mainly asking if we think there might ever be another version!) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1810432507 From rkennke at openjdk.org Tue Oct 22 11:19:19 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 22 Oct 2024 11:19:19 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v48] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: - Merge tag 'jdk-24+20' into JDK-8305895-v4 Added tag jdk-24+20 for changeset 7a64fbbb - Fix needle copying in indexOf intrinsic for smaller headers - Compact header riscv (#3) Implement compact headers on RISCV --------- Co-authored-by: hamlin - Remove extra sanity check - Problem-list SharedBaseAddress tests on aarch64 - Address comments by @vpaprotsk - Fix aarch64.ad - Merge tag 'jdk-24+19' into JDK-8305895-v4 Added tag jdk-24+19 for changeset e7c5bf45 - PPC64 implementation of Compact Object Headers (JEP 450) - Increase compiler code stubs size for indexOf intrinsic - ... and 87 more: https://git.openjdk.org/jdk/compare/7a64fbbb...e324d95b ------------- Changes: https://git.openjdk.org/jdk/pull/20677/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=47 Stats: 5021 lines in 212 files changed: 3472 ins; 847 del; 702 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From jwaters at openjdk.org Tue Oct 22 11:35:39 2024 From: jwaters at openjdk.org (Julian Waters) Date: Tue, 22 Oct 2024 11:35:39 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: <3kfD7hXMBKj93H04sYwW60CpKwCJUbwgfBpDnC9aMj8=.84120ba5-8e46-4711-b220-ec23d5d5f296@github.com> References: <-zfrUge_9zAFIlJQB-L2oytEBTLluINYiNlbkCFkCTE=.db445cce-343f-4792-bfa7-1ea22d453d46@github.com> <3kfD7hXMBKj93H04sYwW60CpKwCJUbwgfBpDnC9aMj8=.84120ba5-8e46-4711-b220-ec23d5d5f296@github.com> Message-ID: On Tue, 22 Oct 2024 09:40:35 GMT, David Holmes wrote: > > Aren't the dt_shmem and jdwp changes related to HotSpot? > > Nope. That's core-svc - the non-hotspot side of serviceability. :) Oh, well I guess you learn something new everyday :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2429033577 From michaelm at openjdk.org Tue Oct 22 11:53:39 2024 From: michaelm at openjdk.org (Michael McMahon) Date: Tue, 22 Oct 2024 11:53:39 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <6p0_cedTrQLTFNxCqb97IyWI1coUVKx24hh4vU0nWCw=.7cb573d4-36dc-4c69-94d2-7d0c96201b14@github.com> On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Do we need to keep this test at all? Or if keeping it, does it need the HTTP server simulation, since the bug only relates to the URLPermission instantiation? The test could be reduced to just the URL creation followed by the URLPermission. test/jdk/java/net/URLPermission/OpenURL.java line 30: > 28: * @run main/othervm OpenURL > 29: */ > 30: Do we need to keep this test at all? Or if keeping it, does it need the HTTP server simulation, since the bug only relates to the URLPermission instantiation? The test could be reduced to just the URL creation followed by the URLPermission. ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2384948510 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810575350 From alanb at openjdk.org Tue Oct 22 11:58:30 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 22 Oct 2024 11:58:30 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 15:41:45 GMT, Axel Boldt-Christmas wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/share/runtime/javaThread.cpp line 1545: > >> 1543: if (is_vthread_mounted()) { >> 1544: // _lock_id is the thread ID of the mounted virtual thread >> 1545: st->print_cr(" Carrying virtual thread #" INT64_FORMAT, lock_id()); > > What is the interaction here with `switchToCarrierThread` and the window between? > > carrier.setCurrentThread(carrier); > Thread.setCurrentLockId(this.threadId()); > > Will we print the carrier threads id as a virtual threads id? (I am guessing that is_vthread_mounted is true when switchToCarrierThread is called). Just to say that we hope to eventually remove these "temporary transitions". This PR brings in a change that we've had in the loom repo to not need this when calling out to the scheduler. The only significant remaining use is timed-park. Once we address that then we will remove the need to switch the thread identity and remove some complexity, esp. for JVMTI and serviceability. In the mean-time, yes, the JavaThread.lock_id will temporarily switch to the carrier so a thread-dump/safepoint at just the right time looks like it print will be tid of the carrier rather than the mounted virtual thread. So we should fix that. (The original code in main line skipped this case so was lossy when taking a thread dump when hitting this case, David might remember the discussion on that issue). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810578179 From alanb at openjdk.org Tue Oct 22 11:58:30 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 22 Oct 2024 11:58:30 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 07:28:05 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/java.base/share/classes/java/lang/VirtualThread.java line 115: > >> 113: * RUNNING -> WAITING // transitional state during wait on monitor >> 114: * WAITING -> WAITED // waiting on monitor >> 115: * WAITED -> BLOCKED // notified, waiting to be unblocked by monitor owner > > Waiting to re-enter the monitor? yes > src/java.base/share/classes/java/lang/VirtualThread.java line 178: > >> 176: // timed-wait support >> 177: private long waitTimeout; >> 178: private byte timedWaitNonce; > > Strange name - what does this mean? Sequence number, nouce, anything will work here as it's just to deal with the scenario where the timeout task for a previous wait may run concurrently with a subsequent wait. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810579901 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810583267 From alanb at openjdk.org Tue Oct 22 12:08:19 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 22 Oct 2024 12:08:19 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> On Tue, 22 Oct 2024 07:39:30 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/java.base/share/classes/java/lang/VirtualThread.java line 530: > >> 528: && carrier == Thread.currentCarrierThread(); >> 529: carrier.setCurrentThread(carrier); >> 530: Thread.setCurrentLockId(this.threadId()); // keep lock ID of virtual thread > > I'm struggling to understand the different threads in play when this is called and what the method actual does to which threads. ?? A virtual thread is mounted but doing a timed-park that requires temporarily switching to the identity of the carrier (identity = Therad.currentThread) when queuing the timer task. As mentioned in a reply to Axel, we are close to the point of removing this (nothing to do with object monitors of course, we've had the complexity with temporary transitions since JDK 19). More context here is that there isn't support yet for a carrier to own a monitor before a virtual thread is mounted, and same thing during these temporary transitions. If support for custom schedulers is exposed then that issue will need to be addressed as you don't want some entries on the lock stack owned by the carrier and the others by the mounted virtual thread. Patricio has mentioned inflating any held monitors before mount. There are a couple of efforts in this area going on now, all would need that issue fixed before anything is exposed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810598265 From dholmes at openjdk.org Tue Oct 22 12:20:13 2024 From: dholmes at openjdk.org (David Holmes) Date: Tue, 22 Oct 2024 12:20:13 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: On Tue, 22 Oct 2024 12:05:43 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 530: >> >>> 528: && carrier == Thread.currentCarrierThread(); >>> 529: carrier.setCurrentThread(carrier); >>> 530: Thread.setCurrentLockId(this.threadId()); // keep lock ID of virtual thread >> >> I'm struggling to understand the different threads in play when this is called and what the method actual does to which threads. ?? > > A virtual thread is mounted but doing a timed-park that requires temporarily switching to the identity of the carrier (identity = Therad.currentThread) when queuing the timer task. As mentioned in a reply to Axel, we are close to the point of removing this (nothing to do with object monitors of course, we've had the complexity with temporary transitions since JDK 19). > > More context here is that there isn't support yet for a carrier to own a monitor before a virtual thread is mounted, and same thing during these temporary transitions. If support for custom schedulers is exposed then that issue will need to be addressed as you don't want some entries on the lock stack owned by the carrier and the others by the mounted virtual thread. Patricio has mentioned inflating any held monitors before mount. There are a couple of efforts in this area going on now, all would need that issue fixed before anything is exposed. Okay but .... 1. We have the current virtual thread 2. We have the current carrier for that virtual thread (which is iotself a java.alng.Thread object 3. We have Thread.setCurrentLockId which ... ? which thread does it update? And what does "current" refer to in the name? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810615473 From alanb at openjdk.org Tue Oct 22 12:34:28 2024 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 22 Oct 2024 12:34:28 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: On Tue, 22 Oct 2024 12:17:29 GMT, David Holmes wrote: >> A virtual thread is mounted but doing a timed-park that requires temporarily switching to the identity of the carrier (identity = Therad.currentThread) when queuing the timer task. As mentioned in a reply to Axel, we are close to the point of removing this (nothing to do with object monitors of course, we've had the complexity with temporary transitions since JDK 19). >> >> More context here is that there isn't support yet for a carrier to own a monitor before a virtual thread is mounted, and same thing during these temporary transitions. If support for custom schedulers is exposed then that issue will need to be addressed as you don't want some entries on the lock stack owned by the carrier and the others by the mounted virtual thread. Patricio has mentioned inflating any held monitors before mount. There are a couple of efforts in this area going on now, all would need that issue fixed before anything is exposed. > > Okay but .... > 1. We have the current virtual thread > 2. We have the current carrier for that virtual thread (which is iotself a java.alng.Thread object > 3. We have Thread.setCurrentLockId which ... ? which thread does it update? And what does "current" refer to in the name? Thread identity switches to the carrier so Thread.currentThread() is the carrier thread and JavaThread._lock_id is the thread identifier of the carrier. setCurrentLockId changes JavaThread._lock_id back to the virtual thread's identifier. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810636960 From stefank at openjdk.org Tue Oct 22 13:29:42 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 22 Oct 2024 13:29:42 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v48] In-Reply-To: References: Message-ID: <4UtypHyHundxF7XNmcIsoarpmt4EcfgEzSO4uoobf3Q=.0351e5bb-000e-4068-a5e4-3e3db19a61a0@github.com> On Tue, 22 Oct 2024 11:19:19 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge tag 'jdk-24+20' into JDK-8305895-v4 > > Added tag jdk-24+20 for changeset 7a64fbbb > - Fix needle copying in indexOf intrinsic for smaller headers > - Compact header riscv (#3) > > Implement compact headers on RISCV > --------- > > Co-authored-by: hamlin > - Remove extra sanity check > - Problem-list SharedBaseAddress tests on aarch64 > - Address comments by @vpaprotsk > - Fix aarch64.ad > - Merge tag 'jdk-24+19' into JDK-8305895-v4 > > Added tag jdk-24+19 for changeset e7c5bf45 > - PPC64 implementation of Compact Object Headers (JEP 450) > - Increase compiler code stubs size for indexOf intrinsic > - ... and 87 more: https://git.openjdk.org/jdk/compare/7a64fbbb...e324d95b We've identified another failure in our testing: java -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:TieredStopAtLevel=2 -XX:TLABSize=1 -XX:MinTLABSize=1 ~/tests/HelloWorld.java # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp:50), pid=775231, tid=775232 # assert(desired_tlab_size_bytes > alignment_reserve_bytes) failed: invariant ... V [libjvm.so+0xf4ec11] JfrObjectAllocationSample::send_event(Klass const*, unsigned long, bool, Thread*)+0x2d1 (jfrObjectAllocationSample.cpp:50) V [libjvm.so+0x5d7899] AllocTracer::send_allocation_outside_tlab(Klass*, HeapWordImpl**, unsigned long, JavaThread*)+0x39 (allocTracer.cpp:35) V [libjvm.so+0x139d6c5] MemAllocator::Allocation::notify_allocation_jfr_sampler()+0x225 (memAllocator.cpp:214) V [libjvm.so+0x139f928] MemAllocator::allocate() const+0x2a8 (memAllocator.cpp:235) V [libjvm.so+0x18379bd] TypeArrayKlass::allocate_common(int, bool, JavaThread*)+0x13d (collectedHeap.inline.hpp:41) V [libjvm.so+0x14bc5c8] oopFactory::new_typeArray(BasicType, int, JavaThread*)+0x38 (typeArrayKlass.hpp:68) V [libjvm.so+0x8327f1] Runtime1::new_type_array(JavaThread*, Klass*, int)+0xa1 (c1_Runtime1.cpp:388) ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2429286279 From dfuchs at openjdk.org Tue Oct 22 13:37:36 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 22 Oct 2024 13:37:36 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <6p0_cedTrQLTFNxCqb97IyWI1coUVKx24hh4vU0nWCw=.7cb573d4-36dc-4c69-94d2-7d0c96201b14@github.com> References: <6p0_cedTrQLTFNxCqb97IyWI1coUVKx24hh4vU0nWCw=.7cb573d4-36dc-4c69-94d2-7d0c96201b14@github.com> Message-ID: On Tue, 22 Oct 2024 11:50:13 GMT, Michael McMahon wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/java/net/URLPermission/OpenURL.java line 30: > >> 28: * @run main/othervm OpenURL >> 29: */ >> 30: > > Do we need to keep this test at all? Or if keeping it, does it need the HTTP server simulation, since the bug only relates to the URLPermission instantiation? The test could be reduced to just the URL creation followed by the URLPermission. It could - but technically openConnection / getInputStream could still throw if there was an issue with the provided URL. The difference here is that with a SecurityManager the connection would be rejected with a SecurityException before the connection was made. Without a security manager, the connection will go through, so you need the server simulation (can't rely on getting IOException assuming nobody would be listening). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810741690 From hannesw at openjdk.org Tue Oct 22 13:41:27 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 22 Oct 2024 13:41:27 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules Message-ID: Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. ------------- Commit messages: - 8342827: Fix order of @param tags in other modules Changes: https://git.openjdk.org/jdk/pull/21637/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21637&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342827 Stats: 144 lines in 28 files changed: 58 ins; 58 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/21637.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21637/head:pull/21637 PR: https://git.openjdk.org/jdk/pull/21637 From aboldtch at openjdk.org Tue Oct 22 13:50:32 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Tue, 22 Oct 2024 13:50:32 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2247: > 2245: _thread->lock_stack().move_from_address(tmp_lockstack, lockStackSize); > 2246: > 2247: chunk->set_lockstack_size(0); After some discussion here at the office we think there might be an issue here with simply hiding the oops without clearing them. Below in `recurse_thaw` we `do_barriers`. But it does not touch these lockstack. Missing the SATB store barrier is probably fine from a liveness perspective, because the oops in the lockstack must also be in the frames. But removing the oops without a barrier and clear will probably lead to problems down the line. Something like the following would probably handle this. Or even fuse the `copy_lockstack` and `clear_lockstack` together into some kind of `transfer_lockstack` which both loads and clears the oops. diff --git a/src/hotspot/share/oops/stackChunkOop.cpp b/src/hotspot/share/oops/stackChunkOop.cpp index d3d63533eed..f737bd2db71 100644 --- a/src/hotspot/share/oops/stackChunkOop.cpp +++ b/src/hotspot/share/oops/stackChunkOop.cpp @@ -470,6 +470,28 @@ void stackChunkOopDesc::copy_lockstack(oop* dst) { } } +void stackChunkOopDesc::clear_lockstack() { + const int cnt = lockstack_size(); + const bool requires_gc_barriers = is_gc_mode() || requires_barriers(); + const bool requires_uncompress = has_bitmap() && UseCompressedOops; + const auto clear_obj = [&](intptr_t* at) { + if (requires_uncompress) { + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); + } else { + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); + } + }; + + if (requires_gc_barriers) { + intptr_t* lockstack_start = start_address(); + for (int i = 0; i < cnt; i++) { + clear_obj(&lockstack_start[i]); + } + } + set_lockstack_size(0); + set_has_lockstack(false); +} + void stackChunkOopDesc::print_on(bool verbose, outputStream* st) const { if (*((juint*)this) == badHeapWordVal) { st->print_cr("BAD WORD"); diff --git a/src/hotspot/share/oops/stackChunkOop.hpp b/src/hotspot/share/oops/stackChunkOop.hpp index 28e0576801e..928e94dd695 100644 --- a/src/hotspot/share/oops/stackChunkOop.hpp +++ b/src/hotspot/share/oops/stackChunkOop.hpp @@ -167,6 +167,7 @@ class stackChunkOopDesc : public instanceOopDesc { void fix_thawed_frame(const frame& f, const RegisterMapT* map); void copy_lockstack(oop* start); + void clear_lockstack(); template inline void iterate_lockstack(StackChunkLockStackClosureType* closure); diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index 5b6e48a02f3..e7d505bb9b1 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -2244,8 +2244,7 @@ NOINLINE intptr_t* Thaw::thaw_slow(stackChunkOop chunk, Continuation::t chunk->copy_lockstack(tmp_lockstack); _thread->lock_stack().move_from_address(tmp_lockstack, lockStackSize); - chunk->set_lockstack_size(0); - chunk->set_has_lockstack(false); + chunk->clear_lockstack(); retry_fast_path = true; } ``` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810764911 From aboldtch at openjdk.org Tue Oct 22 13:54:36 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Tue, 22 Oct 2024 13:54:36 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2234: > 2232: retry_fast_path = true; > 2233: } else { > 2234: relativize_chunk_concurrently(chunk); Is the `relativize_chunk_concurrently` solution to the race only to have a single flag read in `can_thaw_fast` or is there some other subtlety here? While not required for the PR, if it is just to optimise the `can_thaw_fast` check, it can probably be made to work with one load and still allow concurrent gcs do fast_thaw when we only get here due to a lockstack. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810772765 From stuefe at openjdk.org Tue Oct 22 13:56:42 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Tue, 22 Oct 2024 13:56:42 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: Message-ID: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> On Thu, 19 Sep 2024 13:34:47 GMT, Thomas Stuefe wrote: >> Do you seen any effects of this in anything other than special-crafted micro benchmarks? I wonder if it would be good enough to hard-code this to be 10 for the first integration of Lilliput. > > I will do some benchmarks I did SpecJBB runs with shift of 6, 8 and 10, respectively, which amounts to Klass alignment of 64, 256 and 1K. Benchmark scores did not show a significant pattern. I did not measure CPU stats though. But I still think a dynamically calculated shift makes sense, and I hesitate to change this code at this point. I therefore would like to move this question to followup RFEs if necessary. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1810775878 From dfuchs at openjdk.org Tue Oct 22 14:15:40 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 22 Oct 2024 14:15:40 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules In-Reply-To: References: Message-ID: <7dvcSAoeYSlu137kdlpuB6oUI-6kaMGogh_NrE5_uF8=.8337effa-84c6-40c7-a14e-73a4dfbce783@github.com> On Tue, 22 Oct 2024 13:36:43 GMT, Hannes Walln?fer wrote: > Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. > > We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. > > I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. Changes to java.management, java.naming, and sctp look good to me. ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21637#pullrequestreview-2385344473 From sgehwolf at openjdk.org Tue Oct 22 14:18:50 2024 From: sgehwolf at openjdk.org (Severin Gehwolf) Date: Tue, 22 Oct 2024 14:18:50 GMT Subject: RFR: 8336881: [Linux] Support for hierarchical limits for Metrics [v11] In-Reply-To: References: Message-ID: <64ooaT_1G3AIl9kLn2ms8Q4GoNLequhhcD05LIETN3g=.449e4916-2770-48f6-b5a8-aa07d6ffeab6@github.com> > Please review this fix for cgroups-based metrics reporting in the `jdk.internal.platform` package. This fix is supposed to address wrong reporting of certain limits if the limits aren't set at the leaf nodes. > > For example, on cg v2, the memory limit interface file is `memory.max`. Consider a cgroup path of `/a/b/c/d`. The current code only reports the limits (via Metrics) correctly if it's set at `/a/b/c/d/memory.max`. However, some systems - like a systemd slice - sets those limits further up the hierarchy. For example at `/a/b/c/memory.max`. `/a/b/c/d/memory.max` might be set to the value `max` (for unlimited), yet `/a/b/c/memory.max` would report the actual limit value (e.g. `1048576000`). > > This patch addresses this issue by: > > 1. Refactoring the interface lookup code to relevant controllers for cpu/memory. The CgroupSubsystem classes then delegate to those for the lookup. This facilitates having an API for the lookup of an updated limit in step 2. > 2. Walking the full hierarchy of the cgroup path (if any), looking for a lower limit than at the leaf. Note that it's not possible to raise the limit set at a path closer to the root via the interface file at a further-to-the-leaf-level. The odd case out seems to be `max` values on some systems (which seems to be the default value). > > As an optimization this hierarchy walk is skipped on containerized systems (like K8S), where the limits are set in interface files at the leaf nodes of the hierarchy. Therefore there should be no change on those systems. > > This patch depends on the Hotspot change implementing the same for the JVM so that `Metrics.isContainerized()` works correctly on affected systems where `-XshowSettings:system` currently reports `System not containerized` due to the missing JVM fix. A test framework for such hierarchical systems has been added in [JDK-8333446](https://bugs.openjdk.org/browse/JDK-8333446). This patch adds a test using that framework among some simpler unit tests. > > Thoughts? > > Testing: > > - [x] GHA > - [x] Container tests on Linux x86_64 on cg v1 and cg v2 systems > - [x] Some manual testing using systemd slices Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 36 commits: - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Add exclusive access dirs directive for systemd tests - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Merge branch 'master' into jdk-8336881-metrics-systemd-slice - Improve systemd slice test for non-root on cg v2 - Fix unit tests - Add JVM_HostActiveProcessorCount using JVM api - Merge branch 'jdk-8322420_cgroup_hierarchy_walk_init' into jdk-8336881-metrics-systemd-slice - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init - ... and 26 more: https://git.openjdk.org/jdk/compare/2da7f2bc...a3989e80 ------------- Changes: https://git.openjdk.org/jdk/pull/20280/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20280&range=10 Stats: 1595 lines in 27 files changed: 1344 ins; 152 del; 99 mod Patch: https://git.openjdk.org/jdk/pull/20280.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20280/head:pull/20280 PR: https://git.openjdk.org/jdk/pull/20280 From rkennke at openjdk.org Tue Oct 22 14:25:12 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 22 Oct 2024 14:25:12 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v49] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Update copyright headers ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/e324d95b..19d05e43 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=48 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=47-48 Stats: 49 lines in 49 files changed: 0 ins; 0 del; 49 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From jpai at openjdk.org Tue Oct 22 15:08:16 2024 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 22 Oct 2024 15:08:16 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 13:36:43 GMT, Hannes Walln?fer wrote: > Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. > > We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. > > I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. Hello Hannes, since `@param` requires a parameter name and since javadoc already warns about incorrect `@param` names (that don't match the name of the method parameter), does the order in which the `@param` is listed in the javadoc text matter? I looked at https://bugs.openjdk.org/browse/JDK-8279931 but that doesn't tell why the order would be important. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21637#issuecomment-2429541439 From aph at openjdk.org Tue Oct 22 15:26:30 2024 From: aph at openjdk.org (Andrew Haley) Date: Tue, 22 Oct 2024 15:26:30 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > * We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. This last sentence has interesting consequences for user-defined schedulers. Would it make sense to throw an exception if a carrier thread is holding a monitor while mounting a virtual thread? Doing that would also have the advantage of making some kinds of deadlock impossible. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2429587519 From mullan at openjdk.org Tue Oct 22 15:28:37 2024 From: mullan at openjdk.org (Sean Mullan) Date: Tue, 22 Oct 2024 15:28:37 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> Message-ID: On Tue, 22 Oct 2024 08:09:01 GMT, Prasanta Sadhukhan wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/javax/swing/JComboBox/8080972/TestBasicComboBoxEditor.java line 26: > >> 24: import javax.swing.SwingUtilities; >> 25: import javax.swing.plaf.basic.BasicComboBoxEditor; >> 26: /* > > I think we have finally decided that jtreg tag will come after copyright and before imports...Applicable for all modified javax_swing tests in this PR... This should be addressed in a more general separate task, and not part of this PR since it does not have anything to do with the changes in this JEP. > test/jdk/javax/swing/JOptionPane/8081019/bug8081019.java line 31: > >> 29: /** >> 30: * @test >> 31: * @key headful > > javadoc style /** at the beginning Not specific to JEP 486, this should be done as part of a different issue. > test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java line 66: > >> 64: } >> 65: >> 66: // Show popup as if from an applet > > remove applet Not specific to JEP 486, this should be done as part of a different issue. > test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java line 29: > >> 27: * @test >> 28: * @bug 6622002 >> 29: * @author Alexander Potochkin > > remove @author tag Not specific to JEP 486, this should be done as part of a different issue. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810939227 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810942471 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810943153 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1810943359 From aph at openjdk.org Tue Oct 22 15:40:14 2024 From: aph at openjdk.org (Andrew Haley) Date: Tue, 22 Oct 2024 15:40:14 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 60: > 58: > 59: assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_lock_lightweight"); > 60: assert_different_registers(oop, box, tmp, disp_hdr, rscratch2); Historically, silently using `rscratch1` and `rscratch2` in these macros has sometimes turned out to be a mistake. Please consider making `rscratch2` an additional argument to `fast_lock`, so that it's explicit in the caller. It won't make any difference to the generated code, but it might help readbility. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810966647 From aph at openjdk.org Tue Oct 22 15:53:21 2024 From: aph at openjdk.org (Andrew Haley) Date: Tue, 22 Oct 2024 15:53:21 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:37:23 GMT, Andrew Haley wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 60: > >> 58: >> 59: assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_lock_lightweight"); >> 60: assert_different_registers(oop, box, tmp, disp_hdr, rscratch2); > > Historically, silently using `rscratch1` and `rscratch2` in these macros has sometimes turned out to be a mistake. > Please consider making `rscratch2` an additional argument to `fast_lock`, so that it's explicit in the caller. It won't make any difference to the generated code, but it might help readbility. Note also that `inc_held_monitor_count` clobbers `rscratch2`. That might be worth a comment at the call site. I guess `inc_held_monitor_count` is so hot that we can't push and pop scratch registers, in which case it'd clobber nothing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810985771 From aph at openjdk.org Tue Oct 22 15:53:24 2024 From: aph at openjdk.org (Andrew Haley) Date: Tue, 22 Oct 2024 15:53:24 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: > > - Fix comments in objectMonitor.hpp > - Move frame::saved_thread_address() to platform dependent files > - Fix typo in jvmtiExport.cpp > - remove usage of frame::metadata_words in possibly_adjust_frame() > - Fix comments in c2 locking paths > - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5341: > 5339: > 5340: void MacroAssembler::inc_held_monitor_count() { > 5341: Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); Suggestion: // Clobbers: rscratch1 and rscratch2 void MacroAssembler::inc_held_monitor_count() { Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5357: > 5355: > 5356: void MacroAssembler::dec_held_monitor_count() { > 5357: Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); Suggestion: // Clobbers: rscratch1 and rscratch2 void MacroAssembler::dec_held_monitor_count() { Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810987929 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810989022 From aph at openjdk.org Tue Oct 22 15:58:24 2024 From: aph at openjdk.org (Andrew Haley) Date: Tue, 22 Oct 2024 15:58:24 GMT Subject: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:48:43 GMT, Andrew Haley wrote: >> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 60: >> >>> 58: >>> 59: assert(LockingMode != LM_LIGHTWEIGHT, "lightweight locking should use fast_lock_lightweight"); >>> 60: assert_different_registers(oop, box, tmp, disp_hdr, rscratch2); >> >> Historically, silently using `rscratch1` and `rscratch2` in these macros has sometimes turned out to be a mistake. >> Please consider making `rscratch2` an additional argument to `fast_lock`, so that it's explicit in the caller. It won't make any difference to the generated code, but it might help readbility. > > Note also that `inc_held_monitor_count` clobbers `rscratch2`. That might be worth a comment at the call site. > I guess `inc_held_monitor_count` is so hot that we can't push and pop scratch registers, in which case it'd clobber nothing. > Historically, silently using `rscratch1` and `rscratch2` in these macros has sometimes turned out to be a mistake. Please consider making `rscratch2` an additional argument to `fast_lock`, so that it's explicit in the caller. It won't make any difference to the generated code, but it might help readbility. Hmm, forget that. It's rather tricky code, that's true, but I think we're OK. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1810998545 From rsunderbabu at openjdk.org Tue Oct 22 15:59:18 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Tue, 22 Oct 2024 15:59:18 GMT Subject: RFR: 8202100: merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler Message-ID: Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. Testing done for Tiers 1,2,3 test/hotspot/jtreg tests ------------- Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/21641/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21641&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8202100 Stats: 223 lines in 7 files changed: 87 ins; 126 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/21641.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21641/head:pull/21641 PR: https://git.openjdk.org/jdk/pull/21641 From wkemper at openjdk.org Tue Oct 22 16:01:47 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 22 Oct 2024 16:01:47 GMT Subject: RFR: 8337511: Implement JEP 404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Wed, 9 Oct 2024 03:26:30 GMT, Liang Mao wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > Congratulations! Good to see the great progress. I just built this PR for some testing and found something unexpected. I ran the genshen VS shenandoah(default) with jbb2015 on aarch64 N2 with 8 cores and Xmx8g. The critical-jOPS of genshen(5373) is behind shenandoah(6027). Do I miss something on the options? > ```java -Xmx8g -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational -Xlog:gc* -XX:MetaspaceSize=1g -jar specjbb2015.jar -m COMPOSITE``` @mmyxym , Thank you for testing this out! I apologize for not responding to your comment sooner. We run specjbb2015 regularly in our integration pipeline. We see a slight improvement with the generational mode; certainly no regression: Shen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3620, critical-jOPS = 2375 Gen: RUN RESULT: hbIR (max attempted) = 3934, hbIR (settled) = 3295, max-jOPS = 4013, critical-jOPS = 2470 Shen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3667, critical-jOPS = 2397 Gen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3996, critical-jOPS = 2414 These results were produced with these arguments: -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticV MOptions -XX:-TieredCompilation -XX:-ShenandoahPacing -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -Xmx10g -Xms10g -XX:ShenandoahGCMode=generational These runs executed on a Graviton2 host with 4 cores, 16G. I'll run again on a host with more cores and with your exact command line parameters. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21273#issuecomment-2429671754 From rkennke at openjdk.org Tue Oct 22 16:19:24 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 22 Oct 2024 16:19:24 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: - Update copyright - Avoid assert/endless-loop in JFR code ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/19d05e43..1ef6394d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=49 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=48-49 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Tue Oct 22 16:26:39 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Tue, 22 Oct 2024 16:26:39 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:19:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright > - Avoid assert/endless-loop in JFR code @egahlin / @mgronlun could you please review the JFR parts of this PR? One change is for getting the right prototype header, the other is for avoiding an endless loop/assert in a corner case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2429724926 From iklam at openjdk.org Tue Oct 22 16:36:50 2024 From: iklam at openjdk.org (Ioi Lam) Date: Tue, 22 Oct 2024 16:36:50 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking Message-ID: This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). ---- Note: this is a combined PR of the following individual PRs - https://github.com/openjdk/jdk/pull/20516 - https://github.com/openjdk/jdk/pull/20517 - https://github.com/openjdk/jdk/pull/20843 - https://github.com/openjdk/jdk/pull/20958 - https://github.com/openjdk/jdk/pull/20959 - https://github.com/openjdk/jdk/pull/21049 - https://github.com/openjdk/jdk/pull/21143 ------------- Commit messages: - Merge branch 'jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke' into jep-483-step-07-8293336-store-lambda-forms-in-cds-archive - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap - @calvinccheung review comments - @coleenp: No need to hold InvokeMethodIntrinsicTable_lock during bootstrap - Better fix for JDK-8342438: runtime/cds/SharedBaseAddress.java fails with Parallel and Serial GCs when running with AOTClassLinking enabled - (1) @ashu-mehra review comments - code simplfication; (2) fix bug in last commit - @DanHeidinga comments - removed dead code; added assert with ArchiveBuilder::has_been_buffered(src_ik) - Fixed JDK-8342732: java/lang/invoke/MethodTypeSecurityManager.java fails with "should never leak JDK internal class" in case AOTClassLinking enabled - ... and 142 more: https://git.openjdk.org/jdk/compare/8d0975a2...f0bc1ae6 Changes: https://git.openjdk.org/jdk/pull/21642/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8331497 Stats: 6713 lines in 104 files changed: 5835 ins; 560 del; 318 mod Patch: https://git.openjdk.org/jdk/pull/21642.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21642/head:pull/21642 PR: https://git.openjdk.org/jdk/pull/21642 From hannesw at openjdk.org Tue Oct 22 16:52:37 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 22 Oct 2024 16:52:37 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules In-Reply-To: References: Message-ID: <6rbSFaQrFn1gW7D8VtU2EqAQr4WoZKBdnapd9w3yEIU=.50bab757-b312-4b84-a220-e88fdd1f3bed@github.com> On Tue, 22 Oct 2024 15:05:05 GMT, Jaikiran Pai wrote: >> Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. >> >> We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. >> >> I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. > > Hello Hannes, since `@param` requires a parameter name and since javadoc already warns about incorrect `@param` names (that don't match the name of the method parameter), does the order in which the `@param` is listed in the javadoc text matter? I looked at https://bugs.openjdk.org/browse/JDK-8279931 but that doesn't tell why the order would be important. @jaikiran it does not matter for the generated documentation because we already [put the tags in the correct order][JDK-8234682]. So it's purely a code hygiene issue to make doc comments easier to read and maintain. [JDK-8234682]: https://bugs.openjdk.org/browse/JDK-8234682 ------------- PR Comment: https://git.openjdk.org/jdk/pull/21637#issuecomment-2429770979 From hannesw at openjdk.org Tue Oct 22 16:52:44 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 22 Oct 2024 16:52:44 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules In-Reply-To: <7dvcSAoeYSlu137kdlpuB6oUI-6kaMGogh_NrE5_uF8=.8337effa-84c6-40c7-a14e-73a4dfbce783@github.com> References: <7dvcSAoeYSlu137kdlpuB6oUI-6kaMGogh_NrE5_uF8=.8337effa-84c6-40c7-a14e-73a4dfbce783@github.com> Message-ID: On Tue, 22 Oct 2024 14:12:11 GMT, Daniel Fuchs wrote: > Changes to java.management, java.naming, and sctp look good to me. Thanks @dfuch, setting reviewers to 2 for changes in the the remaining modules. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21637#issuecomment-2429782605 From prr at openjdk.org Tue Oct 22 16:53:19 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 22 Oct 2024 16:53:19 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> Message-ID: <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> On Tue, 22 Oct 2024 15:22:08 GMT, Sean Mullan wrote: >> test/jdk/javax/swing/JComboBox/8080972/TestBasicComboBoxEditor.java line 26: >> >>> 24: import javax.swing.SwingUtilities; >>> 25: import javax.swing.plaf.basic.BasicComboBoxEditor; >>> 26: /* >> >> I think we have finally decided that jtreg tag will come after copyright and before imports...Applicable for all modified javax_swing tests in this PR... > > This should be addressed in a more general separate task, and not part of this PR since it does not have anything to do with the changes in this JEP. Agreed. This is not a "clean up / update tests" task. If it is a change on some lines of code that are updated by the SM changes, then that's fair game, but otherwise only the SM behaviour is part of this task. Anything that is not needed to be changed for that purpose, can (and mostly should) be left alone. >> test/jdk/javax/swing/JOptionPane/8081019/bug8081019.java line 31: >> >>> 29: /** >>> 30: * @test >>> 31: * @key headful >> >> javadoc style /** at the beginning > > Not specific to JEP 486, this should be done as part of a different issue. agreed. No need to touch. >> test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java line 29: >> >>> 27: * @test >>> 28: * @bug 6622002 >>> 29: * @author Alexander Potochkin >> >> remove @author tag > > Not specific to JEP 486, this should be done as part of a different issue. agreed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811067982 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811068956 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811070418 From zgu at openjdk.org Tue Oct 22 17:15:17 2024 From: zgu at openjdk.org (Zhengyu Gu) Date: Tue, 22 Oct 2024 17:15:17 GMT Subject: RFR: 8337511: Implement JEP 404: Generational Shenandoah (Experimental) [v3] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Wed, 9 Oct 2024 03:26:30 GMT, Liang Mao wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 478 commits: >> >> - Fix merge error >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux >> - Merge branch 'shenandoah/master' into great-genshen-pr-redux >> - Merge >> - 8341099: GenShen: assert(HAS_FWD == _heap->has_forwarded_objects()) failed: Forwarded object status is sane >> >> Reviewed-by: kdnilsen >> - 8341485: GenShen: Make evac tracker a non-product feature and confine it to generational mode >> >> Reviewed-by: kdnilsen, ysr >> - Merge >> - 8341042: GenShen: Reset mark bitmaps for unaffiliated regions when preparing for a cycle >> >> Reviewed-by: kdnilsen >> - 8339616: GenShen: Introduce new state to distinguish promote-in-place phase as distinct from concurrent evacuation >> >> Reviewed-by: kdnilsen, shade, ysr >> - ... and 468 more: https://git.openjdk.org/jdk/compare/b9db74a6...4db1e0e1 > > Congratulations! Good to see the great progress. I just built this PR for some testing and found something unexpected. I ran the genshen VS shenandoah(default) with jbb2015 on aarch64 N2 with 8 cores and Xmx8g. The critical-jOPS of genshen(5373) is behind shenandoah(6027). Do I miss something on the options? > ```java -Xmx8g -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational -Xlog:gc* -XX:MetaspaceSize=1g -jar specjbb2015.jar -m COMPOSITE``` > @mmyxym , Thank you for testing this out! I apologize for not responding to your comment sooner. We run specjbb2015 regularly in our integration pipeline. We see a slight improvement with the generational mode; certainly no regression: > > ``` > Shen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3620, critical-jOPS = 2375 > Gen: RUN RESULT: hbIR (max attempted) = 3934, hbIR (settled) = 3295, max-jOPS = 4013, critical-jOPS = 2470 > Shen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3667, critical-jOPS = 2397 > Gen: RUN RESULT: hbIR (max attempted) = 4701, hbIR (settled) = 3934, max-jOPS = 3996, critical-jOPS = 2414 > ``` > > These results were produced with these arguments: > > ``` > -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticV > MOptions -XX:-TieredCompilation -XX:-ShenandoahPacing -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -Xmx10g -Xms10g -XX:ShenandoahGCMode=generational > ``` > > These runs executed on a Graviton2 host with 4 cores, 16G. I'll run again on a host with more cores and with your exact command line parameters. What's the reason to disable tiered compilation? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21273#issuecomment-2429827638 From kvn at openjdk.org Tue Oct 22 17:23:09 2024 From: kvn at openjdk.org (Vladimir Kozlov) Date: Tue, 22 Oct 2024 17:23:09 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:19:48 GMT, Ioi Lam wrote: > This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). > > ---- > Note: this is a combined PR of the following individual PRs > - https://github.com/openjdk/jdk/pull/20516 > - https://github.com/openjdk/jdk/pull/20517 > - https://github.com/openjdk/jdk/pull/20843 > - https://github.com/openjdk/jdk/pull/20958 > - https://github.com/openjdk/jdk/pull/20959 > - https://github.com/openjdk/jdk/pull/21049 > - https://github.com/openjdk/jdk/pull/21143 Approved. ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21642#pullrequestreview-2385847834 From coleenp at openjdk.org Tue Oct 22 17:28:05 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Tue, 22 Oct 2024 17:28:05 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:52:27 GMT, Ramkumar Sunderbabu wrote: > Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. > > Testing done for > Tiers 1,2,3 > test/hotspot/jtreg tests I've occasionally run into this duplication and am happy you're fixing it. test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java line 228: > 226: } > 227: > 228: public static Map compile(Map inputMap) { Could the tests that use this 'compile' be easily fixed to use the below version of 'compile' so you can delete this too? ------------- PR Review: https://git.openjdk.org/jdk/pull/21641#pullrequestreview-2385856947 PR Review Comment: https://git.openjdk.org/jdk/pull/21641#discussion_r1811119284 From cjplummer at openjdk.org Tue Oct 22 18:06:08 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 22 Oct 2024 18:06:08 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 14:34:30 GMT, Julian Waters wrote: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did src/jdk.jdi/windows/native/libdt_shmem/shmem_md.c line 47: > 45: { > 46: void *mappedMemory; > 47: // HANDLE memHandle; Why comment out this one but not the one at line 88? It seems they are both equally problematic and are hiding the static memHandle. I'm not sure why the 2nd one isn't flagged. I'd actually suggest getting rid of the static memHandle. It does not seem to be needed. src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c line 53: > 51: #ifndef _WIN32 > 52: static MUTEX_T my_mutex = MUTEX_INIT; > 53: #endif The reason for no reference on windows is because of the following on windows: #define MUTEX_LOCK(x) /* FIXUP? */ #define MUTEX_UNLOCK(x) /* FIXUP? */ So looks like this mutex support is something we never got around to. I think your current workaround is fine. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1811166232 PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1811154735 From lmesnik at openjdk.org Tue Oct 22 18:26:15 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 22 Oct 2024 18:26:15 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 17:24:55 GMT, Coleen Phillimore wrote: >> Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. >> >> Testing done for >> Tiers 1,2,3 >> test/hotspot/jtreg tests > > test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java line 228: > >> 226: } >> 227: >> 228: public static Map compile(Map inputMap) { > > Could the tests that use this 'compile' be easily fixed to use the below version of 'compile' so you can delete this too? Agree, most of tests should be updated to use compile(String className ...) and remove wrapping the single file into Map. While there are tests that need this method to compile several source files as a single batch. This comments should be added to this method , and it might be renamed to clearly says that it compile a batch of files. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21641#discussion_r1811182608 From lmesnik at openjdk.org Tue Oct 22 18:26:14 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 22 Oct 2024 18:26:14 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:52:27 GMT, Ramkumar Sunderbabu wrote: > Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. > > Testing done for > Tiers 1,2,3 > test/hotspot/jtreg tests Changes requested by lmesnik (Reviewer). test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java line 173: > 171: > 172: // Wraper for class file > 173: static class ClassFile extends SimpleJavaFileObject { The original class has MemoryJavaFileObject already which could be removed now once we have ClassFile and SourceFile test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java line 243: > 241: System.out.println(writer.toString()); > 242: System.out.println("*********** javac output end ***********"); > 243: if (writer.toString().contains("java.lang.OutOfMemoryError")) { I don't think we need separate OOME handling. Not sure it ever can happens. ------------- PR Review: https://git.openjdk.org/jdk/pull/21641#pullrequestreview-2385956062 PR Review Comment: https://git.openjdk.org/jdk/pull/21641#discussion_r1811190699 PR Review Comment: https://git.openjdk.org/jdk/pull/21641#discussion_r1811184213 From wkemper at openjdk.org Tue Oct 22 18:28:23 2024 From: wkemper at openjdk.org (William Kemper) Date: Tue, 22 Oct 2024 18:28:23 GMT Subject: RFR: 8337511: Implement JEP 404: Generational Shenandoah (Experimental) [v5] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Mon, 21 Oct 2024 21:16:50 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 492 commits: > > - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8342560: GenShen: Fix confusing method name > > Reviewed-by: ysr > - 8342564: GenShen: Only reference young/old generation names in generational mode > > Reviewed-by: xpeng, ysr > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux > - 8342214: GenShen: Reduce code duplication in shFreeSet with iterator abstraction > > Reviewed-by: kdnilsen, ysr > - 8342239: GenShen: Revert changes in adaptive heuristic to avoid overflow on 32 bit > > Reviewed-by: ysr > - 8342278: GenShen: Move non-generational mode test out of generational test configuration > > Reviewed-by: ysr > - 8342255: GenShen: Remove unnecessary enum initial values > > Reviewed-by: ysr > - ... and 482 more: https://git.openjdk.org/jdk/compare/71583222...2a2aa408 We disabled tiered compilation to force everything to compile through C2 to get more consistent results. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21273#issuecomment-2429963097 From amenkov at openjdk.org Tue Oct 22 18:33:09 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 22 Oct 2024 18:33:09 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 22 Oct 2024 10:12:10 GMT, Kevin Walls wrote: >> Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: >> >> - updated comment >> - feedback > > test/hotspot/jtreg/serviceability/attach/AttachAPIv2/CompatTest.java line 48: > >> 46: public static void main(String[] args) throws Exception { >> 47: // if the test (client part) in the "compat" mode >> 48: boolean clientCompat = "true".equals(System.getProperty("jdk.attach.compat")); > > Boolean.getBoolean("jdk.attach.compat") ignores case for us as well. > But more generally, are we happy with "jdk.attach.compat" as a boolean flag, or would "jdk.attach.version" be better? > (which is mainly asking if we think there might ever be another version!) I thought about making the property numeric, but that adds complexity in the logic and I don't think we will need another version soon. Anyway it's internal property for testing only, so we can change it any time. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1811198803 From dhanalla at openjdk.org Tue Oct 22 18:42:13 2024 From: dhanalla at openjdk.org (Dhamoder Nalla) Date: Tue, 22 Oct 2024 18:42:13 GMT Subject: Withdrawn: 8337408: Use GetTempPath2 API instead of GetTempPath In-Reply-To: References: Message-ID: On Thu, 15 Aug 2024 16:23:18 GMT, Dhamoder Nalla wrote: > Use the GetTempPath2 APIs instead of the GetTempPath APIs in native code across the OpenJDK repository to retrieve the temporary directory path, as GetTempPath2 provides enhanced security. While GetTempPath may still function without errors, using GetTempPath2 reduces the risk of potential exploits for users. > > > The code to dynamically load GetTempPath2 is duplicated due to the following reasons. I would appreciate any suggestions to remove the duplication where possible: > > 1. The changes span across four different folders?java.base, jdk.package, jdk.attach, and hotspot?with no shared code between them. > 2. Some parts of the code use version A, while others use version W (ANSI vs. Unicode). > 3. Some parts of the code are written in C others in C++. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20600 From pchilanomate at openjdk.org Tue Oct 22 19:01:02 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 19:01:02 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v4] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: Make lea with RIP-relative addressing more general ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/23d1a2be..81e5c6d0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=02-03 Stats: 24 lines in 2 files changed: 7 ins; 9 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Tue Oct 22 19:07:09 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 19:07:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v4] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:14:23 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/cpu/x86/assembler_x86.cpp line 2866: >> >>> 2864: emit_int32(0); >>> 2865: } >>> 2866: } >> >> Is it possible to make this more general and explicit instead of a sequence of bytes? >> >> Something along the lines of: >> ```C++ >> const address tar = L.is_bound() ? target(L) : pc(); >> const Address adr = Address(checked_cast(tar - pc()), tar, relocInfo::none); >> >> InstructionMark im(this); >> emit_prefix_and_int8(get_prefixq(adr, dst), (unsigned char)0x8D); >> if (!L.is_bound()) { >> // Patch @0x8D opcode >> L.add_patch_at(code(), CodeBuffer::locator(offset() - 1, sect())); >> } >> // Register and [rip+disp] operand >> emit_modrm(0b00, raw_encode(dst), 0b101); >> // Adjust displacement by sizeof lea instruction >> int32_t disp = adr.disp() - checked_cast(pc() - inst_mark() + sizeof(int32_t)); >> assert(is_simm32(disp), "must be 32bit offset [rip+offset]"); >> emit_int32(disp); >> >> >> and then in `pd_patch_instruction` simply match `op == 0x8D /* lea */`. > > I'll test it out but looks fine. Done. I simplified the code a bit to make it more readable. It also follows the current style of keeping the cases separate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811237106 From pchilanomate at openjdk.org Tue Oct 22 19:07:10 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Tue, 22 Oct 2024 19:07:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 13:51:26 GMT, Axel Boldt-Christmas wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2234: > >> 2232: retry_fast_path = true; >> 2233: } else { >> 2234: relativize_chunk_concurrently(chunk); > > Is the `relativize_chunk_concurrently` solution to the race only to have a single flag read in `can_thaw_fast` or is there some other subtlety here? > > While not required for the PR, if it is just to optimise the `can_thaw_fast` check, it can probably be made to work with one load and still allow concurrent gcs do fast_thaw when we only get here due to a lockstack. Yes, it's just to do a single read. I guess you are thinking of combining flags and lockStackSize into a int16_t? > src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2247: > >> 2245: _thread->lock_stack().move_from_address(tmp_lockstack, lockStackSize); >> 2246: >> 2247: chunk->set_lockstack_size(0); > > After some discussion here at the office we think there might be an issue here with simply hiding the oops without clearing them. Below in `recurse_thaw` we `do_barriers`. But it does not touch these lockstack. Missing the SATB store barrier is probably fine from a liveness perspective, because the oops in the lockstack must also be in the frames. But removing the oops without a barrier and clear will probably lead to problems down the line. > > Something like the following would probably handle this. Or even fuse the `copy_lockstack` and `clear_lockstack` together into some kind of `transfer_lockstack` which both loads and clears the oops. > > > diff --git a/src/hotspot/share/oops/stackChunkOop.cpp b/src/hotspot/share/oops/stackChunkOop.cpp > index d3d63533eed..f737bd2db71 100644 > --- a/src/hotspot/share/oops/stackChunkOop.cpp > +++ b/src/hotspot/share/oops/stackChunkOop.cpp > @@ -470,6 +470,28 @@ void stackChunkOopDesc::copy_lockstack(oop* dst) { > } > } > > +void stackChunkOopDesc::clear_lockstack() { > + const int cnt = lockstack_size(); > + const bool requires_gc_barriers = is_gc_mode() || requires_barriers(); > + const bool requires_uncompress = has_bitmap() && UseCompressedOops; > + const auto clear_obj = [&](intptr_t* at) { > + if (requires_uncompress) { > + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); > + } else { > + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); > + } > + }; > + > + if (requires_gc_barriers) { > + intptr_t* lockstack_start = start_address(); > + for (int i = 0; i < cnt; i++) { > + clear_obj(&lockstack_start[i]); > + } > + } > + set_lockstack_size(0); > + set_has_lockstack(false); > +} > + > void stackChunkOopDesc::print_on(bool verbose, outputStream* st) const { > if (*((juint*)this) == badHeapWordVal) { > st->print_cr("BAD WORD"); > diff --git a/src/hotspot/share/oops/stackChunkOop.hpp b/src/hotspot/share/oops/stackChunkOop.hpp > index 28e0576801e..928e94dd695 100644 > --- a/src/hotspot/share/oops/stackChunkOop.hpp > +++ b/src/hotspot/share/oops/stackChunkOop.hpp > @@ -167,6 +167,7 @@ class stackChunkOopDesc : public instanceOopDesc { > void fix_thawed_frame(const frame& f, const RegisterMapT* map); > > void copy_lockstack(oop* start); > + void clear_lockstack(); > > template References: Message-ID: On Tue, 22 Oct 2024 11:51:47 GMT, Alan Bateman wrote: >> src/hotspot/share/runtime/javaThread.cpp line 1545: >> >>> 1543: if (is_vthread_mounted()) { >>> 1544: // _lock_id is the thread ID of the mounted virtual thread >>> 1545: st->print_cr(" Carrying virtual thread #" INT64_FORMAT, lock_id()); >> >> What is the interaction here with `switchToCarrierThread` and the window between? >> >> carrier.setCurrentThread(carrier); >> Thread.setCurrentLockId(this.threadId()); >> >> Will we print the carrier threads id as a virtual threads id? (I am guessing that is_vthread_mounted is true when switchToCarrierThread is called). > > Just to say that we hope to eventually remove these "temporary transitions". This PR brings in a change that we've had in the loom repo to not need this when calling out to the scheduler. The only significant remaining use is timed-park. Once we address that then we will remove the need to switch the thread identity and remove some complexity, esp. for JVMTI and serviceability. > > In the mean-time, yes, the JavaThread.lock_id will temporarily switch to the carrier so a thread-dump/safepoint at just the right time looks like it print will be tid of the carrier rather than the mounted virtual thread. So we should fix that. (The original code in main line skipped this case so was lossy when taking a thread dump when hitting this case, David might remember the discussion on that issue). The problem is that within that window we don't have access to the virtual thread's tid. The current thread has already been changed and we haven't yet set the lock id back. Since this will be a rare corner case maybe we can just print tid unavailable if we hit it. We could also add a boolean to setCurrentThread to indicate we don't want to change the lock_id, but not sure it's worth it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811240529 From sspitsyn at openjdk.org Tue Oct 22 19:08:07 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 22 Oct 2024 19:08:07 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v7] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: explain better what methods can be annotated with JvmtiMountTransition ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/94862c30..d59d499e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=05-06 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sspitsyn at openjdk.org Tue Oct 22 19:16:21 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Tue, 22 Oct 2024 19:16:21 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v8] In-Reply-To: References: Message-ID: <15ZEmA1D4X71LAEk66t2yPYmkdYvOI5W1ySny1-k9TI=.14eb1bd0-d75a-4a93-899c-a563a53bb058@github.com> > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - Merge - review: explain better what methods can be annotated with JvmtiMountTransition - review: clarify the use of annotation @JvmtiMountTransition in yield/yield0 - review: moved notifyJvmtiStart/notifyJvmtiEnd calls from VirtualThread.run to the caller - review: tweaked disabler for carrier threads; more hiddenjvmti_mount_transition frames - Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run - review: 1. Minor tweaks in new test; 2. Refactor skip_hidden_frames in two - fix one more place with trailing spaces - fix trailing spaces - add new test coverage with vthread/CheckHiddenFrames - ... and 1 more: https://git.openjdk.org/jdk/compare/d6eddcda...54dc2b4a ------------- Changes: https://git.openjdk.org/jdk/pull/21397/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=07 Stats: 282 lines in 11 files changed: 236 ins; 18 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From stefank at openjdk.org Tue Oct 22 20:11:27 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 22 Oct 2024 20:11:27 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: <8O2eaSeTC3JyNsCK6Tb-RGi8NzbA17M5S0mnuF_szo0=.f7da9bb1-fd4b-47df-a56c-e6803182dd27@github.com> On Tue, 22 Oct 2024 16:19:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright > - Avoid assert/endless-loop in JFR code Our testing has found a failure in serviceability/sa/ClhsdbJstackWithConcurrentLock.java when we run C1-only. I've narrowed it down to be a stale, but seemingly working, implementation of the TLAB data structure. When Lilliput changes the header size this implementation doesn't work anymore and needs to be fixed. The reproducer for this problem is: make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" See how the thread reports that the frame holds an AOS, but the list of "Locked ownable synchronizers" is (incorrectly) empty: "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] java.lang.Thread.State: TIMED_WAITING (sleeping) JavaThread state: _thread_blocked - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) Locked ownable synchronizers: - None This happens because the TLAB ranges become overlapped and that confuses the rest of the SA code that looks for objects in the heap. I've created a fix for this, which I intend to try to get pushed to openjdk/jdk: https://github.com/openjdk/jdk/compare/pr/20677...stefank:jdk:8342857_SA_heap_iterator_fix https://github.com/stefank/jdk/tree/8342857_SA_heap_iterator_fix ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2430157348 From iklam at openjdk.org Tue Oct 22 20:35:38 2024 From: iklam at openjdk.org (Ioi Lam) Date: Tue, 22 Oct 2024 20:35:38 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v2] In-Reply-To: References: Message-ID: > This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). > > ---- > Note: this is a combined PR of the following individual PRs > - https://github.com/openjdk/jdk/pull/20516 > - https://github.com/openjdk/jdk/pull/20517 > - https://github.com/openjdk/jdk/pull/20843 > - https://github.com/openjdk/jdk/pull/20958 > - https://github.com/openjdk/jdk/pull/20959 > - https://github.com/openjdk/jdk/pull/21049 > - https://github.com/openjdk/jdk/pull/21143 Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 157 commits: - @rose00 offline comments -- make sure the StringConcatFactory bsm does not use MethodTypes that refer to excluded classes - Added test case for using --module-path with -XX:+AOTClassLinking - @rose00 comment -- print size of MH intrinsics table - @stefank comment: include aotLinkedClassBulkLoader.hpp in iterator.inline.hpp - Merge branch 'master' into jep-483-candidate - Merge branch 'jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke' into jep-483-step-07-8293336-store-lambda-forms-in-cds-archive - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap - @calvinccheung review comments - ... and 147 more: https://git.openjdk.org/jdk/compare/893266c4...3860dcf5 ------------- Changes: https://git.openjdk.org/jdk/pull/21642/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=01 Stats: 6929 lines in 102 files changed: 6051 ins; 560 del; 318 mod Patch: https://git.openjdk.org/jdk/pull/21642.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21642/head:pull/21642 PR: https://git.openjdk.org/jdk/pull/21642 From honkar at openjdk.org Tue Oct 22 20:52:28 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 22 Oct 2024 20:52:28 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 @prsadhuk Addressed review comments in the following jep486 branch commit: https://github.com/openjdk/jdk-sandbox/commit/d9ee496f7349cb8beaf1e696fd430f8064baee8e 1. test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java - Updated, removed redundant try-catch block 2. test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java - Repurposed and added back 3. test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java - Updated, added finally block 4. test/jdk/javax/swing/UIDefaults/6795356/TableTest.java - Added back ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2430237067 From honkar at openjdk.org Tue Oct 22 20:58:31 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 22 Oct 2024 20:58:31 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 08:16:38 GMT, Prasanta Sadhukhan wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java line 49: > >> 47: SwingUtilities.invokeAndWait(TestJEditor::testJEditorPane); >> 48: } >> 49: > > Is there any need to catch the exception and rethrow RuntimeException below? I think we can remove try-catch block altogether... Updated > test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java line 48: > >> 46: test.setupUI(); >> 47: test.testApplication(); >> 48: test.testApplet(); > > I guess we can only remove this `testApplet` as SM is invoked there only....we can still test `testApplication`, right? Updated. Repurposed the test. > test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java line 117: > >> 115: } >> 116: popup.setVisible(false); >> 117: frame.dispose(); > > The error condition is checked and exception thrown before disposing the frame and popup, guess this 2 should be in finally block.. Updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811381885 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811382077 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811382336 From honkar at openjdk.org Tue Oct 22 21:04:30 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 22 Oct 2024 21:04:30 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <20itE1cB8nTYacBoa8CGuHwGj8h0BX7A2eKTQmjFFdM=.07cfb10b-ce49-4951-8474-5f1a641edec5@github.com> On Tue, 22 Oct 2024 09:29:38 GMT, Prasanta Sadhukhan wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/javax/swing/UIDefaults/6795356/TableTest.java line 45: > >> 43: JTable table = new JTable(); >> 44: TableCellEditor de = table.getDefaultEditor(Double.class); >> 45: if (de == null) { > > I guess we can test this without SM since it tests SwingLazyValue? I believe I had removed this test because it wasn't testing anything significant. But I have re-added it please re-review and let me know if it holds value to be retained. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811400040 From mchung at openjdk.org Tue Oct 22 21:39:31 2024 From: mchung at openjdk.org (Mandy Chung) Date: Tue, 22 Oct 2024 21:39:31 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Reviewed test/jdk/java/lang/** and test/jdk/sun/reflect/* tests. test/jdk/java/lang/Class/getDeclaredField/ClassDeclaredFieldsTest.java line 31: > 29: * @summary test that all fields returned by getDeclaredFields() can be > 30: * set accessible if the right permission is granted; this test > 31: * also verifies that Class.classLoader final private field is "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java line 338: > 336: > 337: public static enum TestCase { > 338: UNSECURE; Better to drop this enum entirely. Simply call `FieldSetAccessibleTest::run` as it's the only test case. test/jdk/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java line 45: > 43: > 44: public static void main(String... args) throws Throwable { > 45: System.err.println("Test without security manager."); Security manager is not relevant any more. Suggest to drop this println. test/jdk/java/lang/invoke/RevealDirectTest.java line 33: > 31: * @test > 32: * @summary verify Lookup.revealDirect on a variety of input handles, with security manager > 33: * @run main/othervm/policy=jtreg.security.policy/secure=java.lang.SecurityManager -ea -esa test.java.lang.invoke.RevealDirectTest line 36 can also be removed. * $ $JAVA8X_HOME/bin/java -cp $JUNIT4_JAR:../../../.. -ea -esa -Djava.security.manager test.java.lang.invoke.RevealDirectTest test/jdk/java/lang/invoke/callerSensitive/csm/jdk/test/MethodInvokeTest.java line 77: > 75: @Override > 76: public boolean implies(ProtectionDomain domain, Permission p) { > 77: return perms.implies(p) || DEFAULT_POLICY.implies(domain, p); static variable `DEFAULT_POLICY` (line 48) can be removed. test/jdk/java/lang/reflect/Proxy/nonPublicProxy/NonPublicProxyClass.java line 83: > 81: } > 82: > 83: private static final String NEW_PROXY_IN_PKG = "newProxyInPackage."; This constant is no longer needed. ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2383401067 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1809627796 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1809631220 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811445313 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811458290 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811462419 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1809602637 From cjplummer at openjdk.org Tue Oct 22 21:54:16 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 22 Oct 2024 21:54:16 GMT Subject: RFR: 8342673: Test serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java failed: waited too long for notify Message-ID: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> Fix deadlock with suspending the main thread while it is in Thread.join() to join the thread that is suspending it. The suspending thread then waits for a FRAME_POP event on the main thread, but that never happens because it is suspended. Testing in progress. Running the test 100 times on all supported platforms, including separate run with `-Xcomp`. ------------- Commit messages: - Fix deadlock during join() Changes: https://git.openjdk.org/jdk/pull/21650/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21650&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342673 Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21650.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21650/head:pull/21650 PR: https://git.openjdk.org/jdk/pull/21650 From amenkov at openjdk.org Tue Oct 22 22:19:04 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Tue, 22 Oct 2024 22:19:04 GMT Subject: RFR: 8342673: Test serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java failed: waited too long for notify In-Reply-To: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> References: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> Message-ID: On Tue, 22 Oct 2024 21:49:59 GMT, Chris Plummer wrote: > Fix deadlock with suspending the main thread while it is in Thread.join() to join the thread that is suspending it. The suspending thread then waits for a FRAME_POP event on the main thread, but that never happens because it is suspended. > > Testing in progress. Running the test 100 times on all supported platforms, including separate run with `-Xcomp`. Marked as reviewed by amenkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21650#pullrequestreview-2386495745 From liach at openjdk.org Tue Oct 22 23:37:10 2024 From: liach at openjdk.org (Chen Liang) Date: Tue, 22 Oct 2024 23:37:10 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v2] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 20:35:38 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). >> >> ---- >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https://github.com/openjdk/jdk/pull/20517 >> - https://github.com/openjdk/jdk/pull/20843 >> - https://github.com/openjdk/jdk/pull/20958 >> - https://github.com/openjdk/jdk/pull/20959 >> - https://github.com/openjdk/jdk/pull/21049 >> - https://github.com/openjdk/jdk/pull/21143 > > Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 157 commits: > > - @rose00 offline comments -- make sure the StringConcatFactory bsm does not use MethodTypes that refer to excluded classes > - Added test case for using --module-path with -XX:+AOTClassLinking > - @rose00 comment -- print size of MH intrinsics table > - @stefank comment: include aotLinkedClassBulkLoader.hpp in iterator.inline.hpp > - Merge branch 'master' into jep-483-candidate > - Merge branch 'jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke' into jep-483-step-07-8293336-store-lambda-forms-in-cds-archive > - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke > - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics > - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap > - @calvinccheung review comments > - ... and 147 more: https://git.openjdk.org/jdk/compare/893266c4...3860dcf5 The java file changes look good. ------------- PR Review: https://git.openjdk.org/jdk/pull/21642#pullrequestreview-2386587967 From lmesnik at openjdk.org Tue Oct 22 23:53:04 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Tue, 22 Oct 2024 23:53:04 GMT Subject: RFR: 8342673: Test serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java failed: waited too long for notify In-Reply-To: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> References: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> Message-ID: On Tue, 22 Oct 2024 21:49:59 GMT, Chris Plummer wrote: > Fix deadlock with suspending the main thread while it is in Thread.join() to join the thread that is suspending it. The suspending thread then waits for a FRAME_POP event on the main thread, but that never happens because it is suspended. > > Testing in progress. Running the test 100 times on all supported platforms, including separate run with `-Xcomp`. Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21650#pullrequestreview-2386602336 From coleenp at openjdk.org Wed Oct 23 00:02:08 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 00:02:08 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v4] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 19:01:02 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Make lea with RIP-relative addressing more general > Then I looked at typing up the thread / lock ids as an enum class https://github.com/openjdk/jdk/commit/34221f4a50a492cad4785cfcbb4bef8fa51d6f23 Both of these suggested changes should be discussed as different RFEs. I don't really like this ThreadID change because it seems to introduce casting everywhere. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2430528701 From sspitsyn at openjdk.org Wed Oct 23 00:18:03 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 23 Oct 2024 00:18:03 GMT Subject: RFR: 8342673: Test serviceability/jvmti/events/NotifyFramePopStressTest/NotifyFramePopStressTest.java failed: waited too long for notify In-Reply-To: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> References: <4Cu4vnXTPHf9WmWmXdgjVoYe2r_92aHAuVBLcl9iqq8=.8bb0aff9-ac1a-482d-bc07-2e33cc180a34@github.com> Message-ID: <6eRm7O7OeKu3zAnc236fkCL8R9Xm8qkRV9cCTQLVytQ=.1365f7a4-8ee5-484a-99f4-abef7c87dca3@github.com> On Tue, 22 Oct 2024 21:49:59 GMT, Chris Plummer wrote: > Fix deadlock with suspending the main thread while it is in Thread.join() to join the thread that is suspending it. The suspending thread then waits for a FRAME_POP event on the main thread, but that never happens because it is suspended. > > Testing in progress. Running the test 100 times on all supported platforms, including separate run with `-Xcomp`. It is good. Thank you for fixing it! ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21650#pullrequestreview-2386620786 From pchilanomate at openjdk.org Wed Oct 23 00:35:06 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 00:35:06 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: Message-ID: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: Address David's comments to ObjectMonitor.hpp ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/81e5c6d0..b6bc98e2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=03-04 Stats: 147 lines in 11 files changed: 10 ins; 7 del; 130 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Wed Oct 23 00:35:08 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 00:35:08 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 06:27:26 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/share/runtime/objectMonitor.hpp line 47: > >> 45: // ParkEvent instead. Beware, however, that the JVMTI code >> 46: // knows about ObjectWaiters, so we'll have to reconcile that code. >> 47: // See next_waiter(), first_waiter(), etc. > > This to-do is likely no longer relevant with the current changes. Removed. > src/hotspot/share/runtime/objectMonitor.hpp line 288: > >> 286: // Returns true if this OM has an owner, false otherwise. >> 287: bool has_owner() const; >> 288: int64_t owner() const; // Returns null if DEFLATER_MARKER is observed. > > null is not an int64_t value. Changed to NO_OWNER. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811596618 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811596855 From pchilanomate at openjdk.org Wed Oct 23 00:41:10 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 00:41:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 06:31:47 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/share/runtime/objectMonitor.hpp line 292: > >> 290: >> 291: static int64_t owner_for(JavaThread* thread); >> 292: static int64_t owner_for_oop(oop vthread); > > Some comments describing this API would be good. I'm struggling a bit with the "owner for" terminology. I think `owner_from` would be better. And can't these just overload rather than using different names? I changed them to `owner_from`. I added a comment referring to the return value as tid, and then I used this tid name in some other comments. Maybe this methods should be called `tid_from()`? Alternatively we could use the term owner id instead, and these would be `owner_id_from()`. In theory, this tid term or owner id (or whatever other name) does not need to be related to `j.l.Thread.tid`, it just happens that that's what we are using as the actual value for this id. > src/hotspot/share/runtime/objectMonitor.hpp line 302: > >> 300: // Simply set _owner field to new_value; current value must match old_value. >> 301: void set_owner_from_raw(int64_t old_value, int64_t new_value); >> 302: void set_owner_from(int64_t old_value, JavaThread* current); > > Again some comments describing API would good. The old API had vague names like old_value and new_value because of the different forms the owner value could take. Now it is always a thread-id we can do better I think. The distinction between the raw and non-raw forms is unclear and the latter is not covered by the initial comment. I added a comment. How about s/old_value/old_tid and s/new_value/new_tid? > src/hotspot/share/runtime/objectMonitor.hpp line 303: > >> 301: void set_owner_from_raw(int64_t old_value, int64_t new_value); >> 302: void set_owner_from(int64_t old_value, JavaThread* current); >> 303: // Simply set _owner field to current; current value must match basic_lock_p. > > Comment is no longer accurate Fixed. > src/hotspot/share/runtime/objectMonitor.hpp line 309: > >> 307: // _owner field. Returns the prior value of the _owner field. >> 308: int64_t try_set_owner_from_raw(int64_t old_value, int64_t new_value); >> 309: int64_t try_set_owner_from(int64_t old_value, JavaThread* current); > > Similar to set_owner* need better comments describing API. Added similar comment. > src/hotspot/share/runtime/objectMonitor.hpp line 311: > >> 309: int64_t try_set_owner_from(int64_t old_value, JavaThread* current); >> 310: >> 311: bool is_succesor(JavaThread* thread); > > I think `has_successor` is more appropriate here as it is not the monitor that is the successor. Right, changed. > src/hotspot/share/runtime/objectMonitor.hpp line 315: > >> 313: void set_succesor(oop vthread); >> 314: void clear_succesor(); >> 315: bool has_succesor(); > > Sorry but `successor` has two `s` before `or`. Fixed. > src/hotspot/share/runtime/objectMonitor.hpp line 317: > >> 315: bool has_succesor(); >> 316: >> 317: bool is_owner(JavaThread* thread) const { return owner() == owner_for(thread); } > > Again `has_owner` seems more appropriate Yes, changed. > src/hotspot/share/runtime/objectMonitor.hpp line 323: > >> 321: } >> 322: >> 323: bool is_owner_anonymous() const { return owner_raw() == ANONYMOUS_OWNER; } > > Again I struggle with the pre-existing `is_owner` formulation here. The target of the expression is a monitor and we are asking if the monitor has an anonymous owner. I changed it to `has_owner_anonymous`. > src/hotspot/share/runtime/objectMonitor.hpp line 333: > >> 331: bool is_stack_locker(JavaThread* current); >> 332: BasicLock* stack_locker() const; >> 333: void set_stack_locker(BasicLock* locker); > > Again `is` versus `has`, plus some general comments describing the API. Fixed and added comments. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811600012 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811600739 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601098 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601168 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601545 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601472 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601619 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811601871 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811602000 From rsunderbabu at openjdk.org Wed Oct 23 00:44:07 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 23 Oct 2024 00:44:07 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 17:25:29 GMT, Coleen Phillimore wrote: >> Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. >> >> Testing done for >> Tiers 1,2,3 >> test/hotspot/jtreg tests > > I've occasionally run into this duplication and am happy you're fixing it. Thanks @coleenp and @lmesnik for the review. Only in vmTestbase/metaspace/stressHierarchy/common/generateHierarchy/GenerateHierarchyHelper.java, the batch compile is used. Even there, we could replace it with iteration of single compiles. I will remove all the instances of batch compile and keep the InMemoryJavaCompiler clean and simple. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21641#issuecomment-2430570943 From coleenp at openjdk.org Wed Oct 23 01:22:08 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 01:22:08 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v4] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 19:01:02 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Make lea with RIP-relative addressing more general I've done a first pass over the first commit and have some comments and questions. ------------- PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2386614214 From coleenp at openjdk.org Wed Oct 23 01:22:09 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 01:22:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 02:09:33 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 380: >> >>> 378: lea(t2_owner_addr, owner_address); >>> 379: >>> 380: // CAS owner (null => current thread id). >> >> I think we should be more careful when and where we talk about thread id and lock id respectively. Given that `switchToCarrierThread` switches the thread, but not the lock id. We should probably define and talk about the lock id when it comes to locking, as saying thread id may be incorrect. >> >> Then there is also the different thread ids, the OS level one, and the java level one. (But not sure how to reconcile this without causing confusion) > > Fixed the comments to refer to _lock_id. Even without the switchToCarrierThread case I think that's the correct thing to do. yes, we preferred lock_id here which is the same as the Java version of thread id, but not the same as the os thread-id. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811583503 From coleenp at openjdk.org Wed Oct 23 01:22:10 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 01:22:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:49:32 GMT, Andrew Haley wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5341: > >> 5339: >> 5340: void MacroAssembler::inc_held_monitor_count() { >> 5341: Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); > > Suggestion: > > // Clobbers: rscratch1 and rscratch2 > void MacroAssembler::inc_held_monitor_count() { > Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); Also, is it better to have this without assignment. Which is a nit. Address dst(rthread, JavaThread::held_monitor_count_offset()); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811584584 From coleenp at openjdk.org Wed Oct 23 01:22:14 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 01:22:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 00:35:06 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Address David's comments to ObjectMonitor.hpp src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5354: > 5352: str(rscratch2, dst); > 5353: Label ok; > 5354: tbz(rscratch2, 63, ok); 63? Does this really need to have underflow checking? That would alleviate the register use concerns if it didn't. And it's only for legacy locking which should be stable until it's removed. src/hotspot/cpu/ppc/macroAssembler_ppc.cpp line 2629: > 2627: addi(temp, displaced_header, in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value); > 2628: Register thread_id = displaced_header; > 2629: ld(thread_id, in_bytes(JavaThread::lock_id_offset()), R16_thread); Maybe to make things really clear, you could call this thread_lock_id ? src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 231: > 229: > 230: void MacroAssembler::inc_held_monitor_count(Register tmp) { > 231: Address dst = Address(xthread, JavaThread::held_monitor_count_offset()); Address dst(xthread, JavaThread::held_monitor_count_offset()); src/hotspot/share/runtime/javaThread.cpp line 2002: > 2000: #ifdef SUPPORT_MONITOR_COUNT > 2001: > 2002: #ifdef LOOM_MONITOR_SUPPORT If LOOM_MONITOR_SUPPORT is not true, this would skip this block and assert for LIGHTWEIGHT locking. Do we need this #ifdef ? src/hotspot/share/runtime/objectMonitor.cpp line 416: > 414: set_owner_from_BasicLock(cur, current); // Convert from BasicLock* to Thread*. > 415: return true; > 416: } Not needed? Oh I see, BasicLock is now in stack_locker. src/hotspot/share/runtime/objectMonitor.cpp line 1014: > 1012: assert_mark_word_consistency(); > 1013: UnlinkAfterAcquire(current, currentNode); > 1014: if (is_succesor(current)) clear_succesor(); successor has two 's'. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811590155 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811591482 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811595282 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811611376 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811613400 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811614453 From coleenp at openjdk.org Wed Oct 23 01:22:15 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 01:22:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 00:37:25 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/objectMonitor.hpp line 315: >> >>> 313: void set_succesor(oop vthread); >>> 314: void clear_succesor(); >>> 315: bool has_succesor(); >> >> Sorry but `successor` has two `s` before `or`. > > Fixed. Yes, need to fix successor spelling. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811616558 From psadhukhan at openjdk.org Wed Oct 23 03:10:29 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 23 Oct 2024 03:10:29 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> Message-ID: <6ApqXmPZcKXKJ8E4Wd2wvLT-2CNcpN_XglBX983HrQA=.11574ea5-7949-4355-8f9f-4cd5f2101ed4@github.com> On Tue, 22 Oct 2024 16:44:59 GMT, Phil Race wrote: >> This should be addressed in a more general separate task, and not part of this PR since it does not have anything to do with the changes in this JEP. > > Agreed. This is not a "clean up / update tests" task. > If it is a change on some lines of code that are updated by the SM changes, then that's fair game, but otherwise only the SM behaviour is part of this task. > Anything that is not needed to be changed for that purpose, can (and mostly should) be left alone. I know this is not relevant to SM and would not have pointed it out had it not been modified in the PR.. In some tests as I am going to point out below, the order is changed intentionally even though it does not have anything to do with SM, all I am asking it to restore it back in those tests (and since it will look odd to have different order in different tests, I generalize it all for all javax_swing tests in this PR which is what I reviewed) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811704257 From psadhukhan at openjdk.org Wed Oct 23 03:10:32 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 23 Oct 2024 03:10:32 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java line 36: > 34: import javax.swing.SwingUtilities; > 35: > 36: /* this here the order is changed... test/jdk/javax/swing/UIDefaults/6622002/bug6622002.java line 24: > 22: */ > 23: > 24: /** again here the import and tag order is changed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811705627 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811706135 From psadhukhan at openjdk.org Wed Oct 23 03:19:28 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 23 Oct 2024 03:19:28 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> Message-ID: On Tue, 22 Oct 2024 16:46:53 GMT, Phil Race wrote: >> Not specific to JEP 486, this should be done as part of a different issue. > > agreed there were many tests modified in javax_swing in this PR where the author tag is removed, only this is missed so I pointed it out... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811724308 From iklam at openjdk.org Wed Oct 23 04:46:51 2024 From: iklam at openjdk.org (Ioi Lam) Date: Wed, 23 Oct 2024 04:46:51 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v3] In-Reply-To: References: Message-ID: > This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). > > ---- > Note: this is a combined PR of the following individual PRs > - https://github.com/openjdk/jdk/pull/20516 > - https://github.com/openjdk/jdk/pull/20517 > - https://github.com/openjdk/jdk/pull/20843 > - https://github.com/openjdk/jdk/pull/20958 > - https://github.com/openjdk/jdk/pull/20959 > - https://github.com/openjdk/jdk/pull/21049 > - https://github.com/openjdk/jdk/pull/21143 Ioi Lam has updated the pull request incrementally with three additional commits since the last revision: - fixed test failure with "jtreg -Dtest.dynamic.cds.archive=true ..." - simplified the archiving of cpCache::resolved_references() -- we rely on AOTConstantPoolResolver::is_indy_resolution_deterministic() to do the filtering before indys are linked; there is no need to try to undo the resolved_references afterwards - Fixed bug where the BSM oops for resolved indies are not archived ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21642/files - new: https://git.openjdk.org/jdk/pull/21642/files/3860dcf5..1b6c3e28 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=01-02 Stats: 78 lines in 5 files changed: 28 ins; 39 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/21642.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21642/head:pull/21642 PR: https://git.openjdk.org/jdk/pull/21642 From psadhukhan at openjdk.org Wed Oct 23 05:14:36 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 23 Oct 2024 05:14:36 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > @prsadhuk Addressed review comments in the following jep486 branch commit: [openjdk/jdk-sandbox at d9ee496](https://github.com/openjdk/jdk-sandbox/commit/d9ee496f7349cb8beaf1e696fd430f8064baee8e) > > 1. test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java - Updated, removed redundant try-catch block > > 2. test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java - Repurposed and added back > > 3. test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java - Updated, added finally block > > 4. test/jdk/javax/swing/UIDefaults/6795356/TableTest.java - Added back > > > Left out comments that fall into out-of-scope/clean-up for jep486. looks ok but awt import should have been before swing as decided, although this again is not part of SM exercise but since you modified the tests I thought I will say it aloud.. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2430919687 From dholmes at openjdk.org Wed Oct 23 05:21:10 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 23 Oct 2024 05:21:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: On Tue, 22 Oct 2024 12:31:24 GMT, Alan Bateman wrote: >> Okay but .... >> 1. We have the current virtual thread >> 2. We have the current carrier for that virtual thread (which is iotself a java.alng.Thread object >> 3. We have Thread.setCurrentLockId which ... ? which thread does it update? And what does "current" refer to in the name? > > Thread identity switches to the carrier so Thread.currentThread() is the carrier thread and JavaThread._lock_id is the thread identifier of the carrier. setCurrentLockId changes JavaThread._lock_id back to the virtual thread's identifier. If the virtual thread is un-mounting from the carrier, why do we need to set the "lock id" back to the virtual thread's id? Sorry I'm finding this quite confusing. Also `JavaThread::_lock_id` in the VM means "the java.lang.Thread thread-id to use for locking" - correct? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811877637 From jwaters at openjdk.org Wed Oct 23 05:26:05 2024 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 23 Oct 2024 05:26:05 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 18:03:12 GMT, Chris Plummer wrote: >> After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did > > src/jdk.jdi/windows/native/libdt_shmem/shmem_md.c line 47: > >> 45: { >> 46: void *mappedMemory; >> 47: // HANDLE memHandle; > > Why comment out this one but not the one at line 88? It seems they are both equally problematic and are hiding the static memHandle. I'm not sure why the 2nd one isn't flagged. I'd actually suggest getting rid of the static memHandle. It does not seem to be needed. I wasn't sure whether the global memHandle not being used was a bug, so I commented out the local one. I missed the line 88 one because it wasn't flagged. If it really isn't needed I'll remove that one instead > src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c line 53: > >> 51: #ifndef _WIN32 >> 52: static MUTEX_T my_mutex = MUTEX_INIT; >> 53: #endif > > The reason for no reference on windows is because of the following on windows: > > > #define MUTEX_LOCK(x) /* FIXUP? */ > #define MUTEX_UNLOCK(x) /* FIXUP? */ > > > So looks like this mutex support is something we never got around to. I think your current workaround is fine. I'm curious now, how to implement mutex support on Windows? I think I prefer that to just making it completely unavailable on Windows ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1811884490 PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1811885815 From aboldtch at openjdk.org Wed Oct 23 05:38:11 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 23 Oct 2024 05:38:11 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 19:04:16 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2234: >> >>> 2232: retry_fast_path = true; >>> 2233: } else { >>> 2234: relativize_chunk_concurrently(chunk); >> >> Is the `relativize_chunk_concurrently` solution to the race only to have a single flag read in `can_thaw_fast` or is there some other subtlety here? >> >> While not required for the PR, if it is just to optimise the `can_thaw_fast` check, it can probably be made to work with one load and still allow concurrent gcs do fast_thaw when we only get here due to a lockstack. > > Yes, it's just to do a single read. I guess you are thinking of combining flags and lockStackSize into a int16_t? Something along those lines, yes. >> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2247: >> >>> 2245: _thread->lock_stack().move_from_address(tmp_lockstack, lockStackSize); >>> 2246: >>> 2247: chunk->set_lockstack_size(0); >> >> After some discussion here at the office we think there might be an issue here with simply hiding the oops without clearing them. Below in `recurse_thaw` we `do_barriers`. But it does not touch these lockstack. Missing the SATB store barrier is probably fine from a liveness perspective, because the oops in the lockstack must also be in the frames. But removing the oops without a barrier and clear will probably lead to problems down the line. >> >> Something like the following would probably handle this. Or even fuse the `copy_lockstack` and `clear_lockstack` together into some kind of `transfer_lockstack` which both loads and clears the oops. >> >> >> diff --git a/src/hotspot/share/oops/stackChunkOop.cpp b/src/hotspot/share/oops/stackChunkOop.cpp >> index d3d63533eed..f737bd2db71 100644 >> --- a/src/hotspot/share/oops/stackChunkOop.cpp >> +++ b/src/hotspot/share/oops/stackChunkOop.cpp >> @@ -470,6 +470,28 @@ void stackChunkOopDesc::copy_lockstack(oop* dst) { >> } >> } >> >> +void stackChunkOopDesc::clear_lockstack() { >> + const int cnt = lockstack_size(); >> + const bool requires_gc_barriers = is_gc_mode() || requires_barriers(); >> + const bool requires_uncompress = has_bitmap() && UseCompressedOops; >> + const auto clear_obj = [&](intptr_t* at) { >> + if (requires_uncompress) { >> + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); >> + } else { >> + HeapAccess<>::oop_store(reinterpret_cast(at), nullptr); >> + } >> + }; >> + >> + if (requires_gc_barriers) { >> + intptr_t* lockstack_start = start_address(); >> + for (int i = 0; i < cnt; i++) { >> + clear_obj(&lockstack_start[i]); >> + } >> + } >> + set_lockstack_size(0); >> + set_has_lockstack(false); >> +} >> + >> void stackChunkOopDesc::print_on(bool verbose, outputStream* st) const { >> if (*((juint*)this) == badHeapWordVal) { >> st->print_cr("BAD WORD"); >> diff --git a/src/hotspot/share/oops/stackChunkOop.hpp b/src/hotspot/share/oops/stackChunkOop.hpp >> index 28e0576801e..928e94dd695 100644 >> --- a/src/hotspot/share/oops/stackChunkOop.hpp >> +++ b/src/hotspot/share/oops/stackChunkOop.hpp >> @@ -167,6 +167,7 @@ class stackChunkOopDesc : public instanceOopDesc { >> void fix_thawed_frame(const frame& f, const RegisterMapT* map); >> >> void copy_lo... > > Ok, I'll change copy_lockstack to both load and clear the oops in the same method. Now, when we call do_barriers on recurse_thaw we don't clear the oops, we just load and store the loaded value again. Is it the case that we just need to do a store, so that already works, or are we missing clearing the oops from the copied frames? The store is the important part for SATB. The fact that do_barriers (only) does a self store seems is an optimisation. As we need to do the store before we do the copy (to enable a plane memcpy). And clearing is not something that we rely on / need at the moment. The nicest model would have been to first fix the oops, (mem)copy, then clear them. But as mentioned, clearing is currently unnecessary. For the lockstack we do not need this optimisation as we do the copy when we do the load barrier. So we can just clear in our store. It is a little interesting that we template parameterise `do_barriers` on the barrier type and instantiate all the load functions, while only ever using the store version. Guess it is a remnant from some earlier model. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811903902 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811900946 From dholmes at openjdk.org Wed Oct 23 05:52:11 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 23 Oct 2024 05:52:11 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 00:35:06 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Address David's comments to ObjectMonitor.hpp Thanks for those updates. src/hotspot/share/runtime/objectMonitor.hpp line 299: > 297: // Simply set _owner field to new_value; current value must match old_value. > 298: void set_owner_from_raw(int64_t old_value, int64_t new_value); > 299: // Same as above but uses tid of current as new value. By `tid` here (and elsewhere) you actually mean `thread->threadObj()->thread_id()` - right? src/hotspot/share/runtime/objectMonitor.hpp line 302: > 300: void set_owner_from(int64_t old_value, JavaThread* current); > 301: // Set _owner field to tid of current thread; current value must be ANONYMOUS_OWNER. > 302: void set_owner_from_BasicLock(JavaThread* current); Shouldn't tid there be the basicLock? src/hotspot/share/runtime/objectMonitor.hpp line 334: > 332: > 333: // Returns true if BasicLock* stored in _stack_locker > 334: // points to current's stack, false othwerwise. Suggestion: // points to current's stack, false otherwise. ------------- PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2387241944 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811912133 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811913172 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811914377 From aboldtch at openjdk.org Wed Oct 23 05:59:09 2024 From: aboldtch at openjdk.org (Axel Boldt-Christmas) Date: Wed, 23 Oct 2024 05:59:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 00:08:54 GMT, Coleen Phillimore wrote: >> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5341: >> >>> 5339: >>> 5340: void MacroAssembler::inc_held_monitor_count() { >>> 5341: Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); >> >> Suggestion: >> >> // Clobbers: rscratch1 and rscratch2 >> void MacroAssembler::inc_held_monitor_count() { >> Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); > > Also, is it better to have this without assignment. Which is a nit. > Address dst(rthread, JavaThread::held_monitor_count_offset()); The `=` in a variable definition is always construction, never assignment. That said, I also prefer `Address dst(rthread, JavaThread::held_monitor_count_offset());` Less redundant information. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811925424 From dholmes at openjdk.org Wed Oct 23 06:10:14 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 23 Oct 2024 06:10:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <7tG1N819A95VfA37K3PK5PejcHkaBPHzWdO6wGA06w0=.10223953-863f-4ca6-ae1b-085112085c3d@github.com> On Wed, 23 Oct 2024 00:35:19 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/objectMonitor.hpp line 292: >> >>> 290: >>> 291: static int64_t owner_for(JavaThread* thread); >>> 292: static int64_t owner_for_oop(oop vthread); >> >> Some comments describing this API would be good. I'm struggling a bit with the "owner for" terminology. I think `owner_from` would be better. And can't these just overload rather than using different names? > > I changed them to `owner_from`. I added a comment referring to the return value as tid, and then I used this tid name in some other comments. Maybe this methods should be called `tid_from()`? Alternatively we could use the term owner id instead, and these would be `owner_id_from()`. In theory, this tid term or owner id (or whatever other name) does not need to be related to `j.l.Thread.tid`, it just happens that that's what we are using as the actual value for this id. I like the idea of using `owner_id_from` but it then suggests to me that `JavaThread::_lock_id` should be something like `JavaThread::_monitor_owner_id`. The use of `tid` in comments can be confusing when applied to a `JavaThread` as the "tid" there would normally be a reference of its `osThread()->thread_id()" not it's `threadObj()->thread_id()`. I don't have an obviously better suggestion though. >> src/hotspot/share/runtime/objectMonitor.hpp line 302: >> >>> 300: // Simply set _owner field to new_value; current value must match old_value. >>> 301: void set_owner_from_raw(int64_t old_value, int64_t new_value); >>> 302: void set_owner_from(int64_t old_value, JavaThread* current); >> >> Again some comments describing API would good. The old API had vague names like old_value and new_value because of the different forms the owner value could take. Now it is always a thread-id we can do better I think. The distinction between the raw and non-raw forms is unclear and the latter is not covered by the initial comment. > > I added a comment. How about s/old_value/old_tid and s/new_value/new_tid? old_tid/new_tid works for me. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811933408 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811935087 From dholmes at openjdk.org Wed Oct 23 06:14:12 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 23 Oct 2024 06:14:12 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <7BYPwAm8OvYFldeIFsYf5m9MbocP5Wue35H-Ix_erw0=.179301e3-42e6-4975-ad8f-9474eb73247a@github.com> On Tue, 22 Oct 2024 11:52:46 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 115: >> >>> 113: * RUNNING -> WAITING // transitional state during wait on monitor >>> 114: * WAITING -> WAITED // waiting on monitor >>> 115: * WAITED -> BLOCKED // notified, waiting to be unblocked by monitor owner >> >> Waiting to re-enter the monitor? > > yes Okay so should it say that? >> src/java.base/share/classes/java/lang/VirtualThread.java line 178: >> >>> 176: // timed-wait support >>> 177: private long waitTimeout; >>> 178: private byte timedWaitNonce; >> >> Strange name - what does this mean? > > Sequence number, nouce, anything will work here as it's just to deal with the scenario where the timeout task for a previous wait may run concurrently with a subsequent wait. Suggestion: `timedWaitCounter` ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811937674 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1811938604 From dholmes at openjdk.org Wed Oct 23 06:18:17 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 23 Oct 2024 06:18:17 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: <_gXXCttW-h4AfQUaeBanzH40dfndZS9GIBzqHQ6ob-8=.0ea3c533-9cdc-4fc4-aa7d-0debff0a97a5@github.com> On Wed, 23 Oct 2024 00:35:06 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Address David's comments to ObjectMonitor.hpp > The tid is cached in the JavaThread object under _lock_id. It is set on JavaThread creation and changed on mount/unmount. Why do we need to cache it? Is it the implicit barriers related to accessing the `threadObj` oop each time? Keeping this value up-to-date is a part I find quite confusing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2431004707 From syan at openjdk.org Wed Oct 23 06:52:10 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 23 Oct 2024 06:52:10 GMT Subject: RFR: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY [v2] In-Reply-To: References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Mon, 21 Oct 2024 13:12:55 GMT, SendaoYan wrote: >> Hi all, >> In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. >> >> So the below test command will print error: >> >> make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" >> >> >> Building target 'test' in configuration 'linux-x86_64-server-release' >> JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. >> Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. >> RunTests.gmk:206: *** Cannot continue. Stop. >> >> >> So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. > > SendaoYan has updated the pull request incrementally with two additional commits since the last revision: > > - JTREG="TEST_THREAD_FACTORY=Virtual" > - Use JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" to make comment more cleaner Thanks all for the review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21594#issuecomment-2431064891 From syan at openjdk.org Wed Oct 23 06:52:11 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 23 Oct 2024 06:52:11 GMT Subject: Integrated: 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY In-Reply-To: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> References: <1oDFeWVzfHyuEjjHh0zG1KB4spHUKxKTmDAVnW5mUc0=.d0ee985a-2493-46c0-a3f9-d7f9b2d0e6c7@github.com> Message-ID: On Sun, 20 Oct 2024 02:11:11 GMT, SendaoYan wrote: > Hi all, > In [make/RunTests.gmk](https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L208), the keyword is 'TEST_THREAD_FACTORY'. > > So the below test command will print error: > > make test TEST=test/jdk/java/math/BigInteger/TestValueExact.java CONF=linux-x86_64-server-release JTREG="JTREG_TEST_THREAD_FACTORY=Virtual" > > > Building target 'test' in configuration 'linux-x86_64-server-release' > JTREG_TEST_THREAD_FACTORY=Virtual is not a valid keyword for JTREG. > Valid keywords: JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS. > RunTests.gmk:206: *** Cannot continue. Stop. > > > So I think we should fix the document bug in `doc/testing.md` to avoid take the same mistake. Trivial fix, no risk. This pull request has now been integrated. Changeset: cdad7286 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/cdad7286c6a099f5d0aa1f936e6201df9f3004cb Stats: 5 lines in 4 files changed: 0 ins; 0 del; 5 mod 8342646: JTREG_TEST_THREAD_FACTORY in testing.md should be TEST_THREAD_FACTORY Reviewed-by: ihse, erikj ------------- PR: https://git.openjdk.org/jdk/pull/21594 From alanb at openjdk.org Wed Oct 23 07:27:15 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 07:27:15 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v8] In-Reply-To: <15ZEmA1D4X71LAEk66t2yPYmkdYvOI5W1ySny1-k9TI=.14eb1bd0-d75a-4a93-899c-a563a53bb058@github.com> References: <15ZEmA1D4X71LAEk66t2yPYmkdYvOI5W1ySny1-k9TI=.14eb1bd0-d75a-4a93-899c-a563a53bb058@github.com> Message-ID: On Tue, 22 Oct 2024 19:16:21 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - Merge > - review: explain better what methods can be annotated with JvmtiMountTransition > - review: clarify the use of annotation @JvmtiMountTransition in yield/yield0 > - review: moved notifyJvmtiStart/notifyJvmtiEnd calls from VirtualThread.run to the caller > - review: tweaked disabler for carrier threads; more hiddenjvmti_mount_transition frames > - Disallow NotifyFramePop for enter/enter0/VirtualThread.run/VThreadContinuation.run > - review: 1. Minor tweaks in new test; 2. Refactor skip_hidden_frames in two > - fix one more place with trailing spaces > - fix trailing spaces > - add new test coverage with vthread/CheckHiddenFrames > - ... and 1 more: https://git.openjdk.org/jdk/compare/d6eddcda...54dc2b4a Marked as reviewed by alanb (Reviewer). src/java.base/share/classes/jdk/internal/vm/annotation/JvmtiMountTransition.java line 32: > 30: /** > 31: * A method may be annotated as "jvmti mount transition" to hint > 32: * it is desirable to omit it from JVMTI stack traces. Might be better to replace both usages of "jvmti mount transition" with JvmtiMountTransition. "virtual thread mount state transition (VTMS transition)" should probably be "Virtual Thread Mount State (VTMS) transition". The updated wording is better but I think this still hard to audit to know if you've got the usages in the right place. Maybe we can re-visit it in the future. ------------- PR Review: https://git.openjdk.org/jdk/pull/21397#pullrequestreview-2387552132 PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1812046832 From alanb at openjdk.org Wed Oct 23 09:56:10 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 09:56:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 19:02:50 GMT, Patricio Chilano Mateo wrote: >> Just to say that we hope to eventually remove these "temporary transitions". This PR brings in a change that we've had in the loom repo to not need this when calling out to the scheduler. The only significant remaining use is timed-park. Once we address that then we will remove the need to switch the thread identity and remove some complexity, esp. for JVMTI and serviceability. >> >> In the mean-time, yes, the JavaThread.lock_id will temporarily switch to the carrier so a thread-dump/safepoint at just the right time looks like it print will be tid of the carrier rather than the mounted virtual thread. So we should fix that. (The original code in main line skipped this case so was lossy when taking a thread dump when hitting this case, David might remember the discussion on that issue). > > The problem is that within that window we don't have access to the virtual thread's tid. The current thread has already been changed and we haven't yet set the lock id back. Since this will be a rare corner case maybe we can just print tid unavailable if we hit it. We could also add a boolean to setCurrentThread to indicate we don't want to change the lock_id, but not sure it's worth it. It should be rare and once we make further progress on timers then the use of temporary transitions will mostly disappear. I think the main thing for the thread dump is not to print a confusing "Carrying virtual thread" with the tid of the carrier. This came up in [pull/19482](https://github.com/openjdk/jdk/pull/19482) when the thread was extended. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1812377091 From rrich at openjdk.org Wed Oct 23 09:56:12 2024 From: rrich at openjdk.org (Richard Reingruber) Date: Wed, 23 Oct 2024 09:56:12 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 00:35:06 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Address David's comments to ObjectMonitor.hpp src/hotspot/share/runtime/javaThread.hpp line 166: > 164: // current _vthread object, except during creation of the primordial and JNI > 165: // attached thread cases where this field can have a temporary value. > 166: int64_t _lock_id; Following the review I wanted to better understand when `_lock_id` changes. There seems to be another exception to the rule that `_lock_id` is equal to the `tid` of the current `_vthread`. I think they won't be equal when switching temporarily from the virtual to the carrier thread in `VirtualThread::switchToCarrierThread()`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1812377293 From alanb at openjdk.org Wed Oct 23 10:01:16 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 10:01:16 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 09:53:53 GMT, Richard Reingruber wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Address David's comments to ObjectMonitor.hpp > > src/hotspot/share/runtime/javaThread.hpp line 166: > >> 164: // current _vthread object, except during creation of the primordial and JNI >> 165: // attached thread cases where this field can have a temporary value. >> 166: int64_t _lock_id; > > Following the review I wanted to better understand when `_lock_id` changes. There seems to be another exception to the rule that `_lock_id` is equal to the `tid` of the current `_vthread`. I think they won't be equal when switching temporarily from the virtual to the carrier thread in `VirtualThread::switchToCarrierThread()`. Right, and we hope this temporary. We had more use of temporary transitions when the feature was initially added in JDK 19, now we mostly down to the nested parking issue. That will go away when we get to replacing the timer code, and we should be able to remove the switchXXX method and avoid the distraction/complexity that goes with them. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1812385061 From alanb at openjdk.org Wed Oct 23 10:04:11 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 10:04:11 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: <_NABF4JJUlSQ9_XfNtXtDGFIkqOPpDcUaoL6wAaJFkY=.df72d7c2-f9a1-431d-984d-2b99febcbed2@github.com> On Wed, 23 Oct 2024 00:56:34 GMT, Coleen Phillimore wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Address David's comments to ObjectMonitor.hpp > > src/hotspot/share/runtime/javaThread.cpp line 2002: > >> 2000: #ifdef SUPPORT_MONITOR_COUNT >> 2001: >> 2002: #ifdef LOOM_MONITOR_SUPPORT > > If LOOM_MONITOR_SUPPORT is not true, this would skip this block and assert for LIGHTWEIGHT locking. Do we need this #ifdef ? LOOM_MONITOR_SUPPORT was only needed when there were ports missing. All 4 are included now so this goes away. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1812389702 From alanb at openjdk.org Wed Oct 23 10:09:09 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 10:09:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:23:50 GMT, Andrew Haley wrote: > This last sentence has interesting consequences for user-defined schedulers. Would it make sense to throw an exception if a carrier thread is holding a monitor while mounting a virtual thread? Doing that would also have the advantage of making some kinds of deadlock impossible. There's nothing exposed today to allow custom schedulers. The experiments/explorations going on right now have to be careful to not hold any locks. Throwing if holding a monitor is an option but only it would need to be backed by spec and would also shine light on the issue of j.u.concurrent locks as a carrier might independently hold a lock there too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2431600434 From alanb at openjdk.org Wed Oct 23 11:35:09 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 11:35:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: <7BYPwAm8OvYFldeIFsYf5m9MbocP5Wue35H-Ix_erw0=.179301e3-42e6-4975-ad8f-9474eb73247a@github.com> References: <7BYPwAm8OvYFldeIFsYf5m9MbocP5Wue35H-Ix_erw0=.179301e3-42e6-4975-ad8f-9474eb73247a@github.com> Message-ID: On Wed, 23 Oct 2024 06:11:26 GMT, David Holmes wrote: >> Sequence number, nouce, anything will work here as it's just to deal with the scenario where the timeout task for a previous wait may run concurrently with a subsequent wait. > > Suggestion: `timedWaitCounter` ? We could rename it to timedWaitSeqNo if needed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1812537648 From stefank at openjdk.org Wed Oct 23 11:43:27 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 23 Oct 2024 11:43:27 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:19:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright > - Avoid assert/endless-loop in JFR code I've published an upstream PR for the SA bug: https://github.com/openjdk/jdk/pull/21662 ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2431837874 From stefank at openjdk.org Wed Oct 23 11:44:38 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 23 Oct 2024 11:44:38 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout Message-ID: When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] java.lang.Thread.State: TIMED_WAITING (sleeping) JavaThread state: _thread_blocked - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) Locked ownable synchronizers: - None It should be saying: Locked ownable synchronizers: - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. This is a reproducer of the problem: make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" I've tested this by running all 'serviceability' tests in our tier1-9 testing. ------------- Commit messages: - 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout Changes: https://git.openjdk.org/jdk/pull/21662/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342857 Stats: 13 lines in 3 files changed: 11 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21662/head:pull/21662 PR: https://git.openjdk.org/jdk/pull/21662 From alanb at openjdk.org Wed Oct 23 11:52:33 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 11:52:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <60NR4UYtz57FWH8yTBMSS5SPQVOGpXcoZ-9AP7o9y14=.6eb65796-4e30-4093-866d-226334d9977c@github.com> References: <60NR4UYtz57FWH8yTBMSS5SPQVOGpXcoZ-9AP7o9y14=.6eb65796-4e30-4093-866d-226334d9977c@github.com> Message-ID: On Mon, 21 Oct 2024 17:20:15 GMT, Sean Mullan wrote: > > There are a couple of micro benchmarks in test/micro that fork with `jvmArgsPrepend={"-Djava.security.manager=allow"})`, they will need to be examined. > > Fixed, will be in next drop. There are a couple of other micro tests that test the performance of `AccessController.doPrivileged` and `getContext` which probably don't make sense anymore, but I've left them for now to be looked at later. I checked the commit in the sandbox and it looks okay. It may be some future maintenance in these micros may do some pruning as aren't too useful now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2431865182 From alanb at openjdk.org Wed Oct 23 11:57:31 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 11:57:31 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/java/net/httpclient/websocket/security/WSURLPermissionTest.java line 342: > 340: throws Exception > 341: { > 342: action.run(); testWithNoSecurityManager was previously a sanity check, the test was focused on permission check. Is the test still useful to keep, maybe it would be renamed or the test method renamed? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812582305 From alanb at openjdk.org Wed Oct 23 12:01:33 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 12:01:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 21:20:59 GMT, Mandy Chung wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/java/lang/invoke/RevealDirectTest.java line 33: > >> 31: * @test >> 32: * @summary verify Lookup.revealDirect on a variety of input handles, with security manager >> 33: * @run main/othervm/policy=jtreg.security.policy/secure=java.lang.SecurityManager -ea -esa test.java.lang.invoke.RevealDirectTest > > line 36 can also be removed. > > > * $ $JAVA8X_HOME/bin/java -cp $JUNIT4_JAR:../../../.. -ea -esa -Djava.security.manager test.java.lang.invoke.RevealDirectTest hasSM and the code that only runs when true can be deleted too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812587449 From alanb at openjdk.org Wed Oct 23 12:17:35 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 12:17:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 test/jdk/java/lang/RuntimeTests/exec/ExecCommand.java line 241: > 239: Properties props = System.getProperties(); > 240: props.setProperty(JDK_LANG_PROCESS_ALLOW_AMBIGUOUS_COMMANDS, ""); > 241: System.setSecurityManager(new SecurityMan()); I assume SecurityMan should be removed too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812614134 From coleenp at openjdk.org Wed Oct 23 12:47:34 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 12:47:34 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 src/hotspot/share/prims/jvm.cpp line 1272: > 1270: > 1271: > 1272: // Returns the inherited_access_control_context field of the running thread. There's some code in this file in static void trace_class_resolution_impl(Klass* to_class, TRAPS) { That does this: while (!vfst.at_end()) { Method* m = vfst.method(); if (!vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass())&& !vfst.method()->method_holder()->is_subclass_of(access_controller_klass) && !vfst.method()->method_holder()->is_subclass_of(privileged_action_klass)) { break; } last_caller = m; vfst.next(); } Is this dead code that should be removed? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812677985 From alanb at openjdk.org Wed Oct 23 12:56:40 2024 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 23 Oct 2024 12:56:40 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 12:44:53 GMT, Coleen Phillimore wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > src/hotspot/share/prims/jvm.cpp line 1272: > >> 1270: >> 1271: >> 1272: // Returns the inherited_access_control_context field of the running thread. > > There's some code in this file in > static void trace_class_resolution_impl(Klass* to_class, TRAPS) { > > That does this: > > > while (!vfst.at_end()) { > Method* m = vfst.method(); > if (!vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass())&& > !vfst.method()->method_holder()->is_subclass_of(access_controller_klass) && > !vfst.method()->method_holder()->is_subclass_of(privileged_action_klass)) { > break; > } > last_caller = m; > vfst.next(); > } > > > Is this dead code that should be removed? This tracing skips ClassLoader frames, you'll continue to see these when using Class.forName. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812694528 From rkennke at openjdk.org Wed Oct 23 13:03:19 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 23 Oct 2024 13:03:19 GMT Subject: RFR: 8337511: Implement JEP 404: Generational Shenandoah (Experimental) [v5] In-Reply-To: References: <8N7AiGx8AZc-d6MgBEKVw5R-qk8J_1FBZH-SbzmydGg=.d7ac9a04-5fa3-47e3-8d24-c8efd28a51f7@github.com> Message-ID: On Mon, 21 Oct 2024 21:16:50 GMT, William Kemper wrote: >> This PR merges JEP 404, a generational mode for the Shenandoah garbage collector. The JEP can be viewed here: https://openjdk.org/jeps/404. We would like to target JDK24 with this PR. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 492 commits: > > - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux > - Merge > - 8342560: GenShen: Fix confusing method name > > Reviewed-by: ysr > - 8342564: GenShen: Only reference young/old generation names in generational mode > > Reviewed-by: xpeng, ysr > - Merge remote-tracking branch 'jdk/master' into great-genshen-pr-redux > - Merge remote-tracking branch 'shenandoah/master' into great-genshen-pr-redux > - 8342214: GenShen: Reduce code duplication in shFreeSet with iterator abstraction > > Reviewed-by: kdnilsen, ysr > - 8342239: GenShen: Revert changes in adaptive heuristic to avoid overflow on 32 bit > > Reviewed-by: ysr > - 8342278: GenShen: Move non-generational mode test out of generational test configuration > > Reviewed-by: ysr > - 8342255: GenShen: Remove unnecessary enum initial values > > Reviewed-by: ysr > - ... and 482 more: https://git.openjdk.org/jdk/compare/71583222...2a2aa408 I've looked at the changes again, especially at all that changed since my last full review. It's looking good to me, now. Please remove the one newline that I've spotted. Thanks for this work, this is really a huge effort! src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 1: > 1: This newline is one too much. ------------- Marked as reviewed by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21273#pullrequestreview-2388573425 PR Review Comment: https://git.openjdk.org/jdk/pull/21273#discussion_r1812694226 From rkennke at openjdk.org Wed Oct 23 13:07:04 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Wed, 23 Oct 2024 13:07:04 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 11:39:26 GMT, Stefan Karlsson wrote: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. The changes make sense to me and the code now matches the C++ implementation on HotSpot. Thanks! ------------- Marked as reviewed by rkennke (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21662#pullrequestreview-2388617960 From dfuchs at openjdk.org Wed Oct 23 13:10:37 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Wed, 23 Oct 2024 13:10:37 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 11:54:39 GMT, Alan Bateman wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/java/net/httpclient/websocket/security/WSURLPermissionTest.java line 342: > >> 340: throws Exception >> 341: { >> 342: action.run(); > > testWithNoSecurityManager was previously a sanity check, the test was focused on permission check. Is the test still useful to keep, maybe it would be renamed or the test method renamed? Good point. Similarly, the URLPermission[] parameter is now always unused, so maybe I should get rid of that too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1812727202 From rsunderbabu at openjdk.org Wed Oct 23 14:07:49 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 23 Oct 2024 14:07:49 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler [v2] In-Reply-To: References: Message-ID: > Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. > > Testing done for > Tiers 1,2,3 > test/hotspot/jtreg tests Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: use single compile, reuse utility class ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21641/files - new: https://git.openjdk.org/jdk/pull/21641/files/0826d40a..b3d9da8d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21641&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21641&range=00-01 Stats: 79 lines in 10 files changed: 17 ins; 38 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/21641.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21641/head:pull/21641 PR: https://git.openjdk.org/jdk/pull/21641 From rsunderbabu at openjdk.org Wed Oct 23 14:11:06 2024 From: rsunderbabu at openjdk.org (Ramkumar Sunderbabu) Date: Wed, 23 Oct 2024 14:11:06 GMT Subject: RFR: 8202100: Merge vm/share/InMemoryJavaCompiler w/ jdk/test/lib/compiler/InMemoryJavaCompiler [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 14:07:49 GMT, Ramkumar Sunderbabu wrote: >> Merging vm folder's InMemoryJavaCompiler into jdk folder's merge InMemoryJavaCompiler so that maintenance is easy. >> >> Testing done for >> Tiers 1,2,3 >> test/hotspot/jtreg tests > > Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision: > > use single compile, reuse utility class Changes 1. Replace batch compile to single compile wherever applicable. 2. Reuse utility classes in the merged InMemoryJavaCompiler, remove unused utility class PS: batch compile cannot be removed as certain use cases need it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21641#issuecomment-2432334700 From lmesnik at openjdk.org Wed Oct 23 15:48:06 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Wed, 23 Oct 2024 15:48:06 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 11:39:26 GMT, Stefan Karlsson wrote: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. Marked as reviewed by lmesnik (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21662#pullrequestreview-2389260656 From weijun at openjdk.org Wed Oct 23 16:44:12 2024 From: weijun at openjdk.org (Weijun Wang) Date: Wed, 23 Oct 2024 16:44:12 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 14:34:30 GMT, Julian Waters wrote: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did The `security.cpp` looks fine to me. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2432824930 From cjplummer at openjdk.org Wed Oct 23 16:50:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 23 Oct 2024 16:50:10 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 05:23:39 GMT, Julian Waters wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c line 53: >> >>> 51: #ifndef _WIN32 >>> 52: static MUTEX_T my_mutex = MUTEX_INIT; >>> 53: #endif >> >> The reason for no reference on windows is because of the following on windows: >> >> >> #define MUTEX_LOCK(x) /* FIXUP? */ >> #define MUTEX_UNLOCK(x) /* FIXUP? */ >> >> >> So looks like this mutex support is something we never got around to. I think your current workaround is fine. > > I'm curious now, how to implement mutex support on Windows? I think I prefer that to just making it completely unavailable on Windows We've gone 20 years without it on Windows, so I'm inclined not to worry about the lack of support on Windows. Logging is not used often in the debug agent. I've turned in on once in a while but usually find it too noisy and hard to read. What I usually opt for is changing some of the log_message() calls to instead just use tty_message(). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1813176284 From cjplummer at openjdk.org Wed Oct 23 16:54:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 23 Oct 2024 16:54:10 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 05:22:45 GMT, Julian Waters wrote: >> src/jdk.jdi/windows/native/libdt_shmem/shmem_md.c line 47: >> >>> 45: { >>> 46: void *mappedMemory; >>> 47: // HANDLE memHandle; >> >> Why comment out this one but not the one at line 88? It seems they are both equally problematic and are hiding the static memHandle. I'm not sure why the 2nd one isn't flagged. I'd actually suggest getting rid of the static memHandle. It does not seem to be needed. > > I wasn't sure whether the global memHandle not being used was a bug, so I commented out the local one. I missed the line 88 one because it wasn't flagged. If it really isn't needed I'll remove that one instead I'm not sure what you mean by "that one". It's the static one that should be removed. The local variables always hide the static, and there seems to be no reason for the value of memHandle to survive outside of the local scope it is used in. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1813181393 From pchilanomate at openjdk.org Wed Oct 23 17:26:15 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 17:26:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v6] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: - Rename timedWaitNonce to timedWaitSeqNo - Fix comment in Thread.java - Clear oops when thawing lockstack + add thaw_lockstack() ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/b6bc98e2..e232b7f3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=04-05 Stats: 77 lines in 5 files changed: 29 ins; 18 del; 30 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Wed Oct 23 17:26:16 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 17:26:16 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v6] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 12:32:00 GMT, Axel Boldt-Christmas wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: >> >> - Rename timedWaitNonce to timedWaitSeqNo >> - Fix comment in Thread.java >> - Clear oops when thawing lockstack + add thaw_lockstack() > > src/hotspot/share/oops/stackChunkOop.cpp line 471: > >> 469: } >> 470: } >> 471: } > > Can we turn these three very similar loops into one? In my opinion, it is easier to parse. > > ```C++ > void stackChunkOopDesc::copy_lockstack(oop* dst) { > const int cnt = lockstack_size(); > const bool requires_gc_barriers = is_gc_mode() || requires_barriers(); > const bool requires_uncompress = requires_gc_barriers && has_bitmap() && UseCompressedOops; > const auto get_obj = [&](intptr_t* at) -> oop { > if (requires_gc_barriers) { > if (requires_uncompress) { > return HeapAccess<>::oop_load(reinterpret_cast(at)); > } > return HeapAccess<>::oop_load(reinterpret_cast(at)); > } > return *reinterpret_cast(at); > }; > > intptr_t* lockstack_start = start_address(); > for (int i = 0; i < cnt; i++) { > oop mon_owner = get_obj(&lockstack_start[i]); > assert(oopDesc::is_oop(mon_owner), "not an oop"); > dst[i] = mon_owner; > } > } Done. I combined it with the oop clearing suggestion. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813222417 From pchilanomate at openjdk.org Wed Oct 23 17:26:16 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 17:26:16 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <21HfKDagatsu-A7zva9eZ_ndGye37_BRkJ3cyAKQoN0=.b256c1ad-c2d4-44e8-bc39-3201c5a29481@github.com> On Wed, 23 Oct 2024 05:33:55 GMT, Axel Boldt-Christmas wrote: >> Ok, I'll change copy_lockstack to both load and clear the oops in the same method. Now, when we call do_barriers on recurse_thaw we don't clear the oops, we just load and store the loaded value again. Is it the case that we just need to do a store, so that already works, or are we missing clearing the oops from the copied frames? > > The store is the important part for SATB. The fact that do_barriers (only) does a self store seems is an optimisation. As we need to do the store before we do the copy (to enable a plane memcpy). And clearing is not something that we rely on / need at the moment. The nicest model would have been to first fix the oops, (mem)copy, then clear them. But as mentioned, clearing is currently unnecessary. For the lockstack we do not need this optimisation as we do the copy when we do the load barrier. So we can just clear in our store. > > It is a little interesting that we template parameterise `do_barriers` on the barrier type and instantiate all the load functions, while only ever using the store version. Guess it is a remnant from some earlier model. I renamed it to transfer_lockstack() and applied the suggested version with the lambda. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813224287 From kizune at openjdk.org Wed Oct 23 17:27:42 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Wed, 23 Oct 2024 17:27:42 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 Finished reviewing of accessibility (both in com.sun and jdk.javax), jdk.javax.sound and jdk.java.awt.Desktop. Looks good. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2432939145 From pchilanomate at openjdk.org Wed Oct 23 17:36:14 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 17:36:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 07:03:48 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/share/runtime/threadIdentifier.cpp line 30: > >> 28: >> 29: // starting at 3, excluding reserved values defined in ObjectMonitor.hpp >> 30: static const int64_t INITIAL_TID = 3; > > Can we express this in terms of those reserved values, or are they inaccessible? Yes, we could define a new public constant `static const int64_t FIRST_AVAILABLE_TID = 3` (or some similar name) and use it here: diff --git a/src/hotspot/share/runtime/threadIdentifier.cpp b/src/hotspot/share/runtime/threadIdentifier.cpp index 60d6a990779..710c3141768 100644 --- a/src/hotspot/share/runtime/threadIdentifier.cpp +++ b/src/hotspot/share/runtime/threadIdentifier.cpp @@ -24,15 +24,15 @@ #include "precompiled.hpp" #include "runtime/atomic.hpp" +#include "runtime/objectMonitor.hpp" #include "runtime/threadIdentifier.hpp" -// starting at 3, excluding reserved values defined in ObjectMonitor.hpp -static const int64_t INITIAL_TID = 3; -static volatile int64_t next_thread_id = INITIAL_TID; +// excluding reserved values defined in ObjectMonitor.hpp +static volatile int64_t next_thread_id = ObjectMonitor::FIRST_AVAILABLE_TID; #ifdef ASSERT int64_t ThreadIdentifier::initial() { - return INITIAL_TID; + return ObjectMonitor::FIRST_AVAILABLE_TID; } #endif Or maybe define it as MAX_RESERVED_TID instead, and here we would add one to it. > src/java.base/share/classes/java/lang/Thread.java line 731: > >> 729: >> 730: if (attached && VM.initLevel() < 1) { >> 731: this.tid = 3; // primordial thread > > The comment before the `ThreadIdentifiers` class needs updating to account for this change. Fixed. > src/java.base/share/classes/java/lang/VirtualThread.java line 109: > >> 107: * >> 108: * RUNNING -> BLOCKING // blocking on monitor enter >> 109: * BLOCKING -> BLOCKED // blocked on monitor enter > > Should this say something similar to the parked case, about the "yield" being successful? Since the unmount is triggered from the VM we never call yieldContinuation(), unlike with the PARKING case. In other words, there are no two cases to handle. If freezing the continuation fails, the virtual thread will already block in the monitor code pinned to the carrier, so a state of BLOCKING means freezing the continuation succeeded. > src/java.base/share/classes/java/lang/VirtualThread.java line 110: > >> 108: * RUNNING -> BLOCKING // blocking on monitor enter >> 109: * BLOCKING -> BLOCKED // blocked on monitor enter >> 110: * BLOCKED -> UNBLOCKED // unblocked, may be scheduled to continue > > Does this mean it now owns the monitor, or just it is able to re-contest for monitor entry? It means it is scheduled to run again and re-contest for the monitor. > src/java.base/share/classes/java/lang/VirtualThread.java line 111: > >> 109: * BLOCKING -> BLOCKED // blocked on monitor enter >> 110: * BLOCKED -> UNBLOCKED // unblocked, may be scheduled to continue >> 111: * UNBLOCKED -> RUNNING // continue execution after blocked on monitor enter > > Presumably this one means it acquired the monitor? Not really, it is the state we set when the virtual thread is mounted and runs again. In this case it will just run to re-contest for the monitor. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813237094 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813237507 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813239314 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813239799 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813240352 From pchilanomate at openjdk.org Wed Oct 23 17:36:14 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 17:36:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <7BYPwAm8OvYFldeIFsYf5m9MbocP5Wue35H-Ix_erw0=.179301e3-42e6-4975-ad8f-9474eb73247a@github.com> Message-ID: On Wed, 23 Oct 2024 11:32:54 GMT, Alan Bateman wrote: >> Suggestion: `timedWaitCounter` ? > > We could rename it to timedWaitSeqNo if needed. Ok, renamed to timedWaitSeqNo. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813240667 From mdonovan at openjdk.org Wed Oct 23 18:05:26 2024 From: mdonovan at openjdk.org (Matthew Donovan) Date: Wed, 23 Oct 2024 18:05:26 GMT Subject: RFR: 8341927: Replace hardcoded security providers with new test.provider.name system property [v3] In-Reply-To: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> References: <9_7TTgZryCxc9I6cuB9eHW6J6eA-NPSn56giRfqGHe8=.a620474d-4e77-4e39-ab1d-dad3e1bc741c@github.com> Message-ID: > In this PR, I removed hard-coded security providers and replaced them with a system property, test.provider.name. If the property is not specified, the provider originally used in the test is used: > > Cipher c = Cipher.getInstance("AES/GCM/NoPadding", System.getProperty("test.provider.name", "SunJCE")); Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: fixed whitespace ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21551/files - new: https://git.openjdk.org/jdk/pull/21551/files/83599700..7dbe83e8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21551&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21551&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21551.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21551/head:pull/21551 PR: https://git.openjdk.org/jdk/pull/21551 From honkar at openjdk.org Wed Oct 23 18:06:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 23 Oct 2024 18:06:36 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <-GbMPbwNI--hHPZyyPgdU-pOMZh0Z4tZ_tLdbv-LL2E=.1494bfd4-7941-4c2e-af9b-82a29a4b2427@github.com> On Wed, 23 Oct 2024 05:11:19 GMT, Prasanta Sadhukhan wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > >> @prsadhuk Addressed review comments in the following jep486 branch commit: [openjdk/jdk-sandbox at d9ee496](https://github.com/openjdk/jdk-sandbox/commit/d9ee496f7349cb8beaf1e696fd430f8064baee8e) >> >> 1. test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java - Updated, removed redundant try-catch block >> >> 2. test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java - Repurposed and added back >> >> 3. test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java - Updated, added finally block >> >> 4. test/jdk/javax/swing/UIDefaults/6795356/TableTest.java - Added back >> >> >> Left out comments that fall into out-of-scope/clean-up for jep486. > > looks ok but awt import should have been before swing as decided, although this again is not part of SM exercise but since you modified the tests I thought I will say it aloud.. @prsadhuk > looks ok but awt import should have been before swing as decided, although this again is not part of SM exercise but since you modified the tests I thought I will say it aloud Thanks! I didn't notice it happened again with the new changes. This was probably due to IDE settings. Since this was a recent change I have updated in the latest commit. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2433031866 From prr at openjdk.org Wed Oct 23 18:14:35 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 23 Oct 2024 18:14:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 05:11:19 GMT, Prasanta Sadhukhan wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > >> @prsadhuk Addressed review comments in the following jep486 branch commit: [openjdk/jdk-sandbox at d9ee496](https://github.com/openjdk/jdk-sandbox/commit/d9ee496f7349cb8beaf1e696fd430f8064baee8e) >> >> 1. test/jdk/javax/swing/JEditorPane/8080972/TestJEditor.java - Updated, removed redundant try-catch block >> >> 2. test/jdk/javax/swing/JPopupMenu/6691503/bug6691503.java - Repurposed and added back >> >> 3. test/jdk/javax/swing/JPopupMenu/6694823/bug6694823.java - Updated, added finally block >> >> 4. test/jdk/javax/swing/UIDefaults/6795356/TableTest.java - Added back >> >> >> Left out comments that fall into out-of-scope/clean-up for jep486. > > looks ok but awt import should have been before swing as decided, although this again is not part of SM exercise but since you modified the tests I thought I will say it aloud.. > @prsadhuk > > > looks ok but awt import should have been before swing as decided, although this again is not part of SM exercise but since you modified the tests I thought I will say it aloud > > Thanks! I didn't notice it happened again with the new changes. This was probably due to IDE settings. Since this was a recent change I have updated in the latest commit. I also didn't realise you had "changed" it. I'm finding it very painful to navigate to the related files in this huge PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2433046255 From prr at openjdk.org Wed Oct 23 18:14:35 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 23 Oct 2024 18:14:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 I've reviewed all jdk/java/awt and jdk/javax/imageio tests. I've either commented or proactively fixed in the jep sandbox branch. Or both. Next sync from there should resolve those. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2433048411 From mdoerr at openjdk.org Wed Oct 23 18:18:23 2024 From: mdoerr at openjdk.org (Martin Doerr) Date: Wed, 23 Oct 2024 18:18:23 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Tue, 22 Oct 2024 13:53:03 GMT, Thomas Stuefe wrote: >> I will do some benchmarks > > I did SpecJBB runs with shift of 6, 8 and 10, respectively, which amounts to Klass alignment of 64, 256 and 1K. Benchmark scores did not show a significant pattern. I did not measure CPU stats though. > > But I still think a dynamically calculated shift makes sense, and I hesitate to change this code at this point. I therefore would like to move this question to followup RFEs if necessary. This code causes test errors in `CompressedClassPointersEncodingScheme.java` on s390 and PPC64. It forces the shift to `log_cacheline` which is 7 on PPC64 and 9 on s390. The test passes when we remove "s > log_cacheline && " from the condition below. In addition, it doesn't fit to the comment which claims we should avoid shifts larger than the cacheline size. This enforces shifts to be larger (or equal to) than the cacheline size. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1813304646 From coleenp at openjdk.org Wed Oct 23 19:18:33 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 19:18:33 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 12:53:12 GMT, Alan Bateman wrote: >> src/hotspot/share/prims/jvm.cpp line 1272: >> >>> 1270: >>> 1271: >>> 1272: // Returns the inherited_access_control_context field of the running thread. >> >> There's some code in this file in >> static void trace_class_resolution_impl(Klass* to_class, TRAPS) { >> >> That does this: >> >> >> while (!vfst.at_end()) { >> Method* m = vfst.method(); >> if (!vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass())&& >> !vfst.method()->method_holder()->is_subclass_of(access_controller_klass) && >> !vfst.method()->method_holder()->is_subclass_of(privileged_action_klass)) { >> break; >> } >> last_caller = m; >> vfst.next(); >> } >> >> >> Is this dead code that should be removed? > > This tracing skips ClassLoader frames, you'll continue to see these when using Class.forName. but you won't see access_controller_klass or priviledged_action_klass frames, so no need to skip them? Not sure why you'd want to skip class loader frames here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1813400810 From coleenp at openjdk.org Wed Oct 23 19:25:17 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 23 Oct 2024 19:25:17 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: <_gXXCttW-h4AfQUaeBanzH40dfndZS9GIBzqHQ6ob-8=.0ea3c533-9cdc-4fc4-aa7d-0debff0a97a5@github.com> References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> <_gXXCttW-h4AfQUaeBanzH40dfndZS9GIBzqHQ6ob-8=.0ea3c533-9cdc-4fc4-aa7d-0debff0a97a5@github.com> Message-ID: On Wed, 23 Oct 2024 06:15:27 GMT, David Holmes wrote: > Why do we need to cache it? Is it the implicit barriers related to accessing the threadObj oop each time? We cache threadObj.thread_id in JavaThread::_lock_id so that the fast path c2_MacroAssembler code has one less load and code to find the offset of java.lang.Thread.threadId in the code. Also, yes, we were worried about performance of the barrier in this path. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecomment-2433252605 From egahlin at openjdk.org Wed Oct 23 19:31:26 2024 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 23 Oct 2024 19:31:26 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:19:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright > - Avoid assert/endless-loop in JFR code Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2389952721 From egahlin at openjdk.org Wed Oct 23 19:31:26 2024 From: egahlin at openjdk.org (Erik Gahlin) Date: Wed, 23 Oct 2024 19:31:26 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:22:20 GMT, Roman Kennke wrote: > @egahlin / @mgronlun could you please review the JFR parts of this PR? One change is for getting the right prototype header, the other is for avoiding an endless loop/assert in a corner case. JFR changes look reasonable. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2433263488 From honkar at openjdk.org Wed Oct 23 19:41:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 23 Oct 2024 19:41:36 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <0hopUxCsiLaaoyBfNaj3hnNsGq-at7ttBqERS6OfGLI=.280f52c2-d171-455e-aefd-a983fe33e0cf@github.com> References: <0hopUxCsiLaaoyBfNaj3hnNsGq-at7ttBqERS6OfGLI=.280f52c2-d171-455e-aefd-a983fe33e0cf@github.com> Message-ID: On Mon, 21 Oct 2024 21:12:29 GMT, Phil Race wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/javax/imageio/CachePremissionsTest/CachePermissionsTest.java line 76: > >> 74: System.out.println("java.io.tmpdir is " + System.getProperty("java.io.tmpdir")); >> 75: >> 76: if (args.length > 1) { > > The isFileCacheExpected logic does not make sense. The test sets set to use the cache but then reads whether to expect it based on the args[0]. If that were set to false the test will fail. So why is it there ? > > Also the messing around with exceptions at the end of the test is pointless @prrace I might have missed removing this check which was in the original test. The latest update to this test has two run tags but it fails when isFileCacheExpected is set to true. Did you mean to keep only one run tag? https://github.com/openjdk/jdk-sandbox/commit/1bf77a393c5756bca65760402077617d37be72d2 I'll be rename the test as suggested when I update this test next. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1813429265 From cjplummer at openjdk.org Wed Oct 23 19:51:11 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Wed, 23 Oct 2024 19:51:11 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout In-Reply-To: References: Message-ID: <0_0LoiSECTe_JEfGgOTCICMw1lblyUhN0F7WSCE8GdA=.fc9c6013-657f-4eaa-9378-c1c51357e881@github.com> On Wed, 23 Oct 2024 11:39:26 GMT, Stefan Karlsson wrote: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. Changes requested by cjplummer (Reviewer). src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java line 443: > 441: > 442: Type collectedHeap = db.lookupType("CollectedHeap"); > 443: CIntegerType sizeType = (CIntegerType) db.lookupType("size_t"); I think you can use getSizet() here. ------------- PR Review: https://git.openjdk.org/jdk/pull/21662#pullrequestreview-2390075171 PR Review Comment: https://git.openjdk.org/jdk/pull/21662#discussion_r1813440444 From honkar at openjdk.org Wed Oct 23 20:20:35 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 23 Oct 2024 20:20:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: <0hopUxCsiLaaoyBfNaj3hnNsGq-at7ttBqERS6OfGLI=.280f52c2-d171-455e-aefd-a983fe33e0cf@github.com> Message-ID: On Wed, 23 Oct 2024 19:38:10 GMT, Harshitha Onkar wrote: >> test/jdk/javax/imageio/CachePremissionsTest/CachePermissionsTest.java line 76: >> >>> 74: System.out.println("java.io.tmpdir is " + System.getProperty("java.io.tmpdir")); >>> 75: >>> 76: if (args.length > 1) { >> >> The isFileCacheExpected logic does not make sense. The test sets set to use the cache but then reads whether to expect it based on the args[0]. If that were set to false the test will fail. So why is it there ? >> >> Also the messing around with exceptions at the end of the test is pointless > > @prrace I might have missed removing this check which was in the original test. The latest update to this test has two run tags but it fails when isFileCacheExpected is set to true. > > Did you mean to keep only one run tag? https://github.com/openjdk/jdk-sandbox/commit/1bf77a393c5756bca65760402077617d37be72d2 > > I'll be rename the test as suggested when I update this test next. No changes required for this test. The test was failing due to IDE config issue of tmp dir. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1813474346 From pchilanomate at openjdk.org Wed Oct 23 20:22:26 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:22:26 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/e232b7f3..baf7ffab Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=05-06 Stats: 6 lines in 2 files changed: 2 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From pchilanomate at openjdk.org Wed Oct 23 20:47:09 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:09 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:56:21 GMT, Andrew Haley wrote: >> Note also that `inc_held_monitor_count` clobbers `rscratch2`. That might be worth a comment at the call site. >> I guess `inc_held_monitor_count` is so hot that we can't push and pop scratch registers, in which case it'd clobber nothing. > >> Historically, silently using `rscratch1` and `rscratch2` in these macros has sometimes turned out to be a mistake. Please consider making `rscratch2` an additional argument to `fast_lock`, so that it's explicit in the caller. It won't make any difference to the generated code, but it might help readbility. > > Hmm, forget that. It's rather tricky code, that's true, but I think we're OK. I see we are already using rscratch1 in these locking macros so I could change it to use that instead. But looking at all other macros in this file we are already using rscratch1 and rscratch2 too, so I think we would be fine either way. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813513144 From pchilanomate at openjdk.org Wed Oct 23 20:47:10 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:10 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <793XB62tkVT9w5ix7Ie1Hhxse4WnmnA7baNi__fs0Dw=.849e94b4-6aa7-4035-9304-525109dbba4c@github.com> On Wed, 23 Oct 2024 05:56:48 GMT, Axel Boldt-Christmas wrote: >> Also, is it better to have this without assignment. Which is a nit. >> Address dst(rthread, JavaThread::held_monitor_count_offset()); > > The `=` in a variable definition is always construction, never assignment. > > That said, I also prefer `Address dst(rthread, JavaThread::held_monitor_count_offset());` Less redundant information. Added comment and fixed dst definition. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813514402 From pchilanomate at openjdk.org Wed Oct 23 20:47:11 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:11 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: <1fIoKFEkaZWw0x3eG4cdDbHX_RVga-A6ovBsZnwVgbk=.bc2d26c6-c9a2-4ebe-9e95-9bf9733b947c@github.com> On Wed, 23 Oct 2024 00:19:23 GMT, Coleen Phillimore wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv > > src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5354: > >> 5352: str(rscratch2, dst); >> 5353: Label ok; >> 5354: tbz(rscratch2, 63, ok); > > 63? Does this really need to have underflow checking? That would alleviate the register use concerns if it didn't. And it's only for legacy locking which should be stable until it's removed. I can remove the check. I don't think it hurts either though. Also we can actually just use rscratch1 in the ASSERT case. > src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 231: > >> 229: >> 230: void MacroAssembler::inc_held_monitor_count(Register tmp) { >> 231: Address dst = Address(xthread, JavaThread::held_monitor_count_offset()); > > Address dst(xthread, JavaThread::held_monitor_count_offset()); Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813516395 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813519648 From pchilanomate at openjdk.org Wed Oct 23 20:47:13 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:13 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 15:50:15 GMT, Andrew Haley wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with six additional commits since the last revision: >> >> - Fix comments in objectMonitor.hpp >> - Move frame::saved_thread_address() to platform dependent files >> - Fix typo in jvmtiExport.cpp >> - remove usage of frame::metadata_words in possibly_adjust_frame() >> - Fix comments in c2 locking paths >> - Revert and simplify changes to c1_Runtime1 on aarch64 and riscv > > src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5357: > >> 5355: >> 5356: void MacroAssembler::dec_held_monitor_count() { >> 5357: Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); > > Suggestion: > > // Clobbers: rscratch1 and rscratch2 > void MacroAssembler::dec_held_monitor_count() { > Address dst = Address(rthread, JavaThread::held_monitor_count_offset()); Added. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813515113 From pchilanomate at openjdk.org Wed Oct 23 20:47:14 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 05:42:34 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Address David's comments to ObjectMonitor.hpp > > src/hotspot/share/runtime/objectMonitor.hpp line 299: > >> 297: // Simply set _owner field to new_value; current value must match old_value. >> 298: void set_owner_from_raw(int64_t old_value, int64_t new_value); >> 299: // Same as above but uses tid of current as new value. > > By `tid` here (and elsewhere) you actually mean `thread->threadObj()->thread_id()` - right? It is `thread->vthread()->thread_id()` but it will match `thread->threadObj()->thread_id()` when there is no virtual thread mounted. But we cache it in thread->_lockd_id so we retrieve it from there. I think we should probably change the name of _lock_id. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813525449 From pchilanomate at openjdk.org Wed Oct 23 20:47:15 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: On Wed, 23 Oct 2024 05:18:10 GMT, David Holmes wrote: >> Thread identity switches to the carrier so Thread.currentThread() is the carrier thread and JavaThread._lock_id is the thread identifier of the carrier. setCurrentLockId changes JavaThread._lock_id back to the virtual thread's identifier. > > If the virtual thread is un-mounting from the carrier, why do we need to set the "lock id" back to the virtual thread's id? Sorry I'm finding this quite confusing. > > Also `JavaThread::_lock_id` in the VM means "the java.lang.Thread thread-id to use for locking" - correct? Sorry, I should add context on why this is needed. The problem is that inside this temporal transition we could try to acquire some monitor. If the monitor is not inflated we will try to use the LockStack, but the LockStack might be full from monitors the virtual thread acquired before entering this transition. Since the LockStack is full we will try to make room by inflating one or more of the monitors in it [1]. But when inflating the monitors we would be using the j.l.Thread.tid of the carrier (set into _lock_id when switching the identity), which is wrong. We need to use the j.l.Thread.tid of the virtual thread, so we need to change _lock_id back. We are not really unmounting the virtual thread, the only thing that we want is to set the identity to the carrier thread so that we don't end up in this nested calls to parkNanos. [1] https://github.com/openjdk/jdk/blob/afb62f73499c09f4a7bde6f522fcd3ef1278e526/src/hotspot/share/runtime/lightweightSynchronizer.cpp#L491 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813503450 From pchilanomate at openjdk.org Wed Oct 23 20:47:15 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Wed, 23 Oct 2024 20:47:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: On Wed, 23 Oct 2024 20:34:48 GMT, Patricio Chilano Mateo wrote: >> If the virtual thread is un-mounting from the carrier, why do we need to set the "lock id" back to the virtual thread's id? Sorry I'm finding this quite confusing. >> >> Also `JavaThread::_lock_id` in the VM means "the java.lang.Thread thread-id to use for locking" - correct? > > Sorry, I should add context on why this is needed. The problem is that inside this temporal transition we could try to acquire some monitor. If the monitor is not inflated we will try to use the LockStack, but the LockStack might be full from monitors the virtual thread acquired before entering this transition. Since the LockStack is full we will try to make room by inflating one or more of the monitors in it [1]. But when inflating the monitors we would be using the j.l.Thread.tid of the carrier (set into _lock_id when switching the identity), which is wrong. We need to use the j.l.Thread.tid of the virtual thread, so we need to change _lock_id back. > We are not really unmounting the virtual thread, the only thing that we want is to set the identity to the carrier thread so that we don't end up in this nested calls to parkNanos. > > [1] https://github.com/openjdk/jdk/blob/afb62f73499c09f4a7bde6f522fcd3ef1278e526/src/hotspot/share/runtime/lightweightSynchronizer.cpp#L491 > Also JavaThread::_lock_id in the VM means "the java.lang.Thread thread-id to use for locking" - correct? > Yes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813507846 From mullan at openjdk.org Wed Oct 23 21:57:34 2024 From: mullan at openjdk.org (Sean Mullan) Date: Wed, 23 Oct 2024 21:57:34 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 12:14:24 GMT, Alan Bateman wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/java/lang/RuntimeTests/exec/ExecCommand.java line 241: > >> 239: Properties props = System.getProperties(); >> 240: props.setProperty(JDK_LANG_PROCESS_ALLOW_AMBIGUOUS_COMMANDS, ""); >> 241: System.setSecurityManager(new SecurityMan()); > > I assume SecurityMan should be removed too. Yes, and the comments that say "no SM" should be updated. @RogerRiggs can you take a look at this? Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1813724467 From mullan at openjdk.org Wed Oct 23 22:21:35 2024 From: mullan at openjdk.org (Sean Mullan) Date: Wed, 23 Oct 2024 22:21:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: <-WUk0E4MRJ1CB84NKT6g7L3pmv-IFpgTnJsrjsjSavA=.53352f0c-6c82-4a45-86c8-b3468c842d9e@github.com> On Tue, 22 Oct 2024 21:36:06 GMT, Mandy Chung wrote: > Reviewed test/jdk/java/lang/** and test/jdk/sun/reflect/* tests. Thanks for the comprehensive review. I have incorporated all of your comments except for removing the enum from `java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java` which is a bit more involved. I plan on posting an updated PR with these and other changes tomorrow. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2433572062 From duke at openjdk.org Wed Oct 23 23:01:10 2024 From: duke at openjdk.org (Larry Cable) Date: Wed, 23 Oct 2024 23:01:10 GMT Subject: RFR: 8341482: Attach API access to /proc filesystem should use doPrivileged [v2] In-Reply-To: References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 21:15:11 GMT, Larry Cable wrote: >> this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 >> >> to resolve an issue detected in: >> >> https://bugs.openjdk.org/browse/JDK-8341246 >> >> /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. > > Larry Cable has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8327114: fix to resolve permissions issue as per: 8341246, also privileged exists and isReadable invocations closed superceded by 8342449 ------------- PR Comment: https://git.openjdk.org/jdk/pull/21312#issuecomment-2433694112 From duke at openjdk.org Wed Oct 23 23:01:11 2024 From: duke at openjdk.org (Larry Cable) Date: Wed, 23 Oct 2024 23:01:11 GMT Subject: Withdrawn: 8341482: Attach API access to /proc filesystem should use doPrivileged In-Reply-To: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> References: <2AUSpzO22hPJ82syTcfyrb8NhzZuYAet-MbcvgDfWQM=.2df12e78-79f5-4dbe-b8ee-8ff144d38516@github.com> Message-ID: On Wed, 2 Oct 2024 19:55:29 GMT, Larry Cable wrote: > this is a fix to: https://bugs.openjdk.org/browse/JDK-8327114 > > to resolve an issue detected in: > > https://bugs.openjdk.org/browse/JDK-8341246 > > /proc/**/* file accesses should be performed as "privileged" actions to avoid security mgr exceptions. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/21312 From amenkov at openjdk.org Thu Oct 24 01:48:38 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 24 Oct 2024 01:48:38 GMT Subject: RFR: 8342577: Clean up JVMTI breakpoint support Message-ID: The fix cleans up code to support list of JVMTI breakpoints. - classes required to supports cache of byte code pointers (GrowableElement, GrowableCache, JvmtiBreakpointCache) are dropped; - class JvmtiCurrentBreakpoints (JvmtiBreakpoints factory) is left as is, dropped unused code; - fixed race in JvmtiCurrentBreakpoints::get_jvmti_breakpoints() (fix for JDK-8210637); - JvmtiBreakpoint:JvmtiBreakpoint() + JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) are replaced with copy ctor; - JvmtiBreakpoints::clearall_in_class_at_safepoint() is simplified to do a single pass; Testing: tier1..tier6 ------------- Commit messages: - bp_cleanup Changes: https://git.openjdk.org/jdk/pull/21675/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21675&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342577 Stats: 352 lines in 2 files changed: 27 ins; 284 del; 41 mod Patch: https://git.openjdk.org/jdk/pull/21675.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21675/head:pull/21675 PR: https://git.openjdk.org/jdk/pull/21675 From iklam at openjdk.org Thu Oct 24 03:01:54 2024 From: iklam at openjdk.org (Ioi Lam) Date: Thu, 24 Oct 2024 03:01:54 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v4] In-Reply-To: References: Message-ID: > This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). > > ---- > Note: this is a combined PR of the following individual PRs > - https://github.com/openjdk/jdk/pull/20516 > - https://github.com/openjdk/jdk/pull/20517 > - https://github.com/openjdk/jdk/pull/20843 > - https://github.com/openjdk/jdk/pull/20958 > - https://github.com/openjdk/jdk/pull/20959 > - https://github.com/openjdk/jdk/pull/21049 > - https://github.com/openjdk/jdk/pull/21143 Ioi Lam has updated the pull request incrementally with two additional commits since the last revision: - 8342907: Implement AOT testing mode for jtreg tests (authored by @katyapav) - disable test that fails with hotspot_runtime_non_cds_mode ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21642/files - new: https://git.openjdk.org/jdk/pull/21642/files/1b6c3e28..dd59b5f1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21642&range=02-03 Stats: 103 lines in 4 files changed: 100 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21642.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21642/head:pull/21642 PR: https://git.openjdk.org/jdk/pull/21642 From jwaters at openjdk.org Thu Oct 24 03:36:04 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 24 Oct 2024 03:36:04 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: <6bgDWzW7hPhgXiKPtf691dw78Fywzz7xpNfI7AixFsM=.ebc2cc90-ebc1-4187-ae38-3f0979a97dc9@github.com> On Mon, 21 Oct 2024 14:34:30 GMT, Julian Waters wrote: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did Thanks Weijun for the ok on security (Though it still makes me uneasy because it smells like a bug, but I guess it's alright). I haven't pushed yet to remove the changes to the other files in this Pull Request because the way I did it I'd have to force push and that would destroy all the review comments, I'll do that once the comments have been fully addressed ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2434176106 From jwaters at openjdk.org Thu Oct 24 03:36:05 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 24 Oct 2024 03:36:05 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 16:51:23 GMT, Chris Plummer wrote: >> I wasn't sure whether the global memHandle not being used was a bug, so I commented out the local one. I missed the line 88 one because it wasn't flagged. If it really isn't needed I'll remove that one instead > > I'm not sure what you mean by "that one". It's the static one that should be removed. The local variables always hide the static, and there seems to be no reason for the value of memHandle to survive outside of the local scope it is used in. Oh, I was referring to the static global one. In that case I'll remove it (Or rather, comment it so it isn't lost to time and someone can bring it back if need be) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1814187989 From pchilanomate at openjdk.org Thu Oct 24 03:38:21 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 03:38:21 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 09:53:44 GMT, Alan Bateman wrote: >> The problem is that within that window we don't have access to the virtual thread's tid. The current thread has already been changed and we haven't yet set the lock id back. Since this will be a rare corner case maybe we can just print tid unavailable if we hit it. We could also add a boolean to setCurrentThread to indicate we don't want to change the lock_id, but not sure it's worth it. > > It should be rare and once we make further progress on timers then the use of temporary transitions will mostly disappear. I think the main thing for the thread dump is not to print a confusing "Carrying virtual thread" with the tid of the carrier. This came up in [pull/19482](https://github.com/openjdk/jdk/pull/19482) when the thread was extended. Pushed a fix to avoid printing the virtual thread tid if we hit that case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814186777 From pchilanomate at openjdk.org Thu Oct 24 03:38:21 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 03:38:21 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 09:58:44 GMT, Alan Bateman wrote: >> src/hotspot/share/runtime/javaThread.hpp line 166: >> >>> 164: // current _vthread object, except during creation of the primordial and JNI >>> 165: // attached thread cases where this field can have a temporary value. >>> 166: int64_t _lock_id; >> >> Following the review I wanted to better understand when `_lock_id` changes. There seems to be another exception to the rule that `_lock_id` is equal to the `tid` of the current `_vthread`. I think they won't be equal when switching temporarily from the virtual to the carrier thread in `VirtualThread::switchToCarrierThread()`. > > Right, and we hope this temporary. We had more use of temporary transitions when the feature was initially added in JDK 19, now we mostly down to the nested parking issue. That will go away when we get to replacing the timer code, and we should be able to remove the switchXXX method and avoid the distraction/complexity that goes with them. I extended the comment to mention this case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814189388 From pchilanomate at openjdk.org Thu Oct 24 03:38:22 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 03:38:22 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Wed, 23 Oct 2024 05:43:53 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Address David's comments to ObjectMonitor.hpp > > src/hotspot/share/runtime/objectMonitor.hpp line 302: > >> 300: void set_owner_from(int64_t old_value, JavaThread* current); >> 301: // Set _owner field to tid of current thread; current value must be ANONYMOUS_OWNER. >> 302: void set_owner_from_BasicLock(JavaThread* current); > > Shouldn't tid there be the basicLock? So the value stored in _owner has to be ANONYMOUS_OWNER. We cannot store the BasicLock* in there as before since it can clash with some other thread's tid. We store it in the new field _stack_locker instead. > src/hotspot/share/runtime/objectMonitor.hpp line 334: > >> 332: >> 333: // Returns true if BasicLock* stored in _stack_locker >> 334: // points to current's stack, false othwerwise. > > Suggestion: > > // points to current's stack, false otherwise. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814187730 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814187856 From pchilanomate at openjdk.org Thu Oct 24 03:38:21 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 03:38:21 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: - Fix comment in objectMonitor.hpp and javaThread.hpp - Skip printing tid when not available ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/baf7ffab..03ba6dfb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=06-07 Stats: 23 lines in 4 files changed: 17 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From lmesnik at openjdk.org Thu Oct 24 05:15:29 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 24 Oct 2024 05:15:29 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:19:24 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright > - Avoid assert/endless-loop in JFR code Not actually review, just confirming that my request fulfilled. And no more issues arised during PIT ------------- Marked as reviewed by lmesnik (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20677#pullrequestreview-2391292083 From lmesnik at openjdk.org Thu Oct 24 05:15:30 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 24 Oct 2024 05:15:30 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v6] In-Reply-To: References: Message-ID: On Fri, 30 Aug 2024 07:37:35 GMT, Thomas Stuefe wrote: >> make/Images.gmk line 135: >> >>> 133: # >>> 134: # Param1 - VM variant (e.g., server, client, zero, ...) >>> 135: # Param2 - _nocoops, _coh, _nocoops_coh, or empty >> >> The -XX:+UseCompactObjectHeaders ssems to incompatible withe zero vm. The zero vm build start failing while generating shared archive with +UseCompactObjectHeaders. Generation should be disabled by default for zero to don't break the build. > > No, zero works with +COH, but a small change is needed. I'll post a suggestion inline. no objection anymore ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814259543 From jrose at openjdk.org Thu Oct 24 05:46:08 2024 From: jrose at openjdk.org (John R Rose) Date: Thu, 24 Oct 2024 05:46:08 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v4] In-Reply-To: References: Message-ID: <6ESSOT5cMkoM_k1L32iXOAeYNLpjmeOlKPWZvYOVcc8=.c16e28d3-faee-444e-a37c-addc8e07bb54@github.com> On Thu, 24 Oct 2024 03:01:54 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). >> >> ---- >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https://github.com/openjdk/jdk/pull/20517 >> - https://github.com/openjdk/jdk/pull/20843 >> - https://github.com/openjdk/jdk/pull/20958 >> - https://github.com/openjdk/jdk/pull/20959 >> - https://github.com/openjdk/jdk/pull/21049 >> - https://github.com/openjdk/jdk/pull/21143 > > Ioi Lam has updated the pull request incrementally with two additional commits since the last revision: > > - 8342907: Implement AOT testing mode for jtreg tests (authored by @katyapav) > - disable test that fails with hotspot_runtime_non_cds_mode I took a closer look at the diffs in a file you renamed, from `classPrelinker.cpp` to `aotConstantPoolResolver.cpp`. Changes still look good, notably the filtering logic on the bootstrap methods (and their arguments) that we support. For the record, the diff I made for review is enclosed. It makes the new indy-related logic stand out pretty well. [classPrelinker.deleted.cpp.txt](https://github.com/user-attachments/files/17501832/classPrelinker.deleted.cpp.txt) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21642#issuecomment-2434351458 From dholmes at openjdk.org Thu Oct 24 05:58:15 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 05:58:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:38:21 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: > > - Fix comment in objectMonitor.hpp and javaThread.hpp > - Skip printing tid when not available src/hotspot/share/prims/jvm.cpp line 4012: > 4010: } > 4011: ThreadBlockInVM tbivm(THREAD); > 4012: parkEvent->park(); What code does the unpark to wake this thread up? I can't quite see how this unparker thread operates as its logic seems dispersed. src/hotspot/share/runtime/javaThread.hpp line 166: > 164: // current _vthread object, except during creation of the primordial and JNI > 165: // attached thread cases where this field can have a temporary value. Also, > 166: // calls to VirtualThread.switchToCarrierThread will temporary change _vthread s/temporary change/temporarily change/ src/java.base/share/classes/java/lang/Object.java line 383: > 381: try { > 382: wait0(timeoutMillis); > 383: } catch (InterruptedException e) { I had expected to see a call to a new `wait0` method that returned a value indicating whether the wait was completed or else we had to park. Instead we had to put special logic in the native-call-wrapper code in the VM to detect returning from wait0 and changing the return address. I'm still unclear where that modified return address actually takes us. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814306675 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814260043 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814294622 From dholmes at openjdk.org Thu Oct 24 05:58:18 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 05:58:18 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 20:22:26 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: > > Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv src/java.base/share/classes/java/lang/Thread.java line 654: > 652: * {@link Thread#PRIMORDIAL_TID} +1 as this class cannot be used during > 653: * early startup to generate the identifier for the primordial thread. The > 654: * counter is off-heap and shared with the VM to allow it assign thread Suggestion: * counter is off-heap and shared with the VM to allow it to assign thread src/java.base/share/classes/java/lang/Thread.java line 655: > 653: * early startup to generate the identifier for the primordial thread. The > 654: * counter is off-heap and shared with the VM to allow it assign thread > 655: * identifiers to non-Java threads. Why do non-JavaThreads need an identifier of this kind? src/java.base/share/classes/java/lang/VirtualThread.java line 631: > 629: // Object.wait > 630: if (s == WAITING || s == TIMED_WAITING) { > 631: byte nonce; Suggestion: byte seqNo; src/java.base/share/classes/java/lang/VirtualThread.java line 948: > 946: * This method does nothing if the thread has been woken by notify or interrupt. > 947: */ > 948: private void waitTimeoutExpired(byte nounce) { I assume you meant `nonce` here, but please change to `seqNo`. src/java.base/share/classes/java/lang/VirtualThread.java line 952: > 950: for (;;) { > 951: boolean unblocked = false; > 952: synchronized (timedWaitLock()) { Where is the overall design of the timed-wait protocol and it use of synchronization described? src/java.base/share/classes/java/lang/VirtualThread.java line 1397: > 1395: > 1396: /** > 1397: * Returns a lock object to coordinating timed-wait setup and timeout handling. Suggestion: * Returns a lock object for coordinating timed-wait setup and timeout handling. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814158735 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814159210 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814169150 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814170953 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814171503 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814172621 From dholmes at openjdk.org Thu Oct 24 05:58:18 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 05:58:18 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 17:32:45 GMT, Patricio Chilano Mateo wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 111: >> >>> 109: * BLOCKING -> BLOCKED // blocked on monitor enter >>> 110: * BLOCKED -> UNBLOCKED // unblocked, may be scheduled to continue >>> 111: * UNBLOCKED -> RUNNING // continue execution after blocked on monitor enter >> >> Presumably this one means it acquired the monitor? > > Not really, it is the state we set when the virtual thread is mounted and runs again. In this case it will just run to re-contest for the monitor. So really UNBLOCKED is UNBLOCKING and mirrors BLOCKING , so we have: RUNNING -> BLOCKING -> BLOCKED BLOCKED -> UNBLOCKING -> RUNNABLE I'm just trying to get a better sense of what we can infer if we see these "transition" states. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814163283 From dholmes at openjdk.org Thu Oct 24 05:58:19 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 05:58:19 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> Message-ID: <6IyizKWQ3ev2YfWJiyVhEsENxlHJ3fsY-cPGXNCyI2g=.1eac6280-7fbf-43c4-84b4-8f234efd74a1@github.com> On Wed, 23 Oct 2024 20:36:23 GMT, Patricio Chilano Mateo wrote: >> Sorry, I should add context on why this is needed. The problem is that inside this temporal transition we could try to acquire some monitor. If the monitor is not inflated we will try to use the LockStack, but the LockStack might be full from monitors the virtual thread acquired before entering this transition. Since the LockStack is full we will try to make room by inflating one or more of the monitors in it [1]. But when inflating the monitors we would be using the j.l.Thread.tid of the carrier (set into _lock_id when switching the identity), which is wrong. We need to use the j.l.Thread.tid of the virtual thread, so we need to change _lock_id back. >> We are not really unmounting the virtual thread, the only thing that we want is to set the identity to the carrier thread so that we don't end up in this nested calls to parkNanos. >> >> [1] https://github.com/openjdk/jdk/blob/afb62f73499c09f4a7bde6f522fcd3ef1278e526/src/hotspot/share/runtime/lightweightSynchronizer.cpp#L491 > >> Also JavaThread::_lock_id in the VM means "the java.lang.Thread thread-id to use for locking" - correct? >> > Yes. I guess I don't understand where this piece code fits in the overall transition of the virtual thread to being parked. I would have expected the LockStack to already have been moved by the time we switch identities to the carrier thread. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814167842 From jrose at openjdk.org Thu Oct 24 06:17:10 2024 From: jrose at openjdk.org (John R Rose) Date: Thu, 24 Oct 2024 06:17:10 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v4] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:01:54 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). >> >> ---- >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https://github.com/openjdk/jdk/pull/20517 >> - https://github.com/openjdk/jdk/pull/20843 >> - https://github.com/openjdk/jdk/pull/20958 >> - https://github.com/openjdk/jdk/pull/20959 >> - https://github.com/openjdk/jdk/pull/21049 >> - https://github.com/openjdk/jdk/pull/21143 > > Ioi Lam has updated the pull request incrementally with two additional commits since the last revision: > > - 8342907: Implement AOT testing mode for jtreg tests (authored by @katyapav) > - disable test that fails with hotspot_runtime_non_cds_mode A thought for a possible cleanup, after this PR is done? The scratch mirror logic had me? scratching my head. It seems to me that a more descriptive name would make the code explain itself better. I suggest (for a future cleanup) calling a mirror structure which is being aot-assembled (just for the archive) a "future mirror" (or maybe "production mirror" or "mirror asset"). This is in distinction to the current "live" mirror, which is also the AOT phase mirror. In general, from the point of view of the assembly phase, when we build new structures not created by the JVM as a result of post-training Java execution, we might want to give them a common descriptive term. But I suppose most items that make it into the AOT cache are faithful copies of live data, present in the VM at dump time (end of assembly phase). In that case, it's more like "the same structure" in all cases, and there's no need to simultaneously work on both present and future versions of the same structure. (When I say "structure" I mean mirror object for now, but perhaps the pattern might expand to something else? Or, maybe we will get rid of the two-mirror solution, in which case every future structure is also completely present and live in the assembly-phase VM.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21642#issuecomment-2434387290 From dholmes at openjdk.org Thu Oct 24 06:21:21 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 06:21:21 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Thu, 24 Oct 2024 03:31:02 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/objectMonitor.hpp line 302: >> >>> 300: void set_owner_from(int64_t old_value, JavaThread* current); >>> 301: // Set _owner field to tid of current thread; current value must be ANONYMOUS_OWNER. >>> 302: void set_owner_from_BasicLock(JavaThread* current); >> >> Shouldn't tid there be the basicLock? > > So the value stored in _owner has to be ANONYMOUS_OWNER. We cannot store the BasicLock* in there as before since it can clash with some other thread's tid. We store it in the new field _stack_locker instead. Right I understand we can't store the BasicLock* directly in owner, but the naming of this method has me confused as to what it actually does. With the old version we have: Before: owner = BasicLock* belonging to current After: owner = JavaThread* of current with the new version we have: Before: owner = ANONYMOUS_OWNER After: owner = tid of current so "BasicLock" doesn't mean anything here any more. Isn't this just `set_owner_from_anonymous` ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814330162 From cjplummer at openjdk.org Thu Oct 24 06:56:10 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 24 Oct 2024 06:56:10 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:31:31 GMT, Julian Waters wrote: >> I'm not sure what you mean by "that one". It's the static one that should be removed. The local variables always hide the static, and there seems to be no reason for the value of memHandle to survive outside of the local scope it is used in. > > Oh, I was referring to the static global one. In that case I'll remove it (Or rather, comment it so it isn't lost to time and someone can bring it back if need be) I would just remove the static. I don't see any reason for it to exist. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1814375764 From stooke at openjdk.org Thu Oct 24 07:03:36 2024 From: stooke at openjdk.org (Simon Tooke) Date: Thu, 24 Oct 2024 07:03:36 GMT Subject: RFR: 8319873: Add macOS implementation for jcmd System.map and System.dump_map Message-ID: This is a port of #16301 to macOS. System.map and System.dump_map are implemented using the macOS API and provide roughly the same information in the same format. Most of the heavy lifting was implemented by @tstuefe in https://github.com/openjdk/jdk/pull/16301 - this PR adds the macOS implementation and enables the common code for macOS 64 bit. [Sample output (with NMT enabled)](https://github.com/user-attachments/files/16968316/vm_memory_map_87218.txt) ------------- Commit messages: - fix whitepsace errors - initial release - fix whitespace - more test cleanup - refactor System.dump test for MacOS - Merge branch 'master' into pr_macos_system_dump - add macOS to liast of supposredt platforms - Merge branch 'openjdk:master' into pr_macos_system_dump - fix macOS System.map tests - fix merge error - ... and 8 more: https://git.openjdk.org/jdk/compare/363327e6...c6628d30 Changes: https://git.openjdk.org/jdk/pull/20953/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20953&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8319873 Stats: 577 lines in 9 files changed: 499 ins; 40 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/20953.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20953/head:pull/20953 PR: https://git.openjdk.org/jdk/pull/20953 From alanb at openjdk.org Thu Oct 24 07:06:17 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 07:06:17 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 02:42:35 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv > > src/java.base/share/classes/java/lang/Thread.java line 655: > >> 653: * early startup to generate the identifier for the primordial thread. The >> 654: * counter is off-heap and shared with the VM to allow it assign thread >> 655: * identifiers to non-Java threads. > > Why do non-JavaThreads need an identifier of this kind? JFR. We haven't changed anything there, just the initial tid. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814387940 From dholmes at openjdk.org Thu Oct 24 07:14:05 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 07:14:05 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: <6bgDWzW7hPhgXiKPtf691dw78Fywzz7xpNfI7AixFsM=.ebc2cc90-ebc1-4187-ae38-3f0979a97dc9@github.com> References: <6bgDWzW7hPhgXiKPtf691dw78Fywzz7xpNfI7AixFsM=.ebc2cc90-ebc1-4187-ae38-3f0979a97dc9@github.com> Message-ID: On Thu, 24 Oct 2024 03:33:51 GMT, Julian Waters wrote: > the way I did it I'd have to force push That should not be the case. You can just anti-delta changes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2434475849 From alanb at openjdk.org Thu Oct 24 07:18:35 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 07:18:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 19:15:01 GMT, Coleen Phillimore wrote: >> This tracing skips ClassLoader frames, you'll continue to see these when using Class.forName. > > but you won't see access_controller_klass or priviledged_action_klass frames, so no need to skip them? Not sure why you'd want to skip class loader frames here. Right, although you might have to wait until there is more cleanup in the JDK code before they disappear completely. To clarify, most uses of privileged actions are only done when a SecurityManager is set but there some cases where they execute unconditionally. In the Class/ClassLoader then I think they are done conditionally so you should be okay. Are there tests for `-Xlog:class+resolve=debug` that would fail if we had a bug in this tracing code? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1814402940 From jrose at openjdk.org Thu Oct 24 07:19:10 2024 From: jrose at openjdk.org (John R Rose) Date: Thu, 24 Oct 2024 07:19:10 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v4] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:01:54 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). >> >> ---- >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https://github.com/openjdk/jdk/pull/20517 >> - https://github.com/openjdk/jdk/pull/20843 >> - https://github.com/openjdk/jdk/pull/20958 >> - https://github.com/openjdk/jdk/pull/20959 >> - https://github.com/openjdk/jdk/pull/21049 >> - https://github.com/openjdk/jdk/pull/21143 > > Ioi Lam has updated the pull request incrementally with two additional commits since the last revision: > > - 8342907: Implement AOT testing mode for jtreg tests (authored by @katyapav) > - disable test that fails with hotspot_runtime_non_cds_mode I read it through again. Some stylistic issues we have discussed can be saved for later. I didn't find any new problems, and known old problems are addressed. Ship it! ------------- Marked as reviewed by jrose (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21642#pullrequestreview-2391527792 From alanb at openjdk.org Thu Oct 24 07:51:15 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 07:51:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: <28R_1poNvjGMa9GI5z5mmudDS_3Kvzq9vJ_0sTpDJpA=.403c90e3-b158-4ccf-9875-7af3ad872d2c@github.com> On Thu, 24 Oct 2024 05:54:11 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: >> >> - Fix comment in objectMonitor.hpp and javaThread.hpp >> - Skip printing tid when not available > > src/hotspot/share/prims/jvm.cpp line 4012: > >> 4010: } >> 4011: ThreadBlockInVM tbivm(THREAD); >> 4012: parkEvent->park(); > > What code does the unpark to wake this thread up? I can't quite see how this unparker thread operates as its logic seems dispersed. It's very similar to the "Reference Handler" thread. That thread calls into the VM to get the pending-Reference list. Now we have "VirtualThread-unblocker" calling into the VM to get the list of virtual threads to unblock. ObjectMonitor::ExitEpilog will the unpark this thread when the virtual thread successor is on the list to unblock. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814450822 From stefank at openjdk.org Thu Oct 24 08:11:21 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 08:11:21 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:38:21 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: > > - Fix comment in objectMonitor.hpp and javaThread.hpp > - Skip printing tid when not available src/hotspot/share/runtime/objectMonitor.hpp line 325: > 323: } > 324: > 325: bool has_owner_anonymous() const { return owner_raw() == ANONYMOUS_OWNER; } Small, drive-by comment. The rename to `has_owner_anonymous` sounds worse than the previous `is_owner_anonymous` name. I think the code reads better if you change it to `has_anonymous_owner`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814489387 From alanb at openjdk.org Thu Oct 24 08:29:12 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 08:29:12 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: Message-ID: <77_fMY08zucHFP6Zo0sbJabtL1hdYdRVTsp_vkcSSow=.073a2157-37e9-40fb-aee3-c15858649c34@github.com> On Thu, 24 Oct 2024 02:47:14 GMT, David Holmes wrote: >> Not really, it is the state we set when the virtual thread is mounted and runs again. In this case it will just run to re-contest for the monitor. > > So really UNBLOCKED is UNBLOCKING and mirrors BLOCKING , so we have: > > RUNNING -> BLOCKING -> BLOCKED > BLOCKED -> UNBLOCKING -> RUNNABLE > > I'm just trying to get a better sense of what we can infer if we see these "transition" states. We named it UNBLOCKED when unblocked, like UNPARKED when unparked, as that accurately describes the state at this point. It's not mounted but may be scheduled to continue. In the user facing APIs this is mapped to "RUNNABLE", it's the equivalent of OS thread queued to the OS scheduler. So I think the name is good and would prefer not change it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814517084 From stefank at openjdk.org Thu Oct 24 08:30:47 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 08:30:47 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v2] In-Reply-To: References: Message-ID: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision: Remove redundant db.lookupType ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21662/files - new: https://git.openjdk.org/jdk/pull/21662/files/be690e24..e8ec2957 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21662/head:pull/21662 PR: https://git.openjdk.org/jdk/pull/21662 From sspitsyn at openjdk.org Thu Oct 24 08:42:46 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 24 Oct 2024 08:42:46 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v9] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: remove jvmti annotation for yield methods; simplify frames hiding and events posting code ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/54dc2b4a..58ab0057 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=07-08 Stats: 59 lines in 5 files changed: 5 ins; 26 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From sspitsyn at openjdk.org Thu Oct 24 08:51:47 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 24 Oct 2024 08:51:47 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v10] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: undo minor tweaks in a couple of continuation related files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/58ab0057..5d6e5c91 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=08-09 Stats: 5 lines in 2 files changed: 4 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From stuefe at openjdk.org Thu Oct 24 09:15:30 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 24 Oct 2024 09:15:30 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Wed, 23 Oct 2024 18:14:50 GMT, Martin Doerr wrote: > This code causes test errors in `CompressedClassPointersEncodingScheme.java` on s390 and PPC64. It forces the shift to `log_cacheline` which is 7 on PPC64 and 9 on s390. The test passes when we remove "s > log_cacheline && " from the condition below. It's a bit late. We are close to pushing. While it should be harmless to drop below alignment to below cache line size, this would be a change affecting all platforms and would require all tests repeated. PPC/s390 are not targeted by the JEP. There had never been a discussion I am aware of that these platforms have to be clean with +COH. While it's nice that the changes had been contributed, I don't think that test errors on these platforms should hold up pushing this RFE. Therefore, if needed, we should just omit +COH part of the test for PPC/S390. But then, what exactly is the error? If it's just the test assuming that cache line size is log 6, then the test should be fixed for ppc, not hotspot. > In addition, it doesn't fit to the comment which claims we should avoid shifts larger than the cacheline size. This enforces shifts to be larger (or equal to) than the cacheline size. ?? The comment is correct. We try to avoid hyper alignment, hence we drop the shift to - if possible - log 2 cache line size. If it's equal to log 2 cache line size, we succeeded. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814598543 From alanb at openjdk.org Thu Oct 24 09:22:14 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 09:22:14 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v10] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 08:51:47 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: undo minor tweaks in a couple of continuation related files Latest update to JvmtiMountTransition looks okay. I assume wait until Alex Menkov and Leonid are finished their reviews. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21397#issuecomment-2434743507 From stuefe at openjdk.org Thu Oct 24 09:25:35 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 24 Oct 2024 09:25:35 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Thu, 24 Oct 2024 09:12:34 GMT, Thomas Stuefe wrote: > But then, what exactly is the error? If it's just the test assuming that cache line size is log 6, then the test should be fixed for ppc, not hotspot. that is the problem, test assumes log2 of 6 for chacheline size ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814617136 From amitkumar at openjdk.org Thu Oct 24 09:31:31 2024 From: amitkumar at openjdk.org (Amit Kumar) Date: Thu, 24 Oct 2024 09:31:31 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Thu, 24 Oct 2024 09:22:34 GMT, Thomas Stuefe wrote: >>> This code causes test errors in `CompressedClassPointersEncodingScheme.java` on s390 and PPC64. It forces the shift to `log_cacheline` which is 7 on PPC64 and 9 on s390. The test passes when we remove "s > log_cacheline && " from the condition below. >> >> It's a bit late. We are close to pushing. While it should be harmless to drop below alignment to below cache line size, this would be a change affecting all platforms and would require all tests repeated. >> >> PPC/s390 are not targeted by the JEP. There had never been a discussion I am aware of that these platforms have to be clean with +COH. While it's nice that the changes had been contributed, I don't think that test errors on these platforms should hold up pushing this RFE. Therefore, if needed, we should just omit +COH part of the test for PPC/S390. >> >> But then, what exactly is the error? If it's just the test assuming that cache line size is log 6, then the test should be fixed for ppc, not hotspot. >> >>> In addition, it doesn't fit to the comment which claims we should avoid shifts larger than the cacheline size. This enforces shifts to be larger (or equal to) than the cacheline size. >> >> ?? The comment is correct. We try to avoid hyper alignment, hence we drop the shift to - if possible - log 2 cache line size. If it's equal to log 2 cache line size, we succeeded. > >> But then, what exactly is the error? If it's just the test assuming that cache line size is log 6, then the test should be fixed for ppc, not hotspot. > > that is the problem, test assumes log2 of 6 for chacheline size PPC log2 will be `7` (`DEFAULT_CACHE_LINE_SIZE? = 128`) and for S390x it will be `8` (`DEFAULT_CACHE_LINE_SIZE? = 256`). So I guess this change should be fine for now : diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java index e04e716315a..c1be59e77ab 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java @@ -108,7 +108,9 @@ public static void main(String[] args) throws Exception { long ccsSize = 128 * M; int expectedShift = 6; - test(forceAddress, true, ccsSize, forceAddress, expectedShift); + if (!Platform.isPPC() && !Platform.isS390x()) { + test(forceAddress, true, ccsSize, forceAddress, expectedShift); + } ccsSize = 512 * M; expectedShift = 8; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814627120 From amitkumar at openjdk.org Thu Oct 24 09:46:31 2024 From: amitkumar at openjdk.org (Amit Kumar) Date: Thu, 24 Oct 2024 09:46:31 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v50] In-Reply-To: References: Message-ID: On Tue, 22 Oct 2024 16:22:20 GMT, Roman Kennke wrote: >> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision: >> >> - Update copyright >> - Avoid assert/endless-loop in JFR code > > @egahlin / @mgronlun could you please review the JFR parts of this PR? One change is for getting the right prototype header, the other is for avoiding an endless loop/assert in a corner case. @rkennke Please include s390x implementation from here: https://github.com/offamitkumar/jdk/commit/e67e332ce6b3b09e723c08b11146ebe0cc16f0fd. This also disables this test on s390x & PPC for now, but if that's not what we want then I can revert changes done to `CompressedClassPointersEncodingScheme.java` file. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2434795830 From azvegint at openjdk.org Thu Oct 24 09:56:37 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Thu, 24 Oct 2024 09:56:37 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 java beans changes looks good ------------- Marked as reviewed by azvegint (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2391943640 From mdoerr at openjdk.org Thu Oct 24 09:57:41 2024 From: mdoerr at openjdk.org (Martin Doerr) Date: Thu, 24 Oct 2024 09:57:41 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Thu, 24 Oct 2024 09:28:13 GMT, Amit Kumar wrote: >>> But then, what exactly is the error? If it's just the test assuming that cache line size is log 6, then the test should be fixed for ppc, not hotspot. >> >> that is the problem, test assumes log2 of 6 for chacheline size > > PPC log2 will be `7` (`DEFAULT_CACHE_LINE_SIZE? = 128`) and for S390x it will be `8` (`DEFAULT_CACHE_LINE_SIZE? = 256`). > > So I guess this change should be fine for now : > > diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java > index e04e716315a..c1be59e77ab 100644 > --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java > +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java > @@ -108,7 +108,9 @@ public static void main(String[] args) throws Exception { > > long ccsSize = 128 * M; > int expectedShift = 6; > - test(forceAddress, true, ccsSize, forceAddress, expectedShift); > + if (!Platform.isPPC() && !Platform.isS390x()) { > + test(forceAddress, true, ccsSize, forceAddress, expectedShift); > + } > > ccsSize = 512 * M; > expectedShift = 8; As I understand the comment, it says alignment <= cache line size. But the implementation makes alignment >= cache line size. "hyper alignment" means alignment > cache line size? If we want alignment = cache line size, I'll be ok with disabling the +COH part of the test on PPC64 and s390. Correct, the problem is that the test assumes that log cache line size = 6. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814666149 From stuefe at openjdk.org Thu Oct 24 10:05:29 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Thu, 24 Oct 2024 10:05:29 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v21] In-Reply-To: References: <0fDctIMZlpNZ4a5_idrN_w8KnvGfPS49Bw_9WRdjJ9I=.8bedb8be-0b33-468b-b711-9c0b4fb6649e@github.com> Message-ID: On Thu, 24 Oct 2024 09:54:05 GMT, Martin Doerr wrote: > As I understand the comment, it says alignment <= cache line size. But the implementation makes alignment >= cache line size. "hyper alignment" means alignment > cache line size? Correct. since encoding range must cover the full klass range, and we only have 22bit nklass, shift is larger. at most 10. but since that causes hyper aligning, we try to get away with smaller shifts if klass range is smaller. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1814680330 From coleenp at openjdk.org Thu Oct 24 11:35:35 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Thu, 24 Oct 2024 11:35:35 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 07:15:53 GMT, Alan Bateman wrote: >> but you won't see access_controller_klass or priviledged_action_klass frames, so no need to skip them? Not sure why you'd want to skip class loader frames here. > > Right, although you might have to wait until there is more cleanup in the JDK code before they disappear completely. To clarify, most uses of privileged actions are only done when a SecurityManager is set but there some cases where they execute unconditionally. In the Class/ClassLoader then I think they are done conditionally so you should be okay. Are there tests for `-Xlog:class+resolve=debug` that would fail if we had a bug in this tracing code? So you're saying there will still be these frames in the stack that we want to skip? Okay, we'll clean all that out later then. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1814801818 From jpai at openjdk.org Thu Oct 24 11:42:06 2024 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 24 Oct 2024 11:42:06 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules In-Reply-To: References: Message-ID: <22AsTwbSfv2tI3gWZYFc7kLSr6Ehs8MY2N8TkTsImFI=.6b5d7853-5a13-4270-b0a5-b00c562085f0@github.com> On Tue, 22 Oct 2024 13:36:43 GMT, Hannes Walln?fer wrote: > Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. > > We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. > > I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. src/java.xml/share/classes/javax/xml/validation/SchemaFactoryConfigurationError.java line 2: > 1: /* > 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. Hello Hans, this looks like an oversight - the copyright year update should have retained the 2013 and additionally introduced 2024. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21637#discussion_r1814810579 From hannesw at openjdk.org Thu Oct 24 12:17:41 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Thu, 24 Oct 2024 12:17:41 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: References: Message-ID: > Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. > > We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. > > I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: Fix copyright header ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21637/files - new: https://git.openjdk.org/jdk/pull/21637/files/70c1d49f..65a3ddf8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21637&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21637&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21637.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21637/head:pull/21637 PR: https://git.openjdk.org/jdk/pull/21637 From hannesw at openjdk.org Thu Oct 24 12:17:42 2024 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Thu, 24 Oct 2024 12:17:42 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: <22AsTwbSfv2tI3gWZYFc7kLSr6Ehs8MY2N8TkTsImFI=.6b5d7853-5a13-4270-b0a5-b00c562085f0@github.com> References: <22AsTwbSfv2tI3gWZYFc7kLSr6Ehs8MY2N8TkTsImFI=.6b5d7853-5a13-4270-b0a5-b00c562085f0@github.com> Message-ID: <1SSi_dzz13sxXuDmlLMHn26DDwxozHVqmzIJkon1kFA=.6ce6f3c6-1e8e-4606-87ae-2ba61302c71e@github.com> On Thu, 24 Oct 2024 11:39:33 GMT, Jaikiran Pai wrote: >> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix copyright header > > src/java.xml/share/classes/javax/xml/validation/SchemaFactoryConfigurationError.java line 2: > >> 1: /* >> 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. > > Hello Hannes, this looks like an oversight - the copyright year update should have retained the 2013 and additionally introduced 2024. Thanks for catching this, @jaikiran! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21637#discussion_r1814857072 From stefank at openjdk.org Thu Oct 24 12:19:19 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 12:19:19 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v3] In-Reply-To: References: Message-ID: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision: Revert "Remove redundant db.lookupType" This reverts commit e8ec2957d43730560c73e2ea9b3ec7a91fc25535. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21662/files - new: https://git.openjdk.org/jdk/pull/21662/files/e8ec2957..3f50944e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/21662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21662/head:pull/21662 PR: https://git.openjdk.org/jdk/pull/21662 From stefank at openjdk.org Thu Oct 24 12:19:19 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 12:19:19 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v3] In-Reply-To: <0_0LoiSECTe_JEfGgOTCICMw1lblyUhN0F7WSCE8GdA=.fc9c6013-657f-4eaa-9378-c1c51357e881@github.com> References: <0_0LoiSECTe_JEfGgOTCICMw1lblyUhN0F7WSCE8GdA=.fc9c6013-657f-4eaa-9378-c1c51357e881@github.com> Message-ID: On Wed, 23 Oct 2024 19:48:13 GMT, Chris Plummer wrote: >> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert "Remove redundant db.lookupType" >> >> This reverts commit e8ec2957d43730560c73e2ea9b3ec7a91fc25535. > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java line 443: > >> 441: >> 442: Type collectedHeap = db.lookupType("CollectedHeap"); >> 443: CIntegerType sizeType = (CIntegerType) db.lookupType("size_t"); > > I think you can use getSizet() here. `getSizet()` seems to be a function in `Flags`, so I don't see a direct way to use it. I could probably use the `sizetType` instead of `db.lookupType("size_t")`, however when I tested the tests failed because sizetType had not been initialized yet. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21662#discussion_r1814862338 From kevinw at openjdk.org Thu Oct 24 12:24:09 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 24 Oct 2024 12:24:09 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Tue, 15 Oct 2024 22:31:46 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - updated comment > - feedback src/hotspot/share/services/attachListener.hpp line 65: > 63: /* > 64: Version 1 (since jdk6): attach operations always have 3 (AttachOparation::arg_count_max) > 65: arguments, each up to 1024 (AttachOparation::arg_length_max) symbols. "AttachOparation" typo and also "symbols" is clarified to mean characters in a review comment, so should probably change that here and also in attachListener.cpp 626, 627. CompatTest.java says "1024 symbols" ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1814869880 From kevinw at openjdk.org Thu Oct 24 12:40:06 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 24 Oct 2024 12:40:06 GMT Subject: RFR: 8339289: Parameter size mismatch between client and VM sides of the Attach API - Windows [v4] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: <8s-LyB3ap55T8sIZX7dI_xw_OUwrWEp6MpNn3rCqbJk=.50e31782-d82a-470d-9f3c-664fc32f9ed0@github.com> On Tue, 15 Oct 2024 22:31:46 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - updated comment > - feedback src/hotspot/share/services/attachListener.cpp line 406: > 404: { "printflag", print_flag }, > 405: { "jcmd", jcmd }, > 406: { "getVersion", get_version }, It's a bit of a nit, but "dumpheap" and other existing commands never use caps but the new "getVersion" does? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1814896928 From jpai at openjdk.org Thu Oct 24 12:44:05 2024 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 24 Oct 2024 12:44:05 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 12:17:41 GMT, Hannes Walln?fer wrote: >> Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. >> >> We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. >> >> I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Fix copyright header This doc-only change which merely reorders the `@param` tags looks OK to me. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21637#pullrequestreview-2392367946 From mullan at openjdk.org Thu Oct 24 13:19:55 2024 From: mullan at openjdk.org (Sean Mullan) Date: Thu, 24 Oct 2024 13:19:55 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: > This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. > > NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. > > The code changes can be broken down into roughly the following categories: > > 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. > 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. > 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. > 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). > 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. > > There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. > > Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). > > I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most f... Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 - Merge - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". - Remove println about Security Manager. - Remove unused static variable NEW_PROXY_IN_PKG. - Remove static variable `DEFAULT_POLICY` and unused imports. - Remove hasSM() method and code that calls it, and remove comment about running test manually with SM. - clientlibs: import order - warning-string - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde ------------- Changes: https://git.openjdk.org/jdk/pull/21498/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21498&range=02 Stats: 65432 lines in 1867 files changed: 1137 ins; 60545 del; 3750 mod Patch: https://git.openjdk.org/jdk/pull/21498.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21498/head:pull/21498 PR: https://git.openjdk.org/jdk/pull/21498 From rkennke at openjdk.org Thu Oct 24 14:05:40 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 24 Oct 2024 14:05:40 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v51] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Conditionalize platform specific parts of CompressedClassPointersEncodingScheme test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/1ef6394d..aadd7b8e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=50 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=49-50 Stats: 16 lines in 1 file changed: 2 ins; 0 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From mullan at openjdk.org Thu Oct 24 14:07:50 2024 From: mullan at openjdk.org (Sean Mullan) Date: Thu, 24 Oct 2024 14:07:50 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Mon, 21 Oct 2024 22:51:54 GMT, Mandy Chung wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". >> - Sanitize the class descriptions of DelegationPermission and ServicePermission >> by removing text that refers to granting permissions, but avoid changes that >> affect the API specification, such as the description and format of input >> parameters. >> - Restored methods in RMIConnection to throw SecurityExceptions again but >> with adjusted text that avoids the word "permission". >> - Add text to class description of MBeanServer stating that implementations >> may throw SecurityException if authorization doesn't allow access to resource. >> - Restore text about needing permissions from the desktop environment in the >> getPixelColor and createScreenCapture methods. >> - Add api note to getClassContext to use StackWalker instead and >> add DROP_METHOD_INFO option to StackWalker. >> - Change checkAccess() methods to be no-ops, rather than throwing >> SecurityException. >> - Merge >> - Merge >> - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 > > test/jdk/java/lang/Class/getDeclaredField/ClassDeclaredFieldsTest.java line 31: > >> 29: * @summary test that all fields returned by getDeclaredFields() can be >> 30: * set accessible if the right permission is granted; this test >> 31: * also verifies that Class.classLoader final private field is > > "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". Fixed in https://github.com/openjdk/jdk/pull/21498/commits/d8564fa8dd003456b6e313c5e07809999c7d96e1 > test/jdk/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java line 45: > >> 43: >> 44: public static void main(String... args) throws Throwable { >> 45: System.err.println("Test without security manager."); > > Security manager is not relevant any more. Suggest to drop this println. Fixed in https://github.com/openjdk/jdk/pull/21498/commits/002276450e625b66b786fb7eae7256bbcafa7496 > test/jdk/java/lang/reflect/Proxy/nonPublicProxy/NonPublicProxyClass.java line 83: > >> 81: } >> 82: >> 83: private static final String NEW_PROXY_IN_PKG = "newProxyInPackage."; > > This constant is no longer needed. Fixed in https://github.com/openjdk/jdk/pull/21498/commits/3dbf684263a75470b85a95b9446a44ceb99c4b3a ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815057352 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815058036 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815055982 From mullan at openjdk.org Thu Oct 24 14:07:50 2024 From: mullan at openjdk.org (Sean Mullan) Date: Thu, 24 Oct 2024 14:07:50 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 11:58:26 GMT, Alan Bateman wrote: >> test/jdk/java/lang/invoke/RevealDirectTest.java line 33: >> >>> 31: * @test >>> 32: * @summary verify Lookup.revealDirect on a variety of input handles, with security manager >>> 33: * @run main/othervm/policy=jtreg.security.policy/secure=java.lang.SecurityManager -ea -esa test.java.lang.invoke.RevealDirectTest >> >> line 36 can also be removed. >> >> >> * $ $JAVA8X_HOME/bin/java -cp $JUNIT4_JAR:../../../.. -ea -esa -Djava.security.manager test.java.lang.invoke.RevealDirectTest > > hasSM and the code that only runs when true can be deleted too. Fixed in https://github.com/openjdk/jdk/pull/21498/commits/559934662119b1372fd831de8be7c97f877e0947 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815058738 From rkennke at openjdk.org Thu Oct 24 14:19:11 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 24 Oct 2024 14:19:11 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v52] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: s390 port ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/aadd7b8e..c2f6d202 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=51 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=50-51 Stats: 151 lines in 9 files changed: 113 ins; 17 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From jwaters at openjdk.org Thu Oct 24 14:22:28 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 24 Oct 2024 14:22:28 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage [v2] In-Reply-To: References: Message-ID: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did Julian Waters has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: 8342682 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21616/files - new: https://git.openjdk.org/jdk/pull/21616/files/e149e654..2294b27f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21616&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21616&range=00-01 Stats: 68 lines in 22 files changed: 1 ins; 21 del; 46 mod Patch: https://git.openjdk.org/jdk/pull/21616.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21616/head:pull/21616 PR: https://git.openjdk.org/jdk/pull/21616 From jwaters at openjdk.org Thu Oct 24 14:22:29 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 24 Oct 2024 14:22:29 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage In-Reply-To: References: <6bgDWzW7hPhgXiKPtf691dw78Fywzz7xpNfI7AixFsM=.ebc2cc90-ebc1-4187-ae38-3f0979a97dc9@github.com> Message-ID: <7TiLoi4kpEVA782sZ5phBa38PuZxf7Ny6H_lZ27cFgA=.59b35424-72f8-4cb8-be83-758c2e181836@github.com> On Thu, 24 Oct 2024 07:11:16 GMT, David Holmes wrote: > > the way I did it I'd have to force push > > That should not be the case. You can just anti-delta changes. I did it in a really inefficient way, by checking out all files except for the files that I wanted to stay. I could not figure out how to undo it. In any case, I'm sorry for the sin I just committed... ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2435429996 From alanb at openjdk.org Thu Oct 24 14:29:41 2024 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 24 Oct 2024 14:29:41 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 11:32:27 GMT, Coleen Phillimore wrote: >> Right, although you might have to wait until there is more cleanup in the JDK code before they disappear completely. To clarify, most uses of privileged actions are only done when a SecurityManager is set but there some cases where they execute unconditionally. In the Class/ClassLoader then I think they are done conditionally so you should be okay. Are there tests for `-Xlog:class+resolve=debug` that would fail if we had a bug in this tracing code? > > So you're saying there will still be these frames in the stack that we want to skip? Okay, we'll clean all that out later then. I have the changes to Class/ClassLoader to propose as soon as this JEP integrates. If that can go in quickly then it would remove any concerns in advance of your cleanup to remove the filtering of these frames (although I don't think there is an issue as this code path is conditional based on whether a SM is set). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815107403 From iris at openjdk.org Thu Oct 24 14:48:08 2024 From: iris at openjdk.org (Iris Clark) Date: Thu, 24 Oct 2024 14:48:08 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 12:17:41 GMT, Hannes Walln?fer wrote: >> Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. >> >> We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. >> >> I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Fix copyright header Confirmed changes only re-order @param declarations. Recommend @JoeWang-Java to review changes to java.xml since portions of that module are maintained in an upstream repository. ------------- Marked as reviewed by iris (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21637#pullrequestreview-2392918255 From sspitsyn at openjdk.org Thu Oct 24 14:52:27 2024 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 24 Oct 2024 14:52:27 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v11] In-Reply-To: References: Message-ID: > This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. > Please, see a fix description in the first comment. > > Testing: > - Verified with new test `vthread/CheckHiddenFrames` > - Mach5 tiers 1-6 are passed Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: removed asserts from continuationFreezeThaw.cpp again ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21397/files - new: https://git.openjdk.org/jdk/pull/21397/files/5d6e5c91..bc056ec1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21397&range=09-10 Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/21397.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21397/head:pull/21397 PR: https://git.openjdk.org/jdk/pull/21397 From joehw at openjdk.org Thu Oct 24 16:40:06 2024 From: joehw at openjdk.org (Joe Wang) Date: Thu, 24 Oct 2024 16:40:06 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 12:17:41 GMT, Hannes Walln?fer wrote: >> Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. >> >> We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. >> >> I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Fix copyright header Thanks Iris for the reminder. Changes to java.xml look good. ------------- Marked as reviewed by joehw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21637#pullrequestreview-2393208720 From heidinga at openjdk.org Thu Oct 24 17:12:13 2024 From: heidinga at openjdk.org (Dan Heidinga) Date: Thu, 24 Oct 2024 17:12:13 GMT Subject: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v3] In-Reply-To: References: Message-ID: <3_QqIqOqw7Zhq-gpwFG72w4EWyoDfjNEHhdBt-eOjDU=.59d15b7a-9081-4cce-9303-108901d931c9@github.com> On Wed, 23 Oct 2024 04:46:51 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & Linking](https://openjdk.org/jeps/483). >> >> ---- >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https://github.com/openjdk/jdk/pull/20517 >> - https://github.com/openjdk/jdk/pull/20843 >> - https://github.com/openjdk/jdk/pull/20958 >> - https://github.com/openjdk/jdk/pull/20959 >> - https://github.com/openjdk/jdk/pull/21049 >> - https://github.com/openjdk/jdk/pull/21143 > > Ioi Lam has updated the pull request incrementally with three additional commits since the last revision: > > - fixed test failure with "jtreg -Dtest.dynamic.cds.archive=true ..." > - simplified the archiving of cpCache::resolved_references() -- we rely on AOTConstantPoolResolver::is_indy_resolution_deterministic() to do the filtering before indys are linked; there is no need to try to undo the resolved_references afterwards > - Fixed bug where the BSM oops for resolved indies are not archived Looks good! src/hotspot/share/cds/aotClassLinker.cpp line 156: > 154: ResourceMark rm; > 155: log_warning(cds, aot, link)("%s cannot be aot-linked because it nest host is not aot-linked", ik->external_name()); > 156: return false; This is a good find! Just to note - the same kind of check isn't required for PermittedSubclasses as the class granting permission to be a subclass is necessarily already loaded as one of our supers. ------------- Marked as reviewed by heidinga (no project role). PR Review: https://git.openjdk.org/jdk/pull/21642#pullrequestreview-2390446370 PR Review Comment: https://git.openjdk.org/jdk/pull/21642#discussion_r1815035125 From aivanov at openjdk.org Thu Oct 24 17:26:47 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 24 Oct 2024 17:26:47 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 13:19:55 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Merge > - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". > - Remove println about Security Manager. > - Remove unused static variable NEW_PROXY_IN_PKG. > - Remove static variable `DEFAULT_POLICY` and unused imports. > - Remove hasSM() method and code that calls it, and remove comment about > running test manually with SM. > - clientlibs: import order > - warning-string > - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java > - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde Changes requested by aivanov (Reviewer). src/java.desktop/share/classes/java/awt/Desktop.java line 713: > 711: * {@code Info.plist}. > 712: * > 713: * @param printFileHandler handler Suggestion: * @param printFileHandler handler * Can we add a blank line here? It's present in the methods above. Although there are other places below where it's missing; so not worth worrying. src/java.desktop/share/classes/java/awt/Font.java line 1612: > 1610: * obtained. The {@code String} value of this property is then > 1611: * interpreted as a {@code Font} object according to the > 1612: * specification of {@code Font.decode(String)} Suggestion: * specification of {@code Font.decode(String)}. Period is missing. src/java.desktop/share/classes/java/awt/Font.java line 1613: > 1611: * interpreted as a {@code Font} object according to the > 1612: * specification of {@code Font.decode(String)} > 1613: * If the specified property is not found then null is returned instead. Suggestion: * If the specified property is not found, null is returned instead. The old description didn't have ?then?, it can be dropped. A comma to separate the conditional clause from the main one makes the sentence easier to read. src/java.desktop/share/classes/java/awt/Font.java line 1780: > 1778: *

> 1779: * The property value should be one of the forms accepted by > 1780: * {@code Font.decode(String)} Suggestion: * {@code Font.decode(String)}. Period is missing. src/java.desktop/share/classes/java/awt/Font.java line 1781: > 1779: * The property value should be one of the forms accepted by > 1780: * {@code Font.decode(String)} > 1781: * If the specified property is not found then the {@code font} Suggestion: * If the specified property is not found, the {@code font} src/java.desktop/share/classes/java/awt/MouseInfo.java line 68: > 66: * @throws SecurityException if a security manager exists and its > 67: * {@code checkPermission} method doesn't allow the operation > 68: * @see GraphicsConfiguration Is `GraphicsConfiguration` removed from the list because it's already mentioned and linked in the description above? Is it intentional? src/java.desktop/share/classes/java/beans/Expression.java line 1: > 1: /* Needs copyright year update. src/java.desktop/share/classes/java/beans/PropertyEditorManager.java line 71: > 69: * > 70: * @param targetType the class object of the type to be edited > 71: * @param editorClass the class object of the editor classs Suggestion: * @param editorClass the class object of the editor class Typo with an extra ?s?. The line should remain unchanged. src/java.desktop/share/classes/javax/swing/JTable.java line 6343: > 6341: * GraphicsEnvironment.isHeadless > 6342: * returns true > 6343: * method disallows this thread from creating a print job request Suggestion: One more line to remove here. src/java.desktop/share/classes/javax/swing/WindowConstants.java line 1: > 1: /* Needs updating the copyright year. test/jdk/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java line 28: > 26: @key headful > 27: @bug 6785058 > 28: @summary Tests that an owner is activated on closing its owned dialog with the warning icon. Does this test remain relevant without the security manager? Without the security manager, there will be no dialogs with the warning icon. test/jdk/java/awt/regtesthelpers/process/ProcessCommunicator.java line 1: > 1: /* Copyright year needs updating. test/jdk/java/beans/Introspector/7084904/Test7084904.java line 31: > 29: * @library .. > 30: * @run main Test7084904 > 31: * @author Sergey Malenkov The test below `Test4683761.java` removes the `@author` tag. Should it be removed here? test/jdk/java/beans/XMLEncoder/6777487/TestCheckedCollection.java line 1: > 1: /* Copyright years need updating. test/jdk/java/beans/XMLEncoder/ReferenceToNonStaticField.java line 29: > 27: * @test > 28: * @bug 8060027 > 29: * @run main/othervm ReferenceToNonStaticField Other tests in the set removed `/othervm`. Is it left intentionally? test/jdk/java/beans/XMLEncoder/Test4631471.java line 28: > 26: * @bug 4631471 6972468 > 27: * @summary Tests DefaultTreeModel encoding > 28: * @run main/othervm Test4631471 Other tests in the set removed `/othervm`. Is it left intentionally? Looks like this question applies to all tests in `XMLEncoder/` directory. ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2392963469 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815168399 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815180719 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815184053 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815185648 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815187240 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815203856 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815290263 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815294333 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815320927 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815330072 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815362826 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815404801 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815414445 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815434082 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815439684 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815440669 From aivanov at openjdk.org Thu Oct 24 17:30:41 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 24 Oct 2024 17:30:41 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <6ApqXmPZcKXKJ8E4Wd2wvLT-2CNcpN_XglBX983HrQA=.11574ea5-7949-4355-8f9f-4cd5f2101ed4@github.com> References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> <6ApqXmPZcKXKJ8E4Wd2wvLT-2CNcpN_XglBX983HrQA=.11574ea5-7949-4355-8f9f-4cd5f2101ed4@github.com> Message-ID: <8qd_9S3KCF53zPpIFtrjcD1BFljqTa4_Qu1qrhtJeFg=.453b851a-4e89-454f-98a1-4c57901accdc@github.com> On Wed, 23 Oct 2024 02:56:30 GMT, Prasanta Sadhukhan wrote: >> Agreed. This is not a "clean up / update tests" task. >> If it is a change on some lines of code that are updated by the SM changes, then that's fair game, but otherwise only the SM behaviour is part of this task. >> Anything that is not needed to be changed for that purpose, can (and mostly should) be left alone. > > I know this is not relevant to SM and would not have pointed it out had it not been modified in the PR.. > In some tests as I am going to point out below, the order is changed intentionally even though it does not have anything to do with SM, all I am asking it to restore it back in those tests (and since it will look odd to have different order in different tests, I generalize it all for all javax_swing tests in this PR which is what I reviewed) > I think we have finally decided that jtreg tag will come after copyright and before imports...Applicable for all modified javax_swing tests in this PR... Did we agree on that? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815457993 From honkar at openjdk.org Thu Oct 24 18:01:47 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 24 Oct 2024 18:01:47 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 17:16:54 GMT, Alexey Ivanov wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Merge >> - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". >> - Remove println about Security Manager. >> - Remove unused static variable NEW_PROXY_IN_PKG. >> - Remove static variable `DEFAULT_POLICY` and unused imports. >> - Remove hasSM() method and code that calls it, and remove comment about >> running test manually with SM. >> - clientlibs: import order >> - warning-string >> - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java >> - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde > > test/jdk/java/beans/XMLEncoder/ReferenceToNonStaticField.java line 29: > >> 27: * @test >> 28: * @bug 8060027 >> 29: * @run main/othervm ReferenceToNonStaticField > > Other tests in the set removed `/othervm`. Is it left intentionally? @aivanov-jdk It was missed when -Djava.security.manager=allow was removed. Out of curiosity: does it affect the performance of CI testing if tests are run in `/othervm` mode when it is not needed? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815499279 From honkar at openjdk.org Thu Oct 24 18:12:41 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 24 Oct 2024 18:12:41 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 14:55:57 GMT, Alexey Ivanov wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Merge >> - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". >> - Remove println about Security Manager. >> - Remove unused static variable NEW_PROXY_IN_PKG. >> - Remove static variable `DEFAULT_POLICY` and unused imports. >> - Remove hasSM() method and code that calls it, and remove comment about >> running test manually with SM. >> - clientlibs: import order >> - warning-string >> - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java >> - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde > > src/java.desktop/share/classes/java/awt/Desktop.java line 713: > >> 711: * {@code Info.plist}. >> 712: * >> 713: * @param printFileHandler handler > > Suggestion: > > * @param printFileHandler handler > * > > Can we add a blank line here? It's present in the methods above. > > Although there are other places below where it's missing; so not worth worrying. @seanjmullan Can you please advice on some of these src file javadoc related clean-up review comments. Do they need to be handled in this PR? Some of them seem out-of-scope for jep486 PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815510916 From cjplummer at openjdk.org Thu Oct 24 18:17:06 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 24 Oct 2024 18:17:06 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v3] In-Reply-To: References: <0_0LoiSECTe_JEfGgOTCICMw1lblyUhN0F7WSCE8GdA=.fc9c6013-657f-4eaa-9378-c1c51357e881@github.com> Message-ID: On Thu, 24 Oct 2024 12:16:22 GMT, Stefan Karlsson wrote: >> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java line 443: >> >>> 441: >>> 442: Type collectedHeap = db.lookupType("CollectedHeap"); >>> 443: CIntegerType sizeType = (CIntegerType) db.lookupType("size_t"); >> >> I think you can use getSizet() here. > > `getSizet()` seems to be a function in `Flags`, so I don't see a direct way to use it. I could probably use the `sizetType` instead of `db.lookupType("size_t")`, however when I tested the tests failed because sizetType had not been initialized yet. It looks like `sizetType` is initialized further down in the constructor. You could move that up (and the other 6 types also) or move your new code down. And speaking of the new code, it is misplaced in the try block. Both the comment for that block and the exception thrown have to do with getting the version. The `reserveForAllocationPrefetch` code just above is also misplaced for the same reason. That got added by [JDK-8004710](https://bugs.openjdk.org/browse/JDK-8004710). Perhaps some cleanup is in order here. I don't think a try/catch/throw is needed for the tlab code. There are other places in the constructor that can throw an exception, and if that happens, it should be obvious from the stack trace where it happened. That is all you need to debug the issue. I think maybe the VMVersion section was special cased since it is the most likely failure point if something is really wrong that will result in a failure of SA to startup. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21662#discussion_r1815517050 From rriggs at openjdk.org Thu Oct 24 18:30:43 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 24 Oct 2024 18:30:43 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 97 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Change apiNote to deprecated annotation on checkAccess methods. Change method dedescription to "Does nothing". > - Sanitize the class descriptions of DelegationPermission and ServicePermission > by removing text that refers to granting permissions, but avoid changes that > affect the API specification, such as the description and format of input > parameters. > - Restored methods in RMIConnection to throw SecurityExceptions again but > with adjusted text that avoids the word "permission". > - Add text to class description of MBeanServer stating that implementations > may throw SecurityException if authorization doesn't allow access to resource. > - Restore text about needing permissions from the desktop environment in the > getPixelColor and createScreenCapture methods. > - Add api note to getClassContext to use StackWalker instead and > add DROP_METHOD_INFO option to StackWalker. > - Change checkAccess() methods to be no-ops, rather than throwing > SecurityException. > - Merge > - Merge > - ... and 87 more: https://git.openjdk.org/jdk/compare/f50bd0d9...f89d9d09 src/java.base/share/classes/java/io/FilePermission.java line 71: > 69: * > 70: * @apiNote > 71: * This permission cannot be used for controlling access to resources anymore The word "anymore" is unnecessary. src/java.base/share/classes/java/io/SerializablePermission.java line 40: > 38: * > 39: * @apiNote > 40: * This permission cannot be used for controlling access to resources anymore Unnecessary "anymore" ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811333130 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1811338244 From rriggs at openjdk.org Thu Oct 24 18:37:38 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 24 Oct 2024 18:37:38 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 21:54:25 GMT, Sean Mullan wrote: >> test/jdk/java/lang/RuntimeTests/exec/ExecCommand.java line 241: >> >>> 239: Properties props = System.getProperties(); >>> 240: props.setProperty(JDK_LANG_PROCESS_ALLOW_AMBIGUOUS_COMMANDS, ""); >>> 241: System.setSecurityManager(new SecurityMan()); >> >> I assume SecurityMan should be removed too. > > Yes, and the comments that say "no SM" should be updated. @RogerRiggs can you take a look at this? Thanks. Fix to ExecCommand pushed to the sandbox. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815540092 From amenkov at openjdk.org Thu Oct 24 18:58:26 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 24 Oct 2024 18:58:26 GMT Subject: RFR: 8339289: Enhance Attach API to support arbitrary length arguments - Windows [v5] In-Reply-To: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: > The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. > More detailed explanations on the 1st comment. > > Testing: tier1,tier2,tier3,tier4,hs-tier5-svc > manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: - renamed getVersion command - typos ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20782/files - new: https://git.openjdk.org/jdk/pull/20782/files/86bd1cd2..9e6a34e0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20782&range=03-04 Stats: 9 lines in 4 files changed: 0 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/20782.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20782/head:pull/20782 PR: https://git.openjdk.org/jdk/pull/20782 From amenkov at openjdk.org Thu Oct 24 18:58:26 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 24 Oct 2024 18:58:26 GMT Subject: RFR: 8339289: Enhance Attach API to support arbitrary length arguments - Windows [v4] In-Reply-To: <8s-LyB3ap55T8sIZX7dI_xw_OUwrWEp6MpNn3rCqbJk=.50e31782-d82a-470d-9f3c-664fc32f9ed0@github.com> References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> <8s-LyB3ap55T8sIZX7dI_xw_OUwrWEp6MpNn3rCqbJk=.50e31782-d82a-470d-9f3c-664fc32f9ed0@github.com> Message-ID: On Thu, 24 Oct 2024 12:37:24 GMT, Kevin Walls wrote: >> Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: >> >> - updated comment >> - feedback > > src/hotspot/share/services/attachListener.cpp line 406: > >> 404: { "printflag", print_flag }, >> 405: { "jcmd", jcmd }, >> 406: { "getVersion", get_version }, > > It's a bit of a nit, but "dumpheap" and other existing commands never use caps but the new "getVersion" does? We have "agentProperties" command, but this is the only exception. Renamed to "getversion". > src/hotspot/share/services/attachListener.hpp line 65: > >> 63: /* >> 64: Version 1 (since jdk6): attach operations always have 3 (AttachOparation::arg_count_max) >> 65: arguments, each up to 1024 (AttachOparation::arg_length_max) symbols. > > "AttachOparation" typo and also "symbols" is clarified to mean characters in a review comment, so should probably change that here and also in attachListener.cpp 626, 627. > CompatTest.java says "1024 symbols" Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1815562279 PR Review Comment: https://git.openjdk.org/jdk/pull/20782#discussion_r1815560165 From mli at openjdk.org Thu Oct 24 19:01:36 2024 From: mli at openjdk.org (Hamlin Li) Date: Thu, 24 Oct 2024 19:01:36 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v51] In-Reply-To: References: Message-ID: <6cP6tvH2d8TU7TEuAxZoAtXFHg2jhtLEpOogKSCIeDE=.d2c3cce9-bb23-48c8-8829-8edd14249842@github.com> On Thu, 24 Oct 2024 14:05:40 GMT, Roman Kennke wrote: >> This is the main body of the JEP 450: Compact Object Headers (Experimental). >> >> It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. >> >> Main changes: >> - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. >> - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. >> - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). >> - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). >> - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). >> - Arrays will now store their length at offset 8. >> - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _co... > > Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: > > Conditionalize platform specific parts of CompressedClassPointersEncodingScheme test test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java line 107: > 105: // the encoding range. We expect the encoding Base to start at the class space start - but to enforce that, > 106: // we choose a high address. > 107: if (Platform.isAArch64() || Platform.isX64()) { @rkennke please also enable riscv for this test `CompressedClassPointersEncodingScheme.java`, it passed in my environment. Thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1815565554 From coleenp at openjdk.org Thu Oct 24 19:03:15 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Thu, 24 Oct 2024 19:03:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v6] In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 17:26:15 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with three additional commits since the last revision: > > - Rename timedWaitNonce to timedWaitSeqNo > - Fix comment in Thread.java > - Clear oops when thawing lockstack + add thaw_lockstack() Round 2. There are a lot of very helpful comments in the new code to explain what it's doing but I have some requests for some more. And some questions. ------------- PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2390813935 From coleenp at openjdk.org Thu Oct 24 19:03:20 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Thu, 24 Oct 2024 19:03:20 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 03:38:21 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: > > - Fix comment in objectMonitor.hpp and javaThread.hpp > - Skip printing tid when not available src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 135: > 133: assert(*f.addr_at(frame::interpreter_frame_last_sp_offset) == 0, "should be null for top frame"); > 134: intptr_t* lspp = f.addr_at(frame::interpreter_frame_last_sp_offset); > 135: *lspp = f.unextended_sp() - f.fp(); Can you write a comment what this is doing briefly and why? src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp line 1550: > 1548: #endif /* ASSERT */ > 1549: > 1550: push_cont_fastpath(); One of the callers of this gives a clue what it does. __ push_cont_fastpath(); // Set JavaThread::_cont_fastpath to the sp of the oldest interpreted frame we know about Why do you do this here? Oh please more comments... src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp line 2032: > 2030: // Force freeze slow path in case we try to preempt. We will pin the > 2031: // vthread to the carrier (see FreezeBase::recurse_freeze_native_frame()). > 2032: __ push_cont_fastpath(); We need to do this because we might freeze, so JavaThread::_cont_fastpath should be set in case we do? src/hotspot/share/runtime/continuation.cpp line 89: > 87: // we would incorrectly throw it during the unmount logic in the carrier. > 88: if (_target->has_async_exception_condition()) { > 89: _failed = false; This says "Don't" but then failed is false which doesn't make sense. Should it be true? src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1275: > 1273: > 1274: if (caller.is_interpreted_frame()) { > 1275: _total_align_size += frame::align_wiggle; Please put a comment here about frame align-wiggle. src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1278: > 1276: } > 1277: > 1278: patch(f, hf, caller, false /*is_bottom_frame*/); I also forgot what patch does. Can you add a comment here too? src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1552: > 1550: assert(!cont.is_empty(), ""); > 1551: // This is done for the sake of the enterSpecial frame > 1552: StackWatermarkSet::after_unwind(thread); Is there a new place for this StackWatermark code? src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1657: > 1655: } > 1656: > 1657: template This function is kind of big, do we really want it duplicated to pass preempt as a template parameter? src/hotspot/share/runtime/objectMonitor.cpp line 876: > 874: // and in doing so avoid some transitions ... > 875: > 876: // For virtual threads that are pinned do a timed-park instead, to I had trouble parsing this first sentence. I think it needs a comma after pinned and remove the comma after instead. src/hotspot/share/runtime/objectMonitor.cpp line 2305: > 2303: } > 2304: > 2305: void ObjectMonitor::Initialize2() { Can you put a comment why there's a second initialize function? Presumably after some state is set. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1813899129 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814081166 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814084085 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814905064 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815015410 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815016232 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815245735 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815036910 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815445109 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815479877 From stefank at openjdk.org Thu Oct 24 19:09:42 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 19:09:42 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v4] In-Reply-To: References: Message-ID: > When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. > > The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". > > When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: > > > "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) > - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) > - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) > - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) > - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) > - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) > - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) > - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) > - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) > > Locked ownable synchronizers: > - None > > > It should be saying: > > Locked ownable synchronizers: > - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) > > > The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. > > I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. > > This is a reproducer of the problem: > > make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" > > > I've tested this by running all 'serviceability' tests in our tier1-9 testing. Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision: Cleanups ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21662/files - new: https://git.openjdk.org/jdk/pull/21662/files/3f50944e..adc7d755 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21662&range=02-03 Stats: 41 lines in 1 file changed: 17 ins; 18 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/21662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21662/head:pull/21662 PR: https://git.openjdk.org/jdk/pull/21662 From stefank at openjdk.org Thu Oct 24 19:09:42 2024 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 24 Oct 2024 19:09:42 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v4] In-Reply-To: References: <0_0LoiSECTe_JEfGgOTCICMw1lblyUhN0F7WSCE8GdA=.fc9c6013-657f-4eaa-9378-c1c51357e881@github.com> Message-ID: On Thu, 24 Oct 2024 18:14:25 GMT, Chris Plummer wrote: >> `getSizet()` seems to be a function in `Flags`, so I don't see a direct way to use it. I could probably use the `sizetType` instead of `db.lookupType("size_t")`, however when I tested the tests failed because sizetType had not been initialized yet. > > It looks like `sizetType` is initialized further down in the constructor. You could move that up (and the other 6 types also) or move your new code down. And speaking of the new code, it is misplaced in the try block. Both the comment for that block and the exception thrown have to do with getting the version. The `reserveForAllocationPrefetch` code just above is also misplaced for the same reason. That got added by [JDK-8004710](https://bugs.openjdk.org/browse/JDK-8004710). Perhaps some cleanup is in order here. I don't think a try/catch/throw is needed for the tlab code. There are other places in the constructor that can throw an exception, and if that happens, it should be obvious from the stack trace where it happened. That is all you need to debug the issue. I think maybe the VMVersion section was special cased since it is the most likely failure point if something is really wrong that will result in a failure of SA to startup. OK. I did some cleanups. Could you take a look and see if this is good enough to get this integrated? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21662#discussion_r1815573383 From rriggs at openjdk.org Thu Oct 24 19:23:41 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 24 Oct 2024 19:23:41 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 13:19:55 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Merge > - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". > - Remove println about Security Manager. > - Remove unused static variable NEW_PROXY_IN_PKG. > - Remove static variable `DEFAULT_POLICY` and unused imports. > - Remove hasSM() method and code that calls it, and remove comment about > running test manually with SM. > - clientlibs: import order > - warning-string > - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java > - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde Reviewed java.io... changes in classes and tests. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21498#issuecomment-2436170029 From darcy at openjdk.org Thu Oct 24 19:36:05 2024 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 24 Oct 2024 19:36:05 GMT Subject: RFR: 8342827: Fix order of @param tags in other modules [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 12:17:41 GMT, Hannes Walln?fer wrote: >> Please review a doc-only change to fix the order of javadoc @param tags in in various OpenJDK modules. This is the third and last PR to fix the order of @param tags in OpenJDK libraries. >> >> We are working on a javadoc feature to add an opt-in doclint warning for @param tags that don't match the order of parameters in the documented element. The warning will be enabled in OpenJDK builds and covers all uses of the @param tag, i.e. parameters of executable elements, type parameters, and record components. >> >> I compared the generated API docs built with this branch with API docs built from master branch to make sure they are identical. > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Fix copyright header Changes in java.compiler look fine. ------------- Marked as reviewed by darcy (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21637#pullrequestreview-2393555695 From rriggs at openjdk.org Thu Oct 24 19:43:40 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 24 Oct 2024 19:43:40 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 13:19:55 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the main changes in the JEP and also includes an apidiff of the specification changes. >> >> NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove `@throws SecurityException`. The remaining changes are primarily the removal of the `SecurityManager`, `Policy`, `AccessController` and other Security Manager API implementations. There is very little new code. >> >> The code changes can be broken down into roughly the following categories: >> >> 1. Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default. >> 2. Changing hundreds of methods and constructors to no longer throw a `SecurityException` if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. >> 3. Changing the `java` command to exit with a fatal error if a Security Manager is enabled. >> 4. Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see [JDK-8341916](https://bugs.openjdk.org/browse/JDK-8341916). >> 5. Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified. >> >> There are a handful of Security Manager related tests that are failing and are at the end of the `test/jdk/ProblemList.txt`, `test/langtools/ProblemList.txt` and `test/hotspot/jtreg/ProblemList.txt` files - these will be removed or separate bugs will be filed before integrating this PR. >> >> Inside the JDK, we have retained calls to `SecurityManager::getSecurityManager` and `AccessController::doPrivileged` for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc). >> >> I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, ... > > Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: > > - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 > - Merge > - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". > - Remove println about Security Manager. > - Remove unused static variable NEW_PROXY_IN_PKG. > - Remove static variable `DEFAULT_POLICY` and unused imports. > - Remove hasSM() method and code that calls it, and remove comment about > running test manually with SM. > - clientlibs: import order > - warning-string > - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java > - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde Reviewed rmi classes and tests Reviewed ProcessBuilder, ProcessHandler, and Runtime.exec classes and tests src/java.rmi/share/classes/sun/rmi/server/LoaderHandler.java line 342: > 340: /* > 341: * There is no security manager, so disable access to RMI class > 342: * loaders and use the would-de parent instead. Fix typo "would-de" -> "would-be". ------------- PR Review: https://git.openjdk.org/jdk/pull/21498#pullrequestreview-2393555484 PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815601635 From cjplummer at openjdk.org Thu Oct 24 20:11:05 2024 From: cjplummer at openjdk.org (Chris Plummer) Date: Thu, 24 Oct 2024 20:11:05 GMT Subject: RFR: 8342857: SA: Heap iterator makes incorrect assumptions about TLAB layout [v4] In-Reply-To: References: Message-ID: <_0uHT4bd7SU4eAejzvRxbm-irb0pEHleXHvzrxjsXdU=.74cd0b40-e811-418e-b1c1-e32cc13a68e1@github.com> On Thu, 24 Oct 2024 19:09:42 GMT, Stefan Karlsson wrote: >> When testing Lilliput we found a failure in `serviceability/sa/ClhsdbJstackWithConcurrentLock.java` test when running with C1-only. >> >> The test uses the SA's thread printing feature to print the threads *and* the "concurrent locks" / AbstractOwnableSynchronizers. It then verifies that the expected lock is listed in the section for "Locked ownable synchronizers". >> >> When we turned on Lilliput's -XX:+UseCompactObjectHeaders this stopped working, and we got nothing reported in that section: >> >> >> "Thread-0" #31 prio=5 tid=0x00007a708c259ad0 nid=1480533 waiting on condition [0x00007a706fefe000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> - java.lang.Thread.sleepNanos0(long) @bci=0 (Interpreted frame) >> - java.lang.Thread.sleepNanos(long) @bci=33, line=497 (Interpreted frame) >> - java.lang.Thread.sleep(long) @bci=25, line=528 (Interpreted frame) >> - LingeredAppWithConcurrentLock.lockMethod(java.util.concurrent.locks.Lock) @bci=13, line=38 (Interpreted frame) >> - locked <0x00000000ffd32d88> (a java.util.concurrent.locks.ReentrantLock) >> - LingeredAppWithConcurrentLock.lambda$main$0() @bci=3, line=46 (Interpreted frame) >> - LingeredAppWithConcurrentLock$$Lambda+0x00007a7023001000.run() @bci=0 (Interpreted frame) >> - java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) @bci=5, line=1589 (Interpreted frame) >> - java.lang.Thread.run() @bci=19, line=1576 (Interpreted frame) >> >> Locked ownable synchronizers: >> - None >> >> >> It should be saying: >> >> Locked ownable synchronizers: >> - <0x00000000ffd32d88>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync) >> >> >> The problem lies within the code that searches for objects in the heap. It collects a bunch of regions and searches them for objects. However, the code that describes the TLAB regions are stale and doesn't match the C++ implementation in the JVM. When Lilliput shrinks the headers the SA code is broken enough to cause the TLAB regions to be reported as overlapping. This has ripple effects that the object iterators stop working. >> >> I can get this test to pass, with and without compact object headers, by fixing the code in `ThreadLocalAllocBuffer::hard_end()`. >> >> This is a reproducer of the problem: >> >> make -C ../build/fastdebug test TEST=serviceability/sa/ClhsdbJstackWithConcurrentLock.java JTREG="JAVA_OPTIONS=-XX:TieredStopAtLevel=2 -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders" >> >> >> I've test... > > Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision: > > Cleanups Looks good. Please update the SA copyrights before integrating. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21662#pullrequestreview-2393613327 From aivanov at openjdk.org Thu Oct 24 20:26:44 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 24 Oct 2024 20:26:44 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 17:58:55 GMT, Harshitha Onkar wrote: > It was missed when `-Djava.security.manager=allow` was removed. It wasn't intentional then, was it? > Out of curiosity: does it have any impact on the performance of CI testing if tests are run in /othervm mode when it is not needed? I guess it does, `othervm` tests launch a new VM for each test as opposed to re-using an already running VM. Anyway, removing `/othervm` isn't strictly required because `java/beans` are run in `othervm` mode. https://github.com/openjdk/jdk/blob/d1540e2a49c7a41eb771fc9896c367187d070dec/test/jdk/TEST.ROOT#L48-L49 It caught my attention because `/othervm` is removed from tests in `beans/XMLEncoder/*/`, that is in subfolders, whereas in the `beans/XMLEncoder/` folder these are left. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815652996 From aivanov at openjdk.org Thu Oct 24 20:30:39 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 24 Oct 2024 20:30:39 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 18:09:04 GMT, Harshitha Onkar wrote: >> src/java.desktop/share/classes/java/awt/Desktop.java line 713: >> >>> 711: * {@code Info.plist}. >>> 712: * >>> 713: * @param printFileHandler handler >> >> Suggestion: >> >> * @param printFileHandler handler >> * >> >> ~~Can we add a blank line here? It's present in the methods above.~~ >> >> Although there are other places below where it's missing; _so not worth worrying_. > > @seanjmullan Can you please advice on some of the following src file javadoc related review comments. Do they need to be handled in this PR? Some of them seem out-of-scope for jep486 PR. @honkar-jdk I'm inclined to leave it as because it's not the only method which doesn't have a blank line between `@param` and `@throw` in this file. If it's worth taking care of, we may submit another bug to address it later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815657461 From mullan at openjdk.org Thu Oct 24 21:00:39 2024 From: mullan at openjdk.org (Sean Mullan) Date: Thu, 24 Oct 2024 21:00:39 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 20:27:33 GMT, Alexey Ivanov wrote: >> @seanjmullan Can you please advice on some of the following src file javadoc related review comments. Do they need to be handled in this PR? Some of them seem out-of-scope for jep486 PR. > > @honkar-jdk I'm inclined to leave it as because it's not the only method which doesn't have a blank line between `@param` and `@throw` in this file. > > If it's worth taking care of, we may submit another bug to address it later. This does not need to be handled in this PR. In the majority of changes, we have really tried hard to avoid making unrelated changes, but sometimes a few snuck in, like moving package imports or perhaps fixing a typo here and there that was not specific to JEP 486. My opinion is that unless it is something that _really_ should be done as part of a more general technical debt or code cleanup exercise, then it is ok to let a few of these in and they don't have to be reverted. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815686941 From rkennke at openjdk.org Thu Oct 24 21:04:51 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 24 Oct 2024 21:04:51 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v53] In-Reply-To: References: Message-ID: > This is the main body of the JEP 450: Compact Object Headers (Experimental). > > It is also a follow-up to #20640, which now also includes (and supersedes) #20603 and #20605, plus the Tiny Class-Pointers parts that have been previously missing. > > Main changes: > - Introduction of the (experimental) flag UseCompactObjectHeaders. All changes in this PR are protected by this flag. The purpose of the flag is to provide a fallback, in case that users unexpectedly observe problems with the new implementation. The intention is that this flag will remain experimental and opt-in for at least one release, then make it on-by-default and diagnostic (?), and eventually deprecate and obsolete it. However, there are a few unknowns in that plan, specifically, we may want to further improve compact headers to 4 bytes, we are planning to enhance the Klass* encoding to support virtually unlimited number of Klasses, at which point we could also obsolete UseCompressedClassPointers. > - The compressed Klass* can now be stored in the mark-word of objects. In order to be able to do this, we are add some changes to GC forwarding (see below) to protect the relevant (upper 22) bits of the mark-word. Significant parts of this PR deal with loading the compressed Klass* from the mark-word. This PR also changes some code paths (mostly in GCs) to be more careful when accessing Klass* (or mark-word or size) to be able to fetch it from the forwardee in case the object is forwarded. > - Self-forwarding in GCs (which is used to deal with promotion failure) now uses a bit to indicate 'self-forwarding'. This is needed to preserve the crucial Klass* bits in the header. This also allows to get rid of preserved-header machinery in SerialGC and G1 (Parallel GC abuses preserved-marks to also find all other relevant oops). > - Full GC forwarding now uses an encoding similar to compressed-oops. We have 40 bits for that, and can encode up to 8TB of heap. When exceeding 8TB, we turn off UseCompressedClassPointers (except in ZGC, which doesn't use the GC forwarding at all). > - Instances can now have their base-offset (the offset where the field layouter starts to place fields) at offset 8 (instead of 12 or 16). > - Arrays will now store their length at offset 8. > - CDS can now write and read archives with the compressed header. However, it is not possible to read an archive that has been written with an opposite setting of UseCompactObjectHeaders. Some build machinery is added so that _coh variants of CDS archiv... Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: Enable riscv in CompressedClassPointersEncodingScheme test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20677/files - new: https://git.openjdk.org/jdk/pull/20677/files/c2f6d202..434c6817 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=52 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20677&range=51-52 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20677.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20677/head:pull/20677 PR: https://git.openjdk.org/jdk/pull/20677 From rkennke at openjdk.org Thu Oct 24 21:04:51 2024 From: rkennke at openjdk.org (Roman Kennke) Date: Thu, 24 Oct 2024 21:04:51 GMT Subject: RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v51] In-Reply-To: <6cP6tvH2d8TU7TEuAxZoAtXFHg2jhtLEpOogKSCIeDE=.d2c3cce9-bb23-48c8-8829-8edd14249842@github.com> References: <6cP6tvH2d8TU7TEuAxZoAtXFHg2jhtLEpOogKSCIeDE=.d2c3cce9-bb23-48c8-8829-8edd14249842@github.com> Message-ID: On Thu, 24 Oct 2024 18:58:03 GMT, Hamlin Li wrote: >> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision: >> >> Conditionalize platform specific parts of CompressedClassPointersEncodingScheme test > > test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java line 107: > >> 105: // the encoding range. We expect the encoding Base to start at the class space start - but to enforce that, >> 106: // we choose a high address. >> 107: if (Platform.isAArch64() || Platform.isX64()) { > > @rkennke please also enable riscv for this test `CompressedClassPointersEncodingScheme.java`, it passed in my environment. Thanks! Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1815690759 From pchilanomate at openjdk.org Thu Oct 24 21:08:26 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:08:26 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 02:41:43 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv > > src/java.base/share/classes/java/lang/Thread.java line 654: > >> 652: * {@link Thread#PRIMORDIAL_TID} +1 as this class cannot be used during >> 653: * early startup to generate the identifier for the primordial thread. The >> 654: * counter is off-heap and shared with the VM to allow it assign thread > > Suggestion: > > * counter is off-heap and shared with the VM to allow it to assign thread Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815693906 From pchilanomate at openjdk.org Thu Oct 24 21:08:26 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:08:26 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v9] In-Reply-To: References: Message-ID: <2HnGc3Do9UW-D2HG9lJXL6_V5XRX56-21c78trR7uaI=.7b59a42e-5001-40f5-ae32-d4d70d23b021@github.com> > This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. > > In order to make the code review easier the changes have been split into the following initial 4 commits: > > - Changes to allow unmounting a virtual thread that is currently holding monitors. > - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. > - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. > - Changes to tests, JFR pinned event, and other changes in the JDK libraries. > > The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. > > The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. > > > ## Summary of changes > > ### Unmount virtual thread while holding monitors > > As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: > > - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. > > - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. > > #### General notes about this part: > > - Since virtual threads don't need to worry about holding monitors anymo... Patricio Chilano Mateo has updated the pull request incrementally with four additional commits since the last revision: - Rename set/has_owner_anonymous to set/has_anonymous_owner - Fix comments in javaThread.hpp and Thread.java - Rename nonce/nounce to seqNo in VirtualThread class - Remove ObjectMonitor::set_owner_from_BasicLock() ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21565/files - new: https://git.openjdk.org/jdk/pull/21565/files/03ba6dfb..c7a82c45 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21565&range=07-08 Stats: 66 lines in 10 files changed: 2 ins; 37 del; 27 mod Patch: https://git.openjdk.org/jdk/pull/21565.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21565/head:pull/21565 PR: https://git.openjdk.org/jdk/pull/21565 From honkar at openjdk.org Thu Oct 24 21:10:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 24 Oct 2024 21:10:36 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 20:23:26 GMT, Alexey Ivanov wrote: >> @aivanov-jdk >> It was missed when -Djava.security.manager=allow was removed. >> Out of curiosity: does it have any impact on the performance of CI testing if tests are run in `/othervm` mode when it is not needed? > >> It was missed when `-Djava.security.manager=allow` was removed. > > It wasn't intentional then, was it? > >> Out of curiosity: does it have any impact on the performance of CI testing if tests are run in /othervm mode when it is not needed? > > I guess it does, `othervm` tests launch a new VM for each test as opposed to re-using an already running VM. > > Anyway, removing `/othervm` isn't strictly required because `java/beans` are run in `othervm` mode. > > https://github.com/openjdk/jdk/blob/d1540e2a49c7a41eb771fc9896c367187d070dec/test/jdk/TEST.ROOT#L48-L49 > > It caught my attention because `/othervm` is removed from tests in `beans/XMLEncoder/*/`, that is in subfolders, whereas in the `beans/XMLEncoder/` folder these are left. @aivanov-jdk Right, it wasn't intentionally but missed when removing `-Djava.security.manager=allow`. > Anyway, removing /othervm isn't strictly required because java/beans are run in othervm mode. Thank you for clarifying. Since `/othervm` doesn't impact the beans tests I'll keep it as-is. Let me know if you still think it is good to remove, I can probably do a replace-all on beans/XMLEncoder/ folder. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815694898 From pchilanomate at openjdk.org Thu Oct 24 21:17:14 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:17:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v5] In-Reply-To: References: <55lsLMTORxq8uq0DdIEwRvJauCIyfo9YWwLJpwwBejs=.4680c600-fe2d-4d2d-b3a9-bef80a6eec43@github.com> Message-ID: On Thu, 24 Oct 2024 06:18:10 GMT, David Holmes wrote: >> So the value stored in _owner has to be ANONYMOUS_OWNER. We cannot store the BasicLock* in there as before since it can clash with some other thread's tid. We store it in the new field _stack_locker instead. > > Right I understand we can't store the BasicLock* directly in owner, but the naming of this method has me confused as to what it actually does. With the old version we have: > > Before: owner = BasicLock* belonging to current > After: owner = JavaThread* of current > > with the new version we have: > > Before: owner = ANONYMOUS_OWNER > After: owner = tid of current > > so "BasicLock" doesn't mean anything here any more. Isn't this just `set_owner_from_anonymous` ? I see your point. I removed this method and had the only caller just call set_owner_from_anonymous() and set_stack_locker(nullptr). There was one other caller in ObjectMonitor::complete_exit() but it was actually not needed so I removed it. ObjectMonitor::complete_exit() is only called today on JavaThread exit to possibly unlock monitors acquired through JNI that where not unlocked. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815697784 From pchilanomate at openjdk.org Thu Oct 24 21:17:14 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:17:14 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 05:10:56 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: >> >> - Fix comment in objectMonitor.hpp and javaThread.hpp >> - Skip printing tid when not available > > src/hotspot/share/runtime/javaThread.hpp line 166: > >> 164: // current _vthread object, except during creation of the primordial and JNI >> 165: // attached thread cases where this field can have a temporary value. Also, >> 166: // calls to VirtualThread.switchToCarrierThread will temporary change _vthread > > s/temporary change/temporarily change/ Fixed. > src/java.base/share/classes/java/lang/Object.java line 383: > >> 381: try { >> 382: wait0(timeoutMillis); >> 383: } catch (InterruptedException e) { > > I had expected to see a call to a new `wait0` method that returned a value indicating whether the wait was completed or else we had to park. Instead we had to put special logic in the native-call-wrapper code in the VM to detect returning from wait0 and changing the return address. I'm still unclear where that modified return address actually takes us. We jump to `StubRoutines::cont_preempt_stub()`. We need to remove all the frames that were just copied to the heap from the physical stack, and then return to the calling method which will be `Continuation.run`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815700441 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815701043 From pchilanomate at openjdk.org Thu Oct 24 21:17:15 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:17:15 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v8] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 08:08:56 GMT, Stefan Karlsson wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision: >> >> - Fix comment in objectMonitor.hpp and javaThread.hpp >> - Skip printing tid when not available > > src/hotspot/share/runtime/objectMonitor.hpp line 325: > >> 323: } >> 324: >> 325: bool has_owner_anonymous() const { return owner_raw() == ANONYMOUS_OWNER; } > > Small, drive-by comment. The rename to `has_owner_anonymous` sounds worse than the previous `is_owner_anonymous` name. I think the code reads better if you change it to `has_anonymous_owner`. I renamed both `set/has_owner_anonymous` to `set/has_anonymous_owner`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815701746 From pchilanomate at openjdk.org Thu Oct 24 21:17:18 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:17:18 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v7] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 02:57:18 GMT, David Holmes wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv > > src/java.base/share/classes/java/lang/VirtualThread.java line 631: > >> 629: // Object.wait >> 630: if (s == WAITING || s == TIMED_WAITING) { >> 631: byte nonce; > > Suggestion: > > byte seqNo; Changed to seqNo. > src/java.base/share/classes/java/lang/VirtualThread.java line 948: > >> 946: * This method does nothing if the thread has been woken by notify or interrupt. >> 947: */ >> 948: private void waitTimeoutExpired(byte nounce) { > > I assume you meant `nonce` here, but please change to `seqNo`. Changed. > src/java.base/share/classes/java/lang/VirtualThread.java line 1397: > >> 1395: >> 1396: /** >> 1397: * Returns a lock object to coordinating timed-wait setup and timeout handling. > > Suggestion: > > * Returns a lock object for coordinating timed-wait setup and timeout handling. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815699934 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815700133 PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815700312 From pchilanomate at openjdk.org Thu Oct 24 21:17:16 2024 From: pchilanomate at openjdk.org (Patricio Chilano Mateo) Date: Thu, 24 Oct 2024 21:17:16 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: <6IyizKWQ3ev2YfWJiyVhEsENxlHJ3fsY-cPGXNCyI2g=.1eac6280-7fbf-43c4-84b4-8f234efd74a1@github.com> References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> <6IyizKWQ3ev2YfWJiyVhEsENxlHJ3fsY-cPGXNCyI2g=.1eac6280-7fbf-43c4-84b4-8f234efd74a1@github.com> Message-ID: On Thu, 24 Oct 2024 02:55:18 GMT, David Holmes wrote: >>> Also JavaThread::_lock_id in the VM means "the java.lang.Thread thread-id to use for locking" - correct? >>> >> Yes. > > I guess I don't understand where this piece code fits in the overall transition of the virtual thread to being parked. I would have expected the LockStack to already have been moved by the time we switch identities to the carrier thread. We don't unmount the virtual thread here, we just temporarily change the thread identity. You could think of this method as switchIdentityToCarrierThread if that helps. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815697084 From kevinw at openjdk.org Thu Oct 24 21:32:05 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Thu, 24 Oct 2024 21:32:05 GMT Subject: RFR: 8339289: Enhance Attach API to support arbitrary length arguments - Windows [v5] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Thu, 24 Oct 2024 18:58:26 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - renamed getVersion command > - typos Marked as reviewed by kevinw (Reviewer). Thanks for updating, looks good. I think it's clearer now that this is not just a Windows-specific fix, but will be an enhancement for all platforms in the long term. Likely argument length is more of a limitation than number of arguments. Looking back at JDK-8215622: Add dump to file support for jmap ?histo ..and that was extending the "inspectheap" attach command, but it should have been using a DiagnosticCommand invoked by jcmd. We may not say it clearly, but the attach api commands are a few basic fundamentals, and most of what we want to implement should be implemented in a DiagnosticCommand. ------------- PR Review: https://git.openjdk.org/jdk/pull/20782#pullrequestreview-2393738967 PR Comment: https://git.openjdk.org/jdk/pull/20782#issuecomment-2436370162 From ihse at openjdk.org Thu Oct 24 22:15:08 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 24 Oct 2024 22:15:08 GMT Subject: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage [v2] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 14:22:28 GMT, Julian Waters wrote: >> After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did > > Julian Waters has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > 8342682 All the original labels are still there. A better approach had probably been to close the PR and open a new. You either need to do that now, or delete all the irrelevant labels. (I can't be bothered to figure out; at least build is wrong.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21616#issuecomment-2436431780 From dholmes at openjdk.org Thu Oct 24 22:16:12 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 22:16:12 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: <77_fMY08zucHFP6Zo0sbJabtL1hdYdRVTsp_vkcSSow=.073a2157-37e9-40fb-aee3-c15858649c34@github.com> References: <77_fMY08zucHFP6Zo0sbJabtL1hdYdRVTsp_vkcSSow=.073a2157-37e9-40fb-aee3-c15858649c34@github.com> Message-ID: On Thu, 24 Oct 2024 08:26:12 GMT, Alan Bateman wrote: >> So really UNBLOCKED is UNBLOCKING and mirrors BLOCKING , so we have: >> >> RUNNING -> BLOCKING -> BLOCKED >> BLOCKED -> UNBLOCKING -> RUNNABLE >> >> I'm just trying to get a better sense of what we can infer if we see these "transition" states. > > We named it UNBLOCKED when unblocked, like UNPARKED when unparked, as that accurately describes the state at this point. It's not mounted but may be scheduled to continue. In the user facing APIs this is mapped to "RUNNABLE", it's the equivalent of OS thread queued to the OS scheduler. So I think the name is good and would prefer not change it. Okay but I'm finding it hard to see these names and easily interpret what some of them mean. I think there is a difference between UNBLOCKED and UNPARKED, because as an API once you are unparked that is it - operation over. But for UNBLOCKED you are still in a transitional state and it is not yet determined what you will actually end up doing i.e. get the monitor or block again. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815761305 From dholmes at openjdk.org Thu Oct 24 22:16:13 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Oct 2024 22:16:13 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v3] In-Reply-To: References: <5hc5EDb2Ex9xAGP2okFeNkGQbW_qjU1UKEg-zbXAtd0=.30f20bbf-f4c5-417b-888c-e15492a9a6d4@github.com> <6IyizKWQ3ev2YfWJiyVhEsENxlHJ3fsY-cPGXNCyI2g=.1eac6280-7fbf-43c4-84b4-8f234efd74a1@github.com> Message-ID: On Thu, 24 Oct 2024 21:08:47 GMT, Patricio Chilano Mateo wrote: >> I guess I don't understand where this piece code fits in the overall transition of the virtual thread to being parked. I would have expected the LockStack to already have been moved by the time we switch identities to the carrier thread. > > We don't unmount the virtual thread here, we just temporarily change the thread identity. You could think of this method as switchIdentityToCarrierThread if that helps. Sorry to belabour this but why are we temporarily changing the thread identity? What is the bigger operation that in underway here? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1815762233 From honkar at openjdk.org Thu Oct 24 22:27:40 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 24 Oct 2024 22:27:40 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 16:35:44 GMT, Alexey Ivanov wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Merge >> - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". >> - Remove println about Security Manager. >> - Remove unused static variable NEW_PROXY_IN_PKG. >> - Remove static variable `DEFAULT_POLICY` and unused imports. >> - Remove hasSM() method and code that calls it, and remove comment about >> running test manually with SM. >> - clientlibs: import order >> - warning-string >> - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java >> - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde > > test/jdk/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java line 28: > >> 26: @key headful >> 27: @bug 6785058 >> 28: @summary Tests that an owner is activated on closing its owned dialog with the warning icon. > > Does this test remain relevant without the security manager? Without the security manager, there will be no dialogs with the warning icon. Looks like the test was created for SM specific issue - [JDK-6785058](https://bugs.openjdk.org/browse/JDK-6785058). I have deleted the test here https://github.com/openjdk/jdk-sandbox/commit/de0a0f67ef207e1d217c42c312a4378f9f7fa833 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815770344 From honkar at openjdk.org Thu Oct 24 22:31:41 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 24 Oct 2024 22:31:41 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 16:11:18 GMT, Alexey Ivanov wrote: >> Sean Mullan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 150 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Merge >> - Update @summary to replace "if the right permission is granted" can be replaced with "package java.lang is open to unnamed module". >> - Remove println about Security Manager. >> - Remove unused static variable NEW_PROXY_IN_PKG. >> - Remove static variable `DEFAULT_POLICY` and unused imports. >> - Remove hasSM() method and code that calls it, and remove comment about >> running test manually with SM. >> - clientlibs: import order >> - warning-string >> - java/net/httpclient/websocket/security/WSURLPermissionTest.java: integrated review feedback in renamed WSSanityTest.java >> - ... and 140 more: https://git.openjdk.org/jdk/compare/f7a61fce...cb50dfde > > src/java.desktop/share/classes/javax/swing/JTable.java line 6343: > >> 6341: * GraphicsEnvironment.isHeadless >> 6342: * returns true >> 6343: * method disallows this thread from creating a print job request > > Suggestion: > > > One more line to remove here. Relevant (w.r.t jep486) javadocs changes have been updated here: https://github.com/openjdk/jdk-sandbox/commit/b78a7b6a2e5f96a98c81c68a8d9db3745e4efc3b ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815773023 From amenkov at openjdk.org Thu Oct 24 23:05:07 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 24 Oct 2024 23:05:07 GMT Subject: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v11] In-Reply-To: References: Message-ID: On Thu, 24 Oct 2024 14:52:27 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - Mach5 tiers 1-6 are passed > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: removed asserts from continuationFreezeThaw.cpp again src/hotspot/share/prims/jvmtiEnvBase.cpp line 667: > 665: > 666: javaVFrame* > 667: JvmtiEnvBase::check_and_skip_hidden_frames(bool is_in_VTMS_transition, javaVFrame* jvf) { reworked function looks much better! Now it's clear what the function does and I have a question what it should do. The function checks `@JvmtiMountTransition` annotation first even if the thread is in transition. If `@JvmtiMountTransition` is present, the code doesn't care about `@ChangesCurrentThread` (and doesn't case about `@JvmtiMountTransition` if in_transition + `@ChangesCurrentThread`). But we have 2 methods in VirtualThread class (`switchToCarrierThread()` and `switchToVirtualThread()`) with both annotations. So if the function is called when `switchToCarrierThread` is on top, the function skips this frame, but if the thread calls some other function without `@JvmtiMountTransition` annotation from `switchToCarrierThread`, the function returns `switchToCarrierThread`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1815790409 From amenkov at openjdk.org Thu Oct 24 23:12:11 2024 From: amenkov at openjdk.org (Alex Menkov) Date: Thu, 24 Oct 2024 23:12:11 GMT Subject: RFR: 8339289: Enhance Attach API to support arbitrary length arguments - Windows [v5] In-Reply-To: References: <9PRn9DGh4QQNdVZgnWUtyoEeajE93Gu8q7G4ucIXN9A=.7c6abdd5-f690-49f1-882b-f08843245db5@github.com> Message-ID: On Thu, 24 Oct 2024 18:58:26 GMT, Alex Menkov wrote: >> The fix improves Attch API protocol and implements updated protocol on windows; shared code is ready to implement updated protocol support on other platforms. >> More detailed explanations on the 1st comment. >> >> Testing: tier1,tier2,tier3,tier4,hs-tier5-svc >> manually tested backward compatibility (old tools can attach to current VMs, current tools can attach to older VMs) on Windows with jdk21u and jdk8u. > > Alex Menkov has updated the pull request incrementally with two additional commits since the last revision: > > - renamed getVersion command > - typos Thank you for review Serguei and Kevin I'm going to rebase the change and run sanity tests before integration ------------- PR Comment: https://git.openjdk.org/jdk/pull/20782#issuecomment-2436493835 From dholmes at openjdk.org Fri Oct 25 00:14:13 2024 From: dholmes at openjdk.org (David Holmes) Date: Fri, 25 Oct 2024 00:14:13 GMT Subject: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v9] In-Reply-To: <2HnGc3Do9UW-D2HG9lJXL6_V5XRX56-21c78trR7uaI=.7b59a42e-5001-40f5-ae32-d4d70d23b021@github.com> References: <2HnGc3Do9UW-D2HG9lJXL6_V5XRX56-21c78trR7uaI=.7b59a42e-5001-40f5-ae32-d4d70d23b021@github.com> Message-ID: On Thu, 24 Oct 2024 21:08:26 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. >> >> In order to make the code review easier the changes have been split into the following initial 4 commits: >> >> - Changes to allow unmounting a virtual thread that is currently holding monitors. >> - Changes to allow unmounting a virtual thread blocked on synchronized trying to acquire the monitor. >> - Changes to allow unmounting a virtual thread blocked in `Object.wait()` and its timed-wait variants. >> - Changes to tests, JFR pinned event, and other changes in the JDK libraries. >> >> The changes fix pinning issues for all 4 ports that currently implement continuations: x64, aarch64, riscv and ppc. Note: ppc changes were added recently and stand in its own commit after the initial ones. >> >> The changes fix pinning issues when using `LM_LIGHTWEIGHT`, i.e. the default locking mode, (and `LM_MONITOR` which comes for free), but not when using `LM_LEGACY` mode. Note that the `LockingMode` flag has already been deprecated ([JDK-8334299](https://bugs.openjdk.org/browse/JDK-8334299)), with the intention to remove `LM_LEGACY` code in future releases. >> >> >> ## Summary of changes >> >> ### Unmount virtual thread while holding monitors >> >> As stated in the JEP, currently when a virtual thread enters a synchronized method or block, the JVM records the virtual thread's carrier platform thread as holding the monitor, not the virtual thread itself. This prevents the virtual thread from being unmounted from its carrier, as ownership information would otherwise go wrong. In order to fix this limitation we will do two things: >> >> - We copy the oops stored in the LockStack of the carrier to the stackChunk when freezing (and clear the LockStack). We copy the oops back to the LockStack of the next carrier when thawing for the first time (and clear them from the stackChunk). Note that we currently assume carriers don't hold monitors while mounting virtual threads. >> >> - For inflated monitors we now record the `java.lang.Thread.tid` of the owner in the ObjectMonitor's `_owner` field instead of a JavaThread*. This allows us to tie the owner of the monitor to a `java.lang.Thread` instance, rather than to a JavaThread which is only created per platform thread. The tid is already a 64 bit field so we can ignore issues of the counter wrapping around. >> >> #### General notes about this part: >> >> - Since virtual th... > > Patricio Chilano Mateo has updated the pull request incrementally with four additional commits since the last revision: > > - Rename set/has_owner_anonymous to set/has_anonymous_owner > - Fix comments in javaThread.hpp and Thread.java > - Rename nonce/nounce to seqNo in VirtualThread class > - Remove ObjectMonitor::set_owner_from_BasicLock() Thanks for updates. (I need to add a Review comment so I get a checkpoint to track further updates.) ------------- PR Review: https://git.openjdk.org/jdk/pull/21565#pullrequestreview-2393910702 From psadhukhan at openjdk.org Fri Oct 25 04:57:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 25 Oct 2024 04:57:39 GMT Subject: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2] In-Reply-To: <8qd_9S3KCF53zPpIFtrjcD1BFljqTa4_Qu1qrhtJeFg=.453b851a-4e89-454f-98a1-4c57901accdc@github.com> References: <4p_vfip2UXM3K4lU7A7163Iz62qQhHKl01DUIIuqi1k=.9971fe7c-d560-4c83-9bb2-d315de51454c@github.com> <52659hNDEGAt6JC9HC6IUw4Qy1QFRkc23w7IQpKYCcs=.2fc5b1a9-e9b9-4f36-aacc-b48b8e360798@github.com> <6ApqXmPZcKXKJ8E4Wd2wvLT-2CNcpN_XglBX983HrQA=.11574ea5-7949-4355-8f9f-4cd5f2101ed4@github.com> <8qd_9S3KCF53zPpIFtrjcD1BFljqTa4_Qu1qrhtJeFg=.453b851a-4e89-454f-98a1-4c57901accdc@github.com> Message-ID: <3cbgckSg8DmaAkUalu54f2S9UMmrVrgo7SNQ1Eb1PvM=.a2830527-7ffc-48d2-8191-85c861f30b6f@github.com> On Thu, 24 Oct 2024 17:27:33 GMT, Alexey Ivanov wrote: > > I think we have finally decided that jtreg tag will come after copyright and before imports...Applicable for all modified javax_swing tests in this PR... > > Did we agree on that? Atleast client-dev team did.. See this initial note https://github.com/openjdk/jdk/pull/18414/files#r1534605049 And also in our internal meeting, Phil mentioned if IDE is having issue with this tag order (like collapsing) it's IDE's problem and they should be rectified and we should not change our product code for that.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1815994453