Integrated: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Serguei Spitsyn
On Thu, 25 May 2023 14:47:59 GMT, Serguei Spitsyn wrote: > Currently, the `SetLocalXXX` minimal support for virtual threads is defined > for a virtual threads suspended at a breakpoint or single step event. This > enhancement is to extend to virtual threads suspended any event. This make >

Re: RFR: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Serguei Spitsyn
On Thu, 25 May 2023 14:47:59 GMT, Serguei Spitsyn wrote: > Currently, the `SetLocalXXX` minimal support for virtual threads is defined > for a virtual threads suspended at a breakpoint or single step event. This > enhancement is to extend to virtual threads suspended any event. This make >

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-26 Thread Andrei Pangin
On Tue, 23 May 2023 15:32:58 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >>

Re: RFR: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Serguei Spitsyn
On Thu, 25 May 2023 14:47:59 GMT, Serguei Spitsyn wrote: > Currently, the `SetLocalXXX` minimal support for virtual threads is defined > for a virtual threads suspended at a breakpoint or single step event. This > enhancement is to extend to virtual threads suspended any event. This make >

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Martin Doerr
On Fri, 26 May 2023 16:58:41 GMT, Thomas Stuefe wrote: >> The crazy thing is that `malloc` is defined! That means all places where we >> use the term malloc are getting replaced without such a workaround. (E.g. >> for log tags.) > > So, we do this only for malloc? Not for calloc,

Re: RFR: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Chris Plummer
On Thu, 25 May 2023 14:47:59 GMT, Serguei Spitsyn wrote: > Currently, the `SetLocalXXX` minimal support for virtual threads is defined > for a virtual threads suspended at a breakpoint or single step event. This > enhancement is to extend to virtual threads suspended any event. This make >

Re: RFR: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Serguei Spitsyn
On Fri, 26 May 2023 16:46:57 GMT, Chris Plummer wrote: > Does our implementation just require that the virtual thread be suspended and > mounted, but not necessarily at an event? Yes. >If so, do we have a test case for that? The test `serviceability/jvmti/vthread/GetSetLocalTest` has such a

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v28]

2023-05-26 Thread Paul Hohensee
On Fri, 26 May 2023 16:41:32 GMT, Paul Hohensee wrote: >> Please review this addition to com.sun.management.ThreadMXBean that returns >> the total number of bytes allocated on the Java heap since JVM launch by >> both terminated and live threads. >> >> Because this PR adds a new interface

Re: RFR: 8308819: add JDWP and JDI virtual thread support for ThreadReference.ForceEarlyReturn

2023-05-26 Thread Chris Plummer
On Fri, 26 May 2023 07:33:34 GMT, Serguei Spitsyn wrote: > I guess, you are in process to file a CSR for this. CSR is now ready for review. - PR Comment: https://git.openjdk.org/jdk/pull/14167#issuecomment-1564764955

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v28]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 16:41:32 GMT, Paul Hohensee wrote: >> Please review this addition to com.sun.management.ThreadMXBean that returns >> the total number of bytes allocated on the Java heap since JVM launch by >> both terminated and live threads. >> >> Because this PR adds a new interface

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v23]

2023-05-26 Thread Paul Hohensee
On Thu, 25 May 2023 16:38:43 GMT, Mandy Chung wrote: >> The original implementation grabbed this code from, e.g., >> test/jdk/java/lang/management/ThreadMXBean/ThreadUserTime.java. In the >> latter, InterruptedException causes the test to fail, but for some reason >> now lost,

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Thomas Stuefe
On Thu, 25 May 2023 18:18:43 GMT, Martin Doerr wrote: >> src/hotspot/share/utilities/globalDefinitions_xlc.hpp line 47: >> >>> 45: #undef malloc >>> 46: extern void *malloc(size_t) asm("vec_malloc"); >>> 47: #endif >> >> Wow! And I don't mean that in a good way. I'm not questioning

Re: RFR: 8308814: extend SetLocalXXX minimal support for virtual threads

2023-05-26 Thread Chris Plummer
On Thu, 25 May 2023 14:47:59 GMT, Serguei Spitsyn wrote: > Currently, the `SetLocalXXX` minimal support for virtual threads is defined > for a virtual threads suspended at a breakpoint or single step event. This > enhancement is to extend to virtual threads suspended any event. This make >

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v23]

2023-05-26 Thread Paul Hohensee
On Thu, 25 May 2023 09:01:14 GMT, Kevin Walls wrote: >> src/hotspot/share/services/management.cpp line 2104: >> >>> 2102: // the final result can only be short due to (1) threads that >>> start after >>> 2103: // the TLH is created, or (2) terminating threads that escape TLH >>>

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v28]

2023-05-26 Thread Paul Hohensee
> Please review this addition to com.sun.management.ThreadMXBean that returns > the total number of bytes allocated on the Java heap since JVM launch by both > terminated and live threads. > > Because this PR adds a new interface method, I've updated the JMM_VERSION to > 4, but would be happy

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v27]

2023-05-26 Thread Paul Hohensee
On Fri, 26 May 2023 15:37:32 GMT, Paul Hohensee wrote: >> Please review this addition to com.sun.management.ThreadMXBean that returns >> the total number of bytes allocated on the Java heap since JVM launch by >> both terminated and live threads. >> >> Because this PR adds a new interface

Re: RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v27]

2023-05-26 Thread Paul Hohensee
> Please review this addition to com.sun.management.ThreadMXBean that returns > the total number of bytes allocated on the Java heap since JVM launch by both > terminated and live threads. > > Because this PR adds a new interface method, I've updated the JMM_VERSION to > 4, but would be happy

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Martin Doerr
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:18:37 GMT, JoKern65 wrote: > Here are the reasons for the disabled warnings in > make/modules/java.base/lib/CoreLibraries.gmk > DISABLED_WARNINGS_clang_aix_ProcessHandleImpl_unix.c := sign-compare, > DISABLED_WARNINGS_clang_aix := gnu-pointer-arith,

Integrated: 8299665: /proc/self/stat parsing in libmanagement broken by execname with spaces

2023-05-26 Thread Kevin Walls
On Tue, 23 May 2023 20:54:42 GMT, Kevin Walls wrote: > Code that parses /proc/self/stat may be broken if the executable name > contains spaces. > > We have code that does this correctly, and code that does not. > UnixOperatingSystem.c is Linux-specific OS code, and has vread_statdata which >

Re: RFR: 8299665: /proc/self/stat parsing in libmanagement broken by execname with spaces

2023-05-26 Thread Kevin Walls
On Wed, 24 May 2023 23:48:52 GMT, Serguei Spitsyn wrote: >> Code that parses /proc/self/stat may be broken if the executable name >> contains spaces. >> >> We have code that does this correctly, and code that does not. >> UnixOperatingSystem.c is Linux-specific OS code, and has vread_statdata

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:18:37 GMT, JoKern65 wrote: > src/java.base/share/native/libjli/java.c:2311:22: error: format string is not > a string literal [-Werror,-Wformat-nonliteral] vfprintf(stderr, fmt, vl); ^~~ We disable this warning too for clang on all platforms in BUILD_LIBJLI (

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:05:56 GMT, JoKern65 wrote: > src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c:1251:7: error: > '_ALLBSD_SOURCE' is not defined, evaluates to 0 [-Werror,-Wundef] > #elif _ALLBSD_SOURCE > Should probably better be `#elif defined(_ALLBSD_SOURCE)` -

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk > on AIX , we run into various "warnings as errors". > Some of those are in shared codebase and could be addressed by small > adjustments. > A lot of those changes are in hotspot, some might be somewhere else in the

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 07:12:07 GMT, Matthias Baesken wrote: >> This is IBMs declaration of statfs >> `extern int statfs(char *, struct statfs *);` >> So the compiler will not accept a `const char*` >> Indeed I do not know if this ever worked, but my change makes it not worse. > > Here is the

Re: RFR: 8308286 Fix clang warnings in linux code

2023-05-26 Thread Daniel Jeliński
On Wed, 17 May 2023 12:28:47 GMT, Artem Semenov wrote: > When using the clang compiler to build OpenJDk on Linux, we encounter various > "warnings as errors". > They can be fixed with small changes. According to our docs, [clang is a supported compiler for

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code

2023-05-26 Thread Matthias Baesken
On Thu, 25 May 2023 16:13:49 GMT, JoKern65 wrote: >> test/jdk/java/io/File/libGetXSpace.c line 128: >> >>> 126: #else >>> 127: struct statfs buf; >>> 128: int result = statfs((char*)chars, ); >> >> Is this working around a bug in IBM's declaration? >> >> Also, pre-existing, the cast

Re: RFR: 8308819: add JDWP and JDI virtual thread support for ThreadReference.ForceEarlyReturn

2023-05-26 Thread Serguei Spitsyn
On Fri, 26 May 2023 03:21:12 GMT, Chris Plummer wrote: > Improve ThreadReference.ForceEarlyReturn to support virtual threads as long > as they are suspended and mounted. > > [JDK-8308400](https://bugs.openjdk.org/browse/JDK-8308400) improved JVMTI > ForceEarlyReturn support for virtual

RE: [External] : Re: Proposal: Add overwrite heapdump flag to java

2023-05-26 Thread Kevin Walls
Hi, (I put this in the PR, but maybe drafts don’t get updates put on the mailing list?) HeapDumpOverwrite sounds quite general, there are different ways of heap dumping and this doesn't affect all of them. This could be HeapDumpOnOutOfMemoryErrorOverwrite, which is a long option even for us