Re: RFR: JDK-8315575: Retransform of record class with record component annotation fails with CFE [v5]

2024-03-20 Thread Serguei Spitsyn
On Wed, 20 Mar 2024 22:24:37 GMT, Alex Menkov wrote: >> The `retransform()` method returns an array of bytes. There is also a >> comment about it at the line 101. But the result has never been checked >> (please, see lines: 116, 123, 129, 135). This creates some confusion and >> questions why

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings [v2]

2024-03-20 Thread Paul Hohensee
On Wed, 20 Mar 2024 17:19:34 GMT, Aleksey Shipilev wrote: >> See the bug for symptoms. The tests are failing because hprof test library >> is confused about non-compact strings. >> >> Additional testing: >> - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now >> pass >>

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v5]

2024-03-20 Thread Leonid Mesnik
On Thu, 21 Mar 2024 01:09:52 GMT, Serguei Spitsyn wrote: >> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were >> introduced in the JDK 22 to unify/simplify the JVM TI functions supporting >> implementation of the virtual threads. This enhancement is to refactor JVM >> TI func

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v4]

2024-03-20 Thread Leonid Mesnik
On Thu, 21 Mar 2024 01:01:22 GMT, Serguei Spitsyn wrote: >> src/hotspot/share/prims/jvmtiEnv.cpp line 1366: >> >>> 1364: } >>> 1365: >>> 1366: if (java_thread != nullptr) { >> >> I am not sure why this check is needed at this level. It is duplication.The >> GetOwnedMonitorInfoClosure::do_

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v5]

2024-03-20 Thread Serguei Spitsyn
> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were > introduced in the JDK 22 to unify/simplify the JVM TI functions supporting > implementation of the virtual threads. This enhancement is to refactor JVM TI > functions `GetOwnedMonitorInfo` and `GetOwnedMonitorStackDepthInfo`

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v4]

2024-03-20 Thread Serguei Spitsyn
On Wed, 20 Mar 2024 22:41:05 GMT, Leonid Mesnik wrote: >> Serguei Spitsyn has updated the pull request incrementally with one >> additional commit since the last revision: >> >> review: work around problem for vthreads in >> EscapeBarrier::deoptimize_objects > > src/hotspot/share/prims/jvmti

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings [v2]

2024-03-20 Thread Alex Menkov
On Wed, 20 Mar 2024 17:19:34 GMT, Aleksey Shipilev wrote: >> See the bug for symptoms. The tests are failing because hprof test library >> is confused about non-compact strings. >> >> Additional testing: >> - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now >> pass >>

Re: RFR: 8327505: Test com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java fails

2024-03-20 Thread Leonid Mesnik
On Tue, 19 Mar 2024 16:23:27 GMT, Kevin Walls wrote: > Client.java has a fixed 30-second timeout on the CountDownLatch to wait for > 10 notifications. > > If it fails, you can't tell if CountDownLatch.await threw, or returned false > and the app threw InterruptedException, due to the way Clien

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v4]

2024-03-20 Thread Leonid Mesnik
On Wed, 20 Mar 2024 22:03:30 GMT, Serguei Spitsyn wrote: >> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were >> introduced in the JDK 22 to unify/simplify the JVM TI functions supporting >> implementation of the virtual threads. This enhancement is to refactor JVM >> TI func

Re: RFR: JDK-8315575: Retransform of record class with record component annotation fails with CFE [v5]

2024-03-20 Thread Alex Menkov
On Wed, 20 Mar 2024 04:40:52 GMT, Serguei Spitsyn wrote: >> test/jdk/java/lang/instrument/RetransformRecordAnnotation.java line 107: >> >>> 105: newClassBytes = classBytes; >>> 106: fInst.retransformClasses(targetClass); >>> 107: assertTrue(targetClass.getName() + " was n

Re: RFR: JDK-8315575: Retransform of record class with record component annotation fails with CFE [v6]

2024-03-20 Thread Alex Menkov
> RecordComponent class has _attributes_count field. > The only user of the field is JvmtiClassFileReconstituter. Incorrect value of > the field causes producing incorrect data for Record attribute. > Parsing Record attribute ClassFileParser skips unknown attributes and may > skip RuntimeInvisibl

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v4]

2024-03-20 Thread Serguei Spitsyn
> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were > introduced in the JDK 22 to unify/simplify the JVM TI functions supporting > implementation of the virtual threads. This enhancement is to refactor JVM TI > functions `GetOwnedMonitorInfo` and `GetOwnedMonitorStackDepthInfo`

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v2]

2024-03-20 Thread Serguei Spitsyn
On Wed, 20 Mar 2024 15:59:34 GMT, Patricio Chilano Mateo wrote: >> Good suggestion, thanks! >> Would the following fix work ? : >> >> >> git diff >> diff --git a/src/hotspot/share/runtime/escapeBarrier.cpp >> b/src/hotspot/share/runtime/escapeBarrier.cpp >> index bc01d900285..1b6d57644dc 1006

Integrated: 8296244: Alternate implementation of user-based authorization Subject APIs that doesn’t depend on Security Manager APIs

2024-03-20 Thread Weijun Wang
On Wed, 17 Jan 2024 23:41:53 GMT, Weijun Wang wrote: > This code change adds an alternative implementation of user-based > authorization `Subject` APIs that doesn't depend on Security Manager APIs. > Depending on if the Security Manager is allowed, the methods store the > current subject diffe

Re: RFR: 8296244: Alternate implementation of user-based authorization Subject APIs that doesn’t depend on Security Manager APIs [v8]

2024-03-20 Thread Sean Mullan
On Wed, 20 Mar 2024 14:45:50 GMT, Weijun Wang wrote: >> This code change adds an alternative implementation of user-based >> authorization `Subject` APIs that doesn't depend on Security Manager APIs. >> Depending on if the Security Manager is allowed, the methods store the >> current subject d

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings [v2]

2024-03-20 Thread Aleksey Shipilev
On Wed, 20 Mar 2024 14:46:09 GMT, Paul Hohensee wrote: > Are we guaranteed that non-compact string char component bytes are stored in > little-endian order? No, I don't think we are guaranteed any particular endianness, argh. The new patch follows what `StringUTF16` does: https://github.com/o

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings [v2]

2024-03-20 Thread Aleksey Shipilev
> See the bug for symptoms. The tests are failing because hprof test library is > confused about non-compact strings. > > Additional testing: > - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now > pass > - [x] `serviceability/HeapDump lib-test:all` with `-XX:+CompactS

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v2]

2024-03-20 Thread Patricio Chilano Mateo
On Wed, 20 Mar 2024 08:12:06 GMT, Serguei Spitsyn wrote: >> src/hotspot/share/prims/jvmtiEnv.cpp line 1368: >> >>> 1366: if (java_thread != nullptr) { >>> 1367: Handle thread_handle(calling_thread, thread_oop); >>> 1368: EscapeBarrier eb(true, calling_thread, java_thread); >> >> I see

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings

2024-03-20 Thread Leonid Mesnik
On Wed, 20 Mar 2024 09:53:36 GMT, Aleksey Shipilev wrote: > See the bug for symptoms. The tests are failing because hprof test library is > confused about non-compact strings. > > Additional testing: > - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now > pass > - [x]

RE: RFD: Remove Hotspot-internal MBeans from sun.management

2024-03-20 Thread Kevin Walls
Hi, 8328618: HotspotInternalMBean should be removed https://bugs.openjdk.org/browse/JDK-8328618 I looked a bit further and logged this, with notes on what the HotSpotXX MBeans actually do. It is almost all about providing a Java MBean interface to perf counters. HotspotThread additionally prov

Re: RFR: 8296244: Alternate implementation of user-based authorization Subject APIs that doesn’t depend on Security Manager APIs [v8]

2024-03-20 Thread Weijun Wang
On Wed, 20 Mar 2024 14:45:50 GMT, Weijun Wang wrote: >> This code change adds an alternative implementation of user-based >> authorization `Subject` APIs that doesn't depend on Security Manager APIs. >> Depending on if the Security Manager is allowed, the methods store the >> current subject d

Re: RFR: 8328592: hprof tests fail with -XX:-CompactStrings

2024-03-20 Thread Paul Hohensee
On Wed, 20 Mar 2024 09:53:36 GMT, Aleksey Shipilev wrote: > See the bug for symptoms. The tests are failing because hprof test library is > confused about non-compact strings. > > Additional testing: > - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now > pass > - [x]

Re: RFR: 8296244: Alternate implementation of user-based authorization Subject APIs that doesn’t depend on Security Manager APIs [v8]

2024-03-20 Thread Weijun Wang
> This code change adds an alternative implementation of user-based > authorization `Subject` APIs that doesn't depend on Security Manager APIs. > Depending on if the Security Manager is allowed, the methods store the > current subject differently. See the spec change in the `Subject.java` file

Re: RFR: 8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync [v4]

2024-03-20 Thread Martin Doerr
On Wed, 20 Mar 2024 14:02:23 GMT, Richard Reingruber wrote: >> This pr changes `JfrJvmtiAgent::retransform_classes()` and >> `jfr_set_enabled` to switch to `WXWrite` before transitioning to the vm. >> >> Testing: >> make test TEST=jdk/jfr/event/runtime/TestClassLoadEvent.java >> TEST_VM_OPTS=

Re: RFR: 8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync [v4]

2024-03-20 Thread Richard Reingruber
> This pr changes `JfrJvmtiAgent::retransform_classes()` and `jfr_set_enabled` > to switch to `WXWrite` before transitioning to the vm. > > Testing: > make test TEST=jdk/jfr/event/runtime/TestClassLoadEvent.java > TEST_VM_OPTS=-XX:+AssertWXAtThreadSync > make test TEST=compiler/intrinsics/klass

Re: RFR: 8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync [v3]

2024-03-20 Thread Richard Reingruber
On Tue, 19 Mar 2024 17:46:31 GMT, Tobias Holenstein wrote: >> I've asked this myself (after making the change). >> Being in `WXWrite` mode would be wrong if the thread would execute >> dynamically generated code. There's not too much happening outside the scope >> of the `ThreadInVMfromNative`

RE: RFD: Remove Hotspot-internal MBeans from sun.management

2024-03-20 Thread Kevin Walls
Yes, I looked into it a little since you raised the previous issue, that looks like the right direction. HotspotInternalMBean should be removed (an undocumented, unsupported and experimental interface) HotspotInternalMBean creates: sun.management…. HotspotClassLoading HotspotMemory HotspotRunti

Re: RFR: JDK-8327474 Review use of java.io.tmpdir in jdk tests [v2]

2024-03-20 Thread Erik Gahlin
On Tue, 19 Mar 2024 17:58:46 GMT, Bill Huang wrote: >> This task addresses an essential aspect of our testing infrastructure: the >> proper handling and cleanup of temporary files and socket files created >> during test execution. The motivation behind these changes is to prevent the >> accumu

RFR: 8328592: hprof tests fail with -XX:-CompactStrings

2024-03-20 Thread Aleksey Shipilev
See the bug for symptoms. The tests are failing because hprof test library is confused about non-compact strings. Additional testing: - [x] `serviceability/HeapDump lib-test:all` with `-XX:-CompactStrings` now pass - [x] `serviceability/HeapDump lib-test:all` with `-XX:+CompactStrings` still

Re: RFR: JDK-8327769: jcmd GC.heap_dump without options should write to location given by -XX:HeapDumpPath, if set [v8]

2024-03-20 Thread Andreas Steiner
On Tue, 19 Mar 2024 20:15:18 GMT, Chris Plummer wrote: >> So should I also use HeapDumpGzipLevel the same way as HeapDumpPath ? Tehn >> we have to change the text in globals.hpp for HeapDumpGzipLevel as well >> because it mentions only the HeapDumpOnOutOfmemoryError case and not the >> jcmd

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v3]

2024-03-20 Thread Serguei Spitsyn
> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were > introduced in the JDK 22 to unify/simplify the JVM TI functions supporting > implementation of the virtual threads. This enhancement is to refactor JVM TI > functions `GetOwnedMonitorInfo` and `GetOwnedMonitorStackDepthInfo`

Re: RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v2]

2024-03-20 Thread Serguei Spitsyn
On Wed, 20 Mar 2024 02:10:28 GMT, Patricio Chilano Mateo wrote: >> Serguei Spitsyn has updated the pull request incrementally with one >> additional commit since the last revision: >> >> review: correct one comment > > src/hotspot/share/prims/jvmtiEnv.cpp line 1368: > >> 1366: if (java_th