Re: RFR: 8247972: incorrect implementation of JVM TI GetObjectMonitorUsage [v14]

2024-02-22 Thread Serguei Spitsyn
> The implementation of the JVM TI `GetObjectMonitorUsage` does not match the > spec. > The function returns the following structure: > > > typedef struct { > jthread owner; > jint entry_count; > jint waiter_count; > jthread* waiters; > jint notify_waiter_count; > jthread

Re: RFR: 8247972: incorrect implementation of JVM TI GetObjectMonitorUsage [v14]

2024-02-22 Thread Serguei Spitsyn
On Thu, 22 Feb 2024 11:22:26 GMT, Serguei Spitsyn wrote: >> The implementation of the JVM TI `GetObjectMonitorUsage` does not match the >> spec. >> The function returns the following structure: >> >> >> typedef struct { >> jthread owner; >> jint entry_count; >> jint waiter_count; >

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v2]

2024-02-22 Thread Serguei Spitsyn
On Wed, 21 Feb 2024 21:42:08 GMT, Alex Menkov wrote: >> VirtualMachine.loadAgentPath/loadAgentLibrary can fail with >> AgentLoadException in 2 cases: >> - attach listener returns error; in the case the exception is thrown from >> HotSpotVirtualMachine.processCompletionStatus (called from >> Ho

Re: RFR: 8256314: JVM TI GetCurrentContendedMonitor is implemented incorrectly

2024-02-22 Thread Serguei Spitsyn
On Wed, 21 Feb 2024 19:13:41 GMT, Alan Bateman wrote: >> The implementation of the JVM TI `GetCurrentContendedMonitor` does not match >> the spec. It can sometimes return an incorrect information about the >> contended monitor. Such a behavior does not match the function spec. >> With this upd

Re: RFR: 8256314: JVM TI GetCurrentContendedMonitor is implemented incorrectly

2024-02-22 Thread Alan Bateman
On Wed, 21 Feb 2024 10:28:49 GMT, Serguei Spitsyn wrote: > The implementation of the JVM TI `GetCurrentContendedMonitor` does not match > the spec. It can sometimes return an incorrect information about the > contended monitor. Such a behavior does not match the function spec. > With this upda

Re: RFR: 8256314: JVM TI GetCurrentContendedMonitor is implemented incorrectly

2024-02-22 Thread Serguei Spitsyn
On Thu, 22 Feb 2024 15:02:18 GMT, Alan Bateman wrote: > Are you planning to update ThreadReference::currentContendedMonitor method > description too? Initially, I wanted to address it separately. But it is better to fix all together. I'll update my fix, the CSR and RN. - PR Comme

Re: RFR: 8256314: JVM TI GetCurrentContendedMonitor is implemented incorrectly [v2]

2024-02-22 Thread Serguei Spitsyn
> The implementation of the JVM TI `GetCurrentContendedMonitor()` does not > match the spec. It can sometimes return an incorrect information about the > contended monitor. Such a behavior does not match the function spec. > With this update the `GetCurrentContendedMonitor()` is returning the mo

RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Kim Barrett
Please review this trivial change that renames the file test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to agent_common.hpp. The #include updates were performed mechanically, and builds would fail if there were mistakes. The copyright updates were similarly performed mec

RFR: JDK-8326525: com/sun/tools/attach/BasicTests.java does not verify AgentLoadException case

2024-02-22 Thread Alex Menkov
The change updates the test to throw an exception if expected AgentLoadException is not thrown - Commit messages: - fix Changes: https://git.openjdk.org/jdk/pull/17971/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17971&range=00 Issue: https://bugs.openjdk.org/browse/JD

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Coleen Phillimore
On Thu, 22 Feb 2024 19:38:26 GMT, Kim Barrett wrote: > Please review this trivial change that renames the file > test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to > agent_common.hpp. > > The #include updates were performed mechanically, and builds would fail if > there

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v3]

2024-02-22 Thread Alex Menkov
> VirtualMachine.loadAgentPath/loadAgentLibrary can fail with > AgentLoadException in 2 cases: > - attach listener returns error; in the case the exception is thrown from > HotSpotVirtualMachine.processCompletionStatus (called from > HotSpotVirtualMachine.execute); > - attach listener returns su

Re: RFR: JDK-8326525: com/sun/tools/attach/BasicTests.java does not verify AgentLoadException case

2024-02-22 Thread Chris Plummer
On Thu, 22 Feb 2024 19:46:58 GMT, Alex Menkov wrote: > The change updates the test to throw an exception if expected > AgentLoadException is not thrown Looks good. - Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17971#pullrequestreview-18

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v3]

2024-02-22 Thread Chris Plummer
On Thu, 22 Feb 2024 21:43:23 GMT, Alex Menkov wrote: >> VirtualMachine.loadAgentPath/loadAgentLibrary can fail with >> AgentLoadException in 2 cases: >> - attach listener returns error; in the case the exception is thrown from >> HotSpotVirtualMachine.processCompletionStatus (called from >> Ho

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v3]

2024-02-22 Thread Alex Menkov
On Thu, 22 Feb 2024 22:27:04 GMT, Chris Plummer wrote: > In invoke_Agent_OnAttach(), I think the second print_cr() should start with a > space: > > ``` > st->print_cr("%s was not loaded.", agent->name()); > if (*ebuf != '\0') { > st->print_cr("%s", &ebuf[0]); > } >

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v4]

2024-02-22 Thread Alex Menkov
> VirtualMachine.loadAgentPath/loadAgentLibrary can fail with > AgentLoadException in 2 cases: > - attach listener returns error; in the case the exception is thrown from > HotSpotVirtualMachine.processCompletionStatus (called from > HotSpotVirtualMachine.execute); > - attach listener returns su

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Serguei Spitsyn
On Thu, 22 Feb 2024 19:38:26 GMT, Kim Barrett wrote: > Please review this trivial change that renames the file > test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to > agent_common.hpp. > > The #include updates were performed mechanically, and builds would fail if > there

Re: RFR: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library [v3]

2024-02-22 Thread Alex Menkov
On Thu, 22 Feb 2024 23:25:06 GMT, Alex Menkov wrote: > Also, ebuf is of size 1024 and is getting truncated sometimes. See your > macosx log files on mdash. This doesn't necessarily have to be fixed, but > something to consider. All other callers of os::dll_load() also use buffer of 1024 chars.

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Dean Long
On Thu, 22 Feb 2024 19:38:26 GMT, Kim Barrett wrote: > Please review this trivial change that renames the file > test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to > agent_common.hpp. > > The #include updates were performed mechanically, and builds would fail if > there

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Kim Barrett
On Fri, 23 Feb 2024 00:36:43 GMT, Serguei Spitsyn wrote: > Looks good. I have a minor concern about the Copyright headers in 547 files. > What is the ways to make sure they are updated? Here's the bash script I used: #!/usr/bin/env bash for f in `git diff master --name-only`; do sed -i \

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Kim Barrett
On Fri, 23 Feb 2024 02:07:02 GMT, Dean Long wrote: > If we wanted to minimize changes, we could have agent_common.h include > agent_common.hpp. Then we don't have to change all the .cpp files, which have > other problems, like the includes not being sorted. The purpose of this exercise is to e

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Kim Barrett
On Thu, 22 Feb 2024 19:38:26 GMT, Kim Barrett wrote: > Please review this trivial change that renames the file > test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to > agent_common.hpp. > > The #include updates were performed mechanically, and builds would fail if > there

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Kim Barrett
On Thu, 22 Feb 2024 20:06:50 GMT, Coleen Phillimore wrote: >> Please review this trivial change that renames the file >> test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.h to >> agent_common.hpp. >> >> The #include updates were performed mechanically, and builds would fail

Re: RFR: 8326524: Rename agent_common.h

2024-02-22 Thread Julian Waters
On Thu, 22 Feb 2024 19:38:26 GMT, Kim Barrett wrote: > Please review this trivial change This doesn't look trivial at all :P - Marked as reviewed by jwaters (Committer). PR Review: https://git.openjdk.org/jdk/pull/17970#pullrequestreview-1897425509