Re: RFR: 8281267: VM HeapDumper dumps array classes several times [v3]

2022-02-15 Thread Alex Menkov
On Tue, 15 Feb 2022 06:10:57 GMT, Chris Plummer wrote: > The changes look good. Have you verified that after your most recent changes > you get the same sized hprof file as with your initial changes? Thank you for the review. I verified number of classes (HPROF_LOAD_CLASS and HPROF_GC_CLASS_DUM

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Tue, 15 Feb 2022 06:36:36 GMT, Chris Plummer wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 100: >> >>> 98: struct bag* deleted = deletedSignatures; >>> 99: deletedSignatures = NULL; >>> 100: debugMonitorExit(classTrackLock); >> >> This looks risky as the cri

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
> There are scenarios that JDWP agent can deadlock on `classTrackLock` monitor. > Following is the scenario in bug report. > > **Java Thread** > - loads a class and post `JVMTI_EVENT_CLASS_PREPARE` event > - JDWP event callback handler calls `classTrack_processUnloads()` to handle > the event

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Mon, 14 Feb 2022 23:26:17 GMT, David Holmes wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> David and Chris' comments > > src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 215: > >> 213: classTrack_activa

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Tue, 15 Feb 2022 06:31:46 GMT, Chris Plummer wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> David and Chris' comments > > src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 65: > >> 63: * handler may acq

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Chris Plummer
On Tue, 15 Feb 2022 17:48:43 GMT, Zhengyu Gu wrote: >> There are scenarios that JDWP agent can deadlock on `classTrackLock` >> monitor. Following is the scenario in bug report. >> >> **Java Thread** >> - loads a class and post `JVMTI_EVENT_CLASS_PREPARE` event >> - JDWP event callback handle

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Chris Plummer
On Tue, 15 Feb 2022 17:50:19 GMT, Zhengyu Gu wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 215: >> >>> 213: classTrack_activate(JNIEnv *env) >>> 214: { >>> 215: struct bag* new_bag = bagCreateBag(sizeof(char*), 1000); >> >> I don't think there can be any race during ac

RFR: 8281879: Serial: Merge CardGeneration into TenuredGeneration

2022-02-15 Thread Albert Mingkun Yang
Mostly mechanical changes; `git diff --color-moved=zebra` probably helps to see the actual (small) change, such as dropping the `virtual` modifier, introducing small helper methods to avoid naming collision, etc. Test: tier1-6 - Commit messages: - flatten-cardgen Changes: https:/

Re: RFR: 8281615: Deadlock caused by jdwp agent [v3]

2022-02-15 Thread Zhengyu Gu
> There are scenarios that JDWP agent can deadlock on `classTrackLock` monitor. > Following is the scenario in bug report. > > **Java Thread** > - loads a class and post `JVMTI_EVENT_CLASS_PREPARE` event > - JDWP event callback handler calls `classTrack_processUnloads()` to handle > the event

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Tue, 15 Feb 2022 20:02:50 GMT, Chris Plummer wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> David and Chris' comments > > src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 111: > >> 109: } >> 110:

Re: RFR: 8281615: Deadlock caused by jdwp agent [v4]

2022-02-15 Thread Zhengyu Gu
> There are scenarios that JDWP agent can deadlock on `classTrackLock` monitor. > Following is the scenario in bug report. > > **Java Thread** > - loads a class and post `JVMTI_EVENT_CLASS_PREPARE` event > - JDWP event callback handler calls `classTrack_processUnloads()` to handle > the event

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Tue, 15 Feb 2022 20:08:19 GMT, Chris Plummer wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> David and Chris' comments > > src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 112: > >> 110: debugMonit

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Chris Plummer
On Wed, 16 Feb 2022 00:17:46 GMT, Zhengyu Gu wrote: > I am not sure if it is possible, but checking bagSize(deletedSignatures) == 0 > seems to race against classTrack_reset() where it does not take handlerLock > lock. I had thought of that too, but I think the way `classTrack_reset()` is calle

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Zhengyu Gu
On Wed, 16 Feb 2022 00:53:27 GMT, Chris Plummer wrote: >> I am not sure if it is possible, but checking `bagSize(deletedSignatures) == >> 0` seems to race against `classTrack_reset()` where it does not take >> `handlerLock` lock. > >> I am not sure if it is possible, but checking bagSize(delete

Re: RFR: 8281615: Deadlock caused by jdwp agent [v2]

2022-02-15 Thread Chris Plummer
On Wed, 16 Feb 2022 01:17:12 GMT, Zhengyu Gu wrote: >>> I am not sure if it is possible, but checking bagSize(deletedSignatures) == >>> 0 seems to race against classTrack_reset() where it does not take >>> handlerLock lock. >> >> I had thought of that too, but I think the way `classTrack_reset