Re: RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-05 Thread Richard Reingruber
On Tue, 5 Oct 2021 20:56:43 GMT, Chris Plummer wrote: >> Regarding threadControl_resumeThread() it does appear that it would block, >> as would threadControl_resumeAll(), which seems problematic in that >> blockOnDebuggerSuspend() won't exit until the suspendCount == 0. So it's >> unclear to m

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-05 Thread Ioi Lam
On Tue, 5 Oct 2021 22:32:30 GMT, Yumin Qi wrote: >> Please review, >> Refactor fundamental CDS FileMapHeader code for reliable reading of basic >> info from shared archive. >> With the change, it makes it possible to read an archive generated by >> different version of hotspot. Also it is p

Re: RFR: 8274621: NullPointerException because listenAddress[0] is null

2021-10-05 Thread Serguei Spitsyn
On Tue, 5 Oct 2021 22:34:38 GMT, Alex Menkov wrote: > The change fixes ProcessTools.startProcess "warmup predicate" synchronization > issue. > Initially the predicate was called only for STDOUT; > From jdk8 it's called for STDERR too (but ProcessTools javadoc was not > updated). > The fix keeps

Re: RFR: 8273929: Remove GzipRandomAccess in heap dump test

2021-10-05 Thread Serguei Spitsyn
On Fri, 17 Sep 2021 08:24:54 GMT, Lin Zang wrote: > The class `GzipRandomAccess` is used to parse heap dump file generated from > `jcmd`/`jmap` tools when testing. > It has the limitation that only gzip file which has "blocksize" header field > could be sucessfully parsed. > We think this class

Integrated: 8274670: Improve version string handling in SA

2021-10-05 Thread Yasumasa Suenaga
On Sun, 3 Oct 2021 13:08:58 GMT, Yasumasa Suenaga wrote: > Use > [java.lang.Runtime.Version](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.Version.html) > to check the version of debugee. > > Currently `checkVMVersion()` in `sun.jvm.hotspot.runtime.VM` has foll

RFR: 8274621: NullPointerException because listenAddress[0] is null

2021-10-05 Thread Alex Menkov
The change fixes ProcessTools.startProcess "warmup predicate" synchronization issue. Initially the predicate was called only for STDOUT; >From jdk8 it's called for STDERR too (but ProcessTools javadoc was not >updated). The fix keeps existing functionality as is (as we have this behavior for a lo

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-05 Thread Yumin Qi
> Please review, > Refactor fundamental CDS FileMapHeader code for reliable reading of basic > info from shared archive. > With the change, it makes it possible to read an archive generated by > different version of hotspot. Also it is possible to automatically generate a > CDS archive If th

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Serguei Spitsyn
On Tue, 5 Oct 2021 20:06:08 GMT, Chris Plummer wrote: >> src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java >> line 881: >> >>> 879: // copy the eventRequests to avoid >>> ConcurrentModificationException >>> 880: for (EventRequest eventRequest : new >>> A

Integrated: 8274797: ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64

2021-10-05 Thread Daniel D . Daugherty
On Tue, 5 Oct 2021 21:39:52 GMT, Daniel D. Daugherty wrote: > A trivial fix to ProblemList > resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java > on macosx-x64. This pull request has now been integrated. Changeset: d4e8712c Author:Daniel D. Daugherty URL: https://git.ope

Re: Integrated: 8274797: ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64

2021-10-05 Thread Daniel D . Daugherty
On Tue, 5 Oct 2021 21:44:40 GMT, Joe Darcy wrote: >> A trivial fix to ProblemList >> resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java >> on macosx-x64. > > Marked as reviewed by darcy (Reviewer). @jddarcy - Thanks for the fast review! - PR: https://git.openjdk.java.ne

Re: Integrated: 8274797: ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64

2021-10-05 Thread Joe Darcy
On Tue, 5 Oct 2021 21:39:52 GMT, Daniel D. Daugherty wrote: > A trivial fix to ProblemList > resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java > on macosx-x64. Marked as reviewed by darcy (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5829

Integrated: 8274797: ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64

2021-10-05 Thread Daniel D . Daugherty
A trivial fix to ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64. - Commit messages: - 8274797: ProblemList resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java on macosx-x64 Changes: https://git.openjdk.java.net/jdk/pull/5829/files

Re: RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-05 Thread Chris Plummer
On Tue, 5 Oct 2021 20:28:36 GMT, Chris Plummer wrote: >>> I'm not so sure this is always safe. It might be fine in the context of >>> resetting the connection, but not during normal debug agent operations. It >>> allows for another event to be processed when the lock is suppose to keep >>> event

Re: RFR: 8269537: memset() is called after operator new [v3]

2021-10-05 Thread Leo Korinth
On Sun, 26 Sep 2021 04:50:07 GMT, Kim Barrett wrote: >> Thanks Ioi for making me adding the assert!!! The sequencing of the >> allocation function and the arguments to the constructor is not what I >> thought, so my "solution" is not working. I am unsure how to resolve this in >> a good way. W

Re: RFR: 8269537: memset() is called after operator new [v3]

2021-10-05 Thread Leo Korinth
> The basic problem is that we are relying on undefined behaviour, as > documented in the code: > > // This whole business of passing information from ResourceObj::operator new > // to the ResourceObj constructor via fields in the "object" is technically > UB. > // But it seems to work within th

Re: RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-05 Thread Chris Plummer
On Tue, 5 Oct 2021 13:54:46 GMT, Richard Reingruber wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 750: >> >>> 748: while (node && node->suspendCount > 0) { >>> 749: /* Resume requires the event handlerLock so we have to >>> release it */ >>> 750:

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Chris Plummer
On Sat, 18 Sep 2021 21:35:41 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Chris Plummer
On Tue, 5 Oct 2021 19:48:06 GMT, Serguei Spitsyn wrote: >> There are few places in code where manual while loop is used with Iterator >> to iterate over Collection. >> Instead of manual while cycles it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier to rea

Re: RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module

2021-10-05 Thread Serguei Spitsyn
On Thu, 16 Sep 2021 20:45:36 GMT, Andrey Turbanov wrote: > Pass cause exception as constructor parameter is shorter and easier to read. I agree with Daniel, it is nice simplification. Looks good. Thanks, Serguei - Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Serguei Spitsyn
On Sat, 18 Sep 2021 21:35:41 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Serguei Spitsyn
On Sat, 18 Sep 2021 21:35:41 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Alex Menkov
On Sat, 18 Sep 2021 21:35:41 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read

Re: RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-05 Thread Richard Reingruber
On Tue, 5 Oct 2021 05:31:37 GMT, Chris Plummer wrote: > I'm not so sure this is always safe. It might be fine in the context of > resetting the connection, but not during normal debug agent operations. It > allows for another event to be processed when the lock is suppose to keep > event processi

Re: RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module

2021-10-05 Thread Daniel Fuchs
On Thu, 16 Sep 2021 20:45:36 GMT, Andrey Turbanov wrote: > Pass cause exception as constructor parameter is shorter and easier to read. Nice simplification. - Marked as reviewed by dfuchs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5552

Re: RFR: 8274716: JDWP Spec: the description for the Dispose command confuses suspend with resume. [v2]

2021-10-05 Thread Serguei Spitsyn
On Tue, 5 Oct 2021 07:38:28 GMT, Richard Reingruber wrote: >> The following sentence in the JDWP Specification describing the Dispose >> command confuses resume with suspend [1]: >> >> All threads suspended by the thread-level **resume** command or the >> VM-level >> **resume** command are

Re: RFR: 8274670: Improve version string handling in SA [v2]

2021-10-05 Thread Serguei Spitsyn
On Mon, 4 Oct 2021 13:02:37 GMT, Yasumasa Suenaga wrote: >> Use >> [java.lang.Runtime.Version](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.Version.html) >> to check the version of debugee. >> >> Currently `checkVMVersion()` in `sun.jvm.hotspot.runtime.VM` has

Re: RFR: 8274716: JDWP Spec: the description for the Dispose command confuses suspend with resume. [v2]

2021-10-05 Thread Richard Reingruber
On Mon, 4 Oct 2021 18:20:42 GMT, Chris Plummer wrote: > > > Can you update the copyright please? Sure, thanks! > I checked the JDI spec and it looks correct there, which is actually > surprising since errors like this usually appear in both specs. Yes I noticed this too. Thanks for reviewi

Re: RFR: 8274716: JDWP Spec: the description for the Dispose command confuses suspend with resume. [v2]

2021-10-05 Thread Richard Reingruber
> The following sentence in the JDWP Specification describing the Dispose > command confuses resume with suspend [1]: > > All threads suspended by the thread-level **resume** command or the VM-level > **resume** command are resumed as many times as necessary for them to run. > > It should be

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Alan Bateman
On Sat, 18 Sep 2021 21:35:41 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read

RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi

2021-10-05 Thread Andrey Turbanov
There are few places in code where manual while loop is used with Iterator to iterate over Collection. Instead of manual while cycles it's preferred to use enhanced-for cycle instead: it's less verbose, makes code easier to read and it's less error-prone. It doesn't have any performance impact: j

RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module

2021-10-05 Thread Andrey Turbanov
Pass cause exception as constructor parameter is shorter and easier to read. - Commit messages: - [PATCH] Cleanup unnecessary calls to Throwable.initCause() in java.management - [PATCH] Cleanup unnecessary calls to Throwable.initCause() in java.management Changes: https://git.openj