Integrated: 8333047: Remove arena-size-workaround in jvmtiUtils.cpp

2024-05-30 Thread Thomas Stuefe
On Tue, 28 May 2024 12:36:41 GMT, Thomas Stuefe wrote: > In `JvmtiUtil::single_threaded_resource_area()`, we create a resource area > that is supposed to work even if the current thread is not attached yet and > there is no associated Thread or the Thread has no valid ResourceArea. > > It cont

Re: RFR: 8333047: Remove arena-size-workaround in jvmtiUtils.cpp

2024-05-30 Thread Thomas Stuefe
On Wed, 29 May 2024 07:42:01 GMT, Johan Sjölen wrote: >> In `JvmtiUtil::single_threaded_resource_area()`, we create a resource area >> that is supposed to work even if the current thread is not attached yet and >> there is no associated Thread or the Thread has no valid ResourceArea. >> >> It

Re: RFR: 8332785: Replace naked uses of UseSharedSpaces with CDSConfig::is_using_archive

2024-05-30 Thread Thomas Stuefe
On Wed, 29 May 2024 18:12:25 GMT, Sonia Zaldana Calles wrote: > Hi folks, > > This PR addresses [8332785](https://bugs.openjdk.org/browse/JDK-8332785) > replacing all naked uses for ```UseSharedSpaces``` with > ```CDSConfig::is_using_archive```. > > Testing: > - [x] Tier 1 with GHA. > >

Re: RFR: 8332785: Replace naked uses of UseSharedSpaces with CDSConfig::is_using_archive

2024-05-30 Thread David Holmes
On Wed, 29 May 2024 18:12:25 GMT, Sonia Zaldana Calles wrote: > Hi folks, > > This PR addresses [8332785](https://bugs.openjdk.org/browse/JDK-8332785) > replacing all naked uses for ```UseSharedSpaces``` with > ```CDSConfig::is_using_archive```. > > Testing: > - [x] Tier 1 with GHA. > >

Re: RFR: 8326716: JVMTI spec: clarify what nullptr means for C/C++ developers [v2]

2024-05-30 Thread David Holmes
On Fri, 31 May 2024 01:43:35 GMT, Serguei Spitsyn wrote: > Okay. I've made a fix to replace in the docs nullptr with null pointer as you > suggested. What I suggested was > returns _a_ null pointer in place of > returns `nulllptr` but "a null pointer" doesn't always look right either e.g. "

Re: RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump

2024-05-30 Thread David Holmes
On Thu, 30 May 2024 14:13:34 GMT, Inigo Mediavilla Saiz wrote: > Print the stack traces of mounted virtual threads when calling `jcmd > Thread.print`. I'd probably give preference to the stack of the virtual thread, as the stack of the carrier when a vthread is mounted is generally quite uni

Re: RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump

2024-05-30 Thread David Holmes
On Thu, 30 May 2024 14:13:34 GMT, Inigo Mediavilla Saiz wrote: > Print the stack traces of mounted virtual threads when calling `jcmd > Thread.print`. Do you look at `JavaThread::print_vthread_stack_on`? The last thing we need is yet-another-version of stack printing code. - PR

Re: RFR: 8326716: JVMTI spec: clarify what nullptr means for C/C++ developers [v3]

2024-05-30 Thread Serguei Spitsyn
On Fri, 17 May 2024 04:47:31 GMT, Alan Bateman wrote: >> Thank you, Kim. I like this suggestion. Updated now. > > That part looks okay but I think all the parameters and error descriptions > changed by JDK-8324680 will now need to change to use "null" instead of > "nullptr". Okay. I've made a

Re: RFR: 8326716: JVMTI spec: clarify what nullptr means for C/C++ developers [v2]

2024-05-30 Thread Serguei Spitsyn
On Fri, 17 May 2024 04:34:22 GMT, Kim Barrett wrote: > But this clarification doesn't actually clarify that the rest of the spec > uses nullptr. Based on the proposed wording I would expect things like: > > The function may return nullptr > > to say > > The function may return a null pointer Ok

Re: RFR: 8326716: JVMTI spec: clarify what nullptr means for C/C++ developers [v3]

2024-05-30 Thread Serguei Spitsyn
> The following RFE was fixed recently: > [8324680](https://bugs.openjdk.org/browse/JDK-8324680): Replace NULL with > nullptr in JVMTI generated code > > It replaced all the `NULL`'s in the generated spec with`nullptr`. JVMTI > agents can be developed in C or C++. > This update is to make it cle

Re: RFR: 8333149: ubsan : memset on nullptr target detected in jvmtiEnvBase.cpp get_object_monitor_usage

2024-05-30 Thread David Holmes
On Wed, 29 May 2024 09:09:16 GMT, Matthias Baesken wrote: > When running with ubsan - enabled binaries (--enable-ubsan), > in the vmTestbase/nsk/jdi tests some cases of memset on nullptr destinations > are detected in get_object_monitor_usage . > > // null out memory for robustness > memset(ret

Re: RFR: 8320215: HeapDumper can use DumpWriter buffer during merge

2024-05-30 Thread Chris Plummer
On Fri, 19 Apr 2024 00:10:12 GMT, Alex Menkov wrote: > The fix updates HeapMerger to use writer buffer (no need to copy memory, also > writer buffer is 1MB instead of 4KB). > Additionally fixed small issue in FileWriter (looks like `ssize_t` instead of > `size_t` is a typo, the argument should

RFR: 8332785: Replace naked uses of UseSharedSpaces with CDSConfig::is_using_archive

2024-05-30 Thread Sonia Zaldana Calles
Hi folks, This PR addresses [8332785](https://bugs.openjdk.org/browse/JDK-8332785) replacing all naked uses for ```UseSharedSpaces``` with ```CDSConfig::is_using_archive```. Testing: - [x] Tier 1 with GHA. Thanks, Sonia - Commit messages: - Missed include statement in vmErr

Integrated: 8332751: Broken link in VirtualMachine.html

2024-05-30 Thread Chris Plummer
On Wed, 29 May 2024 20:17:30 GMT, Chris Plummer wrote: > Fixed broken javadoc link. I confirmed that it currently is broken as can be > seen in the JDK 22 javadocs: > > https://docs.oracle.com/en%2Fjava%2Fjavase%2F22%2Fdocs%2Fapi%2F%2F/jdk.jdi/com/sun/jdi/VirtualMachine.html#allThreads() > > C

Re: RFR: 8332751: Broken link in VirtualMachine.html

2024-05-30 Thread Chris Plummer
On Wed, 29 May 2024 20:17:30 GMT, Chris Plummer wrote: > Fixed broken javadoc link. I confirmed that it currently is broken as can be > seen in the JDK 22 javadocs: > > https://docs.oracle.com/en%2Fjava%2Fjavase%2F22%2Fdocs%2Fapi%2F%2F/jdk.jdi/com/sun/jdi/VirtualMachine.html#allThreads() > > C

RFR: 8333301: Remove static builds using --enable-static-build

2024-05-30 Thread Magnus Ihse Bursie
The original way of building static libraries in the JDK was to use the configure argument --enable-static-build, which set the value of the make variable STATIC_BUILD. (Note that this is not the same as the source code definition STATIC_BUILD, which will be set by other means as well.) This me

Re: RFR: 8311177: Switching to interpreter only mode in carrier thread can lead to crashes [v2]

2024-05-30 Thread Patricio Chilano Mateo
On Thu, 30 May 2024 02:31:29 GMT, Serguei Spitsyn wrote: >> Please, review the following `interp-only` issue related to carrier threads. >> There are 3 problems fixed here: >> - The `EnterInterpOnlyModeClosure::do_threads` is taking the >> `JvmtiThreadState` with the `jt->jvmti_thread_state()`

Integrated: 8333108: Update vmTestbase/nsk/share/DebugeeProcess.java to don't use finalization

2024-05-30 Thread Leonid Mesnik
On Tue, 28 May 2024 20:24:31 GMT, Leonid Mesnik wrote: > The > test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java > uses cleanup() to kill debuggee process. > > However, most tests kill the debuggee process explicitly. I verified that > debuggee process is killed before test fini

Integrated: 8330852: All callers of JvmtiEnvBase::get_threadOop_and_JavaThread should pass current thread explicitly

2024-05-30 Thread Alex Menkov
On Fri, 26 Apr 2024 22:59:43 GMT, Alex Menkov wrote: > Some cleanup related to JvmtiEnvBase::get_threadOop_and_JavaThread method > > Testing: tier1-6 This pull request has now been integrated. Changeset: 44c1845a Author:Alex Menkov URL: https://git.openjdk.org/jdk/commit/44c1845ae7

Integrated: 8328611: Thread safety issue in com.sun.tools.jdi.ReferenceTypeImpl::classObject

2024-05-30 Thread Chris Plummer
On Tue, 28 May 2024 23:20:48 GMT, Chris Plummer wrote: > Fixed "double-checked-locking" bug in `ReferenceImplType.classObject()`. > Details in the first comment. Tested with the following: > - com/sun/jdi > - nsk/jdi > - nsk/jdwp > - nsk/jdb This pull request has now been integrated. Changeset

Re: RFR: 8328611: Thread safety issue in com.sun.tools.jdi.ReferenceTypeImpl::classObject [v2]

2024-05-30 Thread Chris Plummer
On Wed, 29 May 2024 01:47:27 GMT, Chris Plummer wrote: >> Fixed "double-checked-locking" bug in `ReferenceImplType.classObject()`. >> Details in the first comment. Tested with the following: >> - com/sun/jdi >> - nsk/jdi >> - nsk/jdwp >> - nsk/jdb > > Chris Plummer has updated the pull request i

Re: RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump

2024-05-30 Thread Alan Bateman
On Thu, 30 May 2024 14:13:34 GMT, Inigo Mediavilla Saiz wrote: > Print the stack traces of mounted virtual threads when calling `jcmd > Thread.print`. Thanks for take this one. Here's the result with the changes in 1a75277e. "ForkJoinPool-1-worker-1" #25 [33795] daemon prio=5 os_prio=31 cpu=

Re: RFR: 8333149: ubsan : memset on nullptr target detected in jvmtiEnvBase.cpp get_object_monitor_usage

2024-05-30 Thread Thomas Stuefe
On Wed, 29 May 2024 09:09:16 GMT, Matthias Baesken wrote: > When running with ubsan - enabled binaries (--enable-ubsan), > in the vmTestbase/nsk/jdi tests some cases of memset on nullptr destinations > are detected in get_object_monitor_usage . > > // null out memory for robustness > memset(ret

Re: RFR: 8333108: Update vmTestbase/nsk/share/DebugeeProcess.java to don't use finalization

2024-05-30 Thread Serguei Spitsyn
On Tue, 28 May 2024 20:24:31 GMT, Leonid Mesnik wrote: > The > test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java > uses cleanup() to kill debuggee process. > > However, most tests kill the debuggee process explicitly. I verified that > debuggee process is killed before test fini

Re: JDK-8330846 - Status check

2024-05-30 Thread Iñigo Mediavilla
Thanks Alex ! Here's a work in progress PR where I'm tackling the `jcmd Thread.print` command: https://github.com/openjdk/jdk/pull/19482 The JBS ticket also mentions `jstack` but I'd be in favor of doing that if in a separate PR for simplicity, unless there's a general recommendation in the ope

RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump

2024-05-30 Thread Inigo Mediavilla Saiz
Print the stack traces of mounted virtual threads when calling `jcmd Thread.print`. - Commit messages: - 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump Changes: https://git.openjdk.org/jdk/pull/19482/files Webrev: https://webrevs.openjdk.org/?repo=jdk&

Re: RFR: 8333149: ubsan : memset on nullptr target detected in jvmtiEnvBase.cpp get_object_monitor_usage

2024-05-30 Thread Martin Doerr
On Wed, 29 May 2024 09:09:16 GMT, Matthias Baesken wrote: > When running with ubsan - enabled binaries (--enable-ubsan), > in the vmTestbase/nsk/jdi tests some cases of memset on nullptr destinations > are detected in get_object_monitor_usage . > > // null out memory for robustness > memset(ret

Re: RFR: 8332923: ObjectMonitorUsage.java failed with unexpected waiter_count [v3]

2024-05-30 Thread Serguei Spitsyn
On Thu, 30 May 2024 01:13:20 GMT, SendaoYan wrote: >> Hi all, >> ObjectMonitorUsage.java failed with `unexpected waiter_count` after >> [JDK-8328083](https://bugs.openjdk.org/browse/JDK-8328083) on linux x86_32. >> There are two changes in this PR: >> 1. In `JvmtiEnvBase::get_object_monitor_

Re: RFR: 8332923: ObjectMonitorUsage.java failed with unexpected waiter_count [v3]

2024-05-30 Thread David Holmes
On Thu, 30 May 2024 07:14:13 GMT, Alan Bateman wrote: >> Okay. I still think that should be hidden behind the >> `java_lang_VirtualThread::is_instance` as it is an implementation detail the >> JVMTI and thread code shouldn't need to know about IMO. Once the alternative >> implementation is rem

Re: RFR: 8332923: ObjectMonitorUsage.java failed with unexpected waiter_count [v3]

2024-05-30 Thread Alan Bateman
On Thu, 30 May 2024 06:51:54 GMT, David Holmes wrote: >> Hopefully the ports will catch up someday and the alternative implementation >> can be removed. >> >> We decided not to rename java.lang.VirtualThread when introducing the >> alternative implementation as it's just too disruptive. The s