Re: RFR: 8320652: ThreadInfo.isInNative needs to be updated to say what executing native code means

2023-11-24 Thread Jaikiran Pai
On Thu, 23 Nov 2023 10:25:31 GMT, Alan Bateman wrote: > This is a docs only change to j.l.management.ThreadInfo::isInNative. > > The method currently specifies that it tests if the thread is "executing > native code via the Java Native Interface (JNI)". It would be clearer to say > that it

Re: RFR: 8320532: Remove Thread/ThreadGroup suspend/resume

2023-11-24 Thread Jaikiran Pai
On Thu, 23 Nov 2023 09:18:44 GMT, Alan Bateman wrote: > The deadlock prone Thread/ThreadGroup suspend/resume were deprecated since > JDK 1.2, deprecated for removal in Java 14, and re-specified/degraded to > throw UnsupportedOperationException unconditionally in Java 19/20. Early in > Java 23

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Jaikiran Pai
On Fri, 24 Nov 2023 13:00:33 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix the issue >> noted in https://bugs.openjdk.org/browse/JDK-8320687? >> >> As noted in the issue, the >> `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared >

Re: RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v8]

2023-11-24 Thread David Holmes
On Fri, 24 Nov 2023 05:47:14 GMT, David Holmes wrote: >> Jaroslav Bachorik has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Reinstate mistakenly deleted comment > > This has gotten a lot more complicated. All I was suggesting was if this:

Re: RFR: 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite)

2023-11-24 Thread Mark Sheppard
On Fri, 24 Nov 2023 13:22:07 GMT, Kevin Walls wrote: >> OK - sounds good. Meanwhile I had a look at the custom RMI Socket Factories >> used by the JMX Agent, and these are actually RMIServerSocketFactories, so >> having a timeout for connect there probably makes no sense. > > Thanks, yes so JMX

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Kevin Walls
On Fri, 24 Nov 2023 14:57:08 GMT, Jaikiran Pai wrote: >> src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredHost.java >> line 170: >> >>> 168: break; >>> 169: } >>> 170: } >> >> Alternatively, you can do it more succulently with a stream: >>

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Jaikiran Pai
On Fri, 24 Nov 2023 14:31:56 GMT, Alan Bateman wrote: > .map(mhs -> mhs.getMonitoredHost(hostId)) That was a reasoanable suggestion and I gave it a try, but `mhs.getMonitoredHost(hostId)` throws a checked exception `MonitorException` so using this `Stream` based approach then would need additi

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Alan Bateman
On Fri, 24 Nov 2023 13:00:33 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix the issue >> noted in https://bugs.openjdk.org/browse/JDK-8320687? >> >> As noted in the issue, the >> `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared >

RFR: 8320652: ThreadInfo.isInNative needs to be updated to say what executing native code means

2023-11-24 Thread Alan Bateman
This is a docs only change to j.l.management.ThreadInfo::isInNative. The method currently specifies that it tests if the thread is "executing native code via the Java Native Interface (JNI)". It would be clearer to say that it tests if the thread is executing a native method, and expand it to

Re: RFR: JDK-8320005 : Native library suffix impact on hotspot code in AIX [v2]

2023-11-24 Thread Thomas Stuefe
On Fri, 24 Nov 2023 11:45:25 GMT, suchismith1993 wrote: > > i would have to repeat the line 1132 and 1139 in os_aix.cpp again , if the > > condition fails for .so files, because i have to reload it again and check > > if the .a exists. In the shared code i had repeat less number of lines i > >

Re: RFR: 8309271: A way to align already compiled methods with compiler directives [v11]

2023-11-24 Thread Dmitry Chuyko
> Compiler Control (https://openjdk.org/jeps/165) provides method-context > dependent control of the JVM compilers (C1 and C2). The active directive > stack is built from the directive files passed with the > `-XX:CompilerDirectivesFile` diagnostic command-line option and the > Compiler.add_dir

Re: RFR: 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite)

2023-11-24 Thread Kevin Walls
On Fri, 24 Nov 2023 13:01:59 GMT, Daniel Fuchs wrote: >> OK yes, we also have: >> java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java >> with its own createSocket(String host, int port) method. This is used if we >> use JMX over SSL. >> >> So SslRMIClientSocketFactory could sp

Re: RFR: 8320532: Remove Thread/ThreadGroup suspend/resume

2023-11-24 Thread Alan Bateman
On Fri, 24 Nov 2023 12:58:50 GMT, David Holmes wrote: > Looks good to me. I'm okay with removing the suspend/resume text from the > deprecation page - no point trying to explain a 25+ year history. Thanks, would you mind reviewing the CSR too? (The fixVersion is set to 23 so the skara bots are

Re: RFR: 8320532: Remove Thread/ThreadGroup suspend/resume

2023-11-24 Thread Alan Bateman
On Fri, 24 Nov 2023 12:55:26 GMT, David Holmes wrote: > You didn't really need to rename the test even though there is now only one > degraded method left. True but it's wasn't good name for a test that only exercises one method. > test/jdk/java/nio/channels/SocketChannel/SendUrgentData.java l

Re: RFR: 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite)

2023-11-24 Thread Daniel Fuchs
On Fri, 24 Nov 2023 12:13:56 GMT, Kevin Walls wrote: >> (Look for socket factories in the module `jdk.management.agent`) > > OK yes, we also have: > java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java > with its own createSocket(String host, int port) method. This is used if we

Re: RFR: 8320532: Remove Thread/ThreadGroup suspend/resume

2023-11-24 Thread David Holmes
On Thu, 23 Nov 2023 09:18:44 GMT, Alan Bateman wrote: > The deadlock prone Thread/ThreadGroup suspend/resume were deprecated since > JDK 1.2, deprecated for removal in Java 14, and re-specified/degraded to > throw UnsupportedOperationException unconditionally in Java 19/20. Early in > Java 23

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Jaikiran Pai
On Fri, 24 Nov 2023 11:55:15 GMT, Alan Bateman wrote: >>> > Right now, the sole usage of the `monitoredHostServiceLoader` instance is >>> > within a `synchronized (monitoredHosts) {...}` block within a method. So >>> > it wouldn't require this `assert`. >>> >>> Okay, I guess part of me wonders

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v4]

2023-11-24 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to fix the issue > noted in https://bugs.openjdk.org/browse/JDK-8320687? > > As noted in the issue, the > `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared instance > of `java.util.ServiceLoader` to load `MonitoredHost

Re: RFR: 8320515: assert(monitor->object_peek() != nullptr) failed: Owned monitors should not have a dead object [v5]

2023-11-24 Thread David Holmes
On Fri, 24 Nov 2023 08:01:15 GMT, Stefan Karlsson wrote: >> Thanks for that. Looks like JMM thread dump is different to VM Thread dump. >> Okay we definitely need RFEs to look into how to handle this. > > Will you create the RFE? I'm not as convinced that this is something that > needs to be fi

Re: RFR: 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite)

2023-11-24 Thread Kevin Walls
On Thu, 23 Nov 2023 17:21:02 GMT, Daniel Fuchs wrote: >>> This is a stack from a test I was experimenting with, when it did see the >>> timeout: >> >> Ah - that's for testing with a particular test. So the question now is: >> >> Should the RMISocketFactories provided / implemented in the JMX

Re: RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v9]

2023-11-24 Thread Jaroslav Bachorik
> Please, review this fix for a corner case handling of `jmethodID` values. > > The issue is related to the interplay between `jmethodID` values and method > redefinitions. Each `jmethodID` value is effectively a pointer to a `Method` > instance. Once that method gets redefined, the `jmethodID`

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

2023-11-24 Thread Alan Bateman
On Fri, 24 Nov 2023 11:46:20 GMT, Jaikiran Pai wrote: >>> Right now, the sole usage of the `monitoredHostServiceLoader` instance is >>> within a `synchronized (monitoredHosts) {...}` block within a method. So it >>> wouldn't require this `assert`. >> >> Okay, I guess part of me wonders why thi

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

2023-11-24 Thread Kevin Walls
On Fri, 24 Nov 2023 11:28:25 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix the issue >> noted in https://bugs.openjdk.org/browse/JDK-8320687? >> >> As noted in the issue, the >> `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared >

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

2023-11-24 Thread Jaikiran Pai
On Fri, 24 Nov 2023 11:40:40 GMT, Alan Bateman wrote: > > Right now, the sole usage of the `monitoredHostServiceLoader` instance is > > within a `synchronized (monitoredHosts) {...}` block within a method. So it > > wouldn't require this `assert`. > > Okay, I guess part of me wonders why this

Re: RFR: JDK-8320005 : Native library suffix impact on hotspot code in AIX [v2]

2023-11-24 Thread suchismith1993
On Thu, 23 Nov 2023 06:03:15 GMT, Thomas Stuefe wrote: >> suchismith1993 has updated the pull request incrementally with one >> additional commit since the last revision: >> >> change macro position > > src/hotspot/os/aix/os_aix.cpp line 3065: > >> 3063: //Replaces provided path with alterna

Re: RFR: JDK-8320005 : Native library suffix impact on hotspot code in AIX [v2]

2023-11-24 Thread suchismith1993
On Thu, 23 Nov 2023 18:26:56 GMT, suchismith1993 wrote: > > > > I'm not a big fan of this approach. We accumulate more and more "#ifdef > > > > AIX" in shared code because of many recent AIX additions. No other > > > > platform has such a large ifdef footprint in shared code. > > > > I argue th

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

2023-11-24 Thread Alan Bateman
On Fri, 24 Nov 2023 06:54:27 GMT, Jaikiran Pai wrote: > Right now, the sole usage of the `monitoredHostServiceLoader` instance is > within a `synchronized (monitoredHosts) {...}` block within a method. So it > wouldn't require this `assert`. Okay, I guess part of me wonders why this field is n

Re: RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v8]

2023-11-24 Thread Jaroslav Bachorik
On Fri, 24 Nov 2023 06:49:14 GMT, Thomas Stuefe wrote: >I wondered about that but IIUC the pointers inside IK->_methods_jmethod_ids >may refer to jmethodID slots that have been reused for different methods? Yes. The reason is that if a class has previous versions, these versions do not contain

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v2]

2023-11-24 Thread Jaikiran Pai
On Fri, 24 Nov 2023 06:57:33 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix the issue >> noted in https://bugs.openjdk.org/browse/JDK-8320687? >> >> As noted in the issue, the >> `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared >

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

2023-11-24 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to fix the issue > noted in https://bugs.openjdk.org/browse/JDK-8320687? > > As noted in the issue, the > `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared instance > of `java.util.ServiceLoader` to load `MonitoredHost

Re: RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v8]

2023-11-24 Thread Jaroslav Bachorik
On Fri, 24 Nov 2023 05:47:14 GMT, David Holmes wrote: >> Jaroslav Bachorik has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Reinstate mistakenly deleted comment > > This has gotten a lot more complicated. All I was suggesting was if this:

Re: RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v2]

2023-11-24 Thread Kevin Walls
On Fri, 24 Nov 2023 06:57:33 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to fix the issue >> noted in https://bugs.openjdk.org/browse/JDK-8320687? >> >> As noted in the issue, the >> `sun.jvmstat.monitor.MonitoredHost.getMonitoredHost()` uses a shared >

RFR: 8320532: Remove Thread/ThreadGroup suspend/resume

2023-11-24 Thread Alan Bateman
The deadlock prone Thread/ThreadGroup suspend/resume were deprecated since JDK 1.2, deprecated for removal in Java 14, and re-specified/degraded to throw UnsupportedOperationException unconditionally in Java 19/20. Early in Java 23 seems a fine time to finally remove these methods. Corpus anal

Re: RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v12]

2023-11-24 Thread Johan Sjölen
On Thu, 23 Nov 2023 16:11:32 GMT, Afshin Zafari wrote: >> The `find` method now is >> ```C++ >> template >> int find(T* token, bool f(T*, E)) const { >> ... >> >> Any other functions which use this are also changed. >> Local linux-x64-debug hotspot:tier1 passed. Mach5 tier1 build on linux and

Re: RFR: 8320515: assert(monitor->object_peek() != nullptr) failed: Owned monitors should not have a dead object [v5]

2023-11-24 Thread Stefan Karlsson
> In the rewrites made for: > [JDK-8318757](https://bugs.openjdk.org/browse/JDK-8318757) `VM_ThreadDump > asserts in interleaved ObjectMonitor::deflate_monitor calls` > > I removed the filtering of *owned ObjectMonitors with dead objects*. The > reasoning was that you should never have an owned

Re: RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v3]

2023-11-24 Thread Stefan Karlsson
On Fri, 24 Nov 2023 07:59:51 GMT, Afshin Zafari wrote: > > @afshin-zafari I'm happy to hear the code is now cleaner and nicer, but > > AFAICS this new version of the code has only had a single review. It should > > really have been re-reviewed by at least one of the earlier reviewers. > > Than

Re: RFR: 8320515: assert(monitor->object_peek() != nullptr) failed: Owned monitors should not have a dead object [v4]

2023-11-24 Thread Stefan Karlsson
On Fri, 24 Nov 2023 06:43:35 GMT, David Holmes wrote: >> I provoked test failures for all paths I filtered. If I remove this check >> and run: >> >> make -C ../build/fastdebug test >> TEST=test/hotspot/jtreg/runtime/Monitor/IterateMonitorWithDeadObjectTest.java >> JTREG="JAVA_OPTIONS=-XX:+Use

Re: RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v3]

2023-11-24 Thread Afshin Zafari
On Thu, 23 Nov 2023 22:15:35 GMT, Afshin Zafari wrote: >>> I still approve of this patch as it's better than what we had before. There >>> are a lot of suggested improvements that can be done either in this PR or >>> in a future RFE. `git blame` shows that this hasn't been touched since >>> 20