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

2022-02-16 Thread Leo Korinth
On Wed, 20 Oct 2021 09:36:38 GMT, Leo Korinth wrote: >> 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 "objec

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

2022-02-16 Thread Coleen Phillimore
On Mon, 14 Feb 2022 13:05:52 GMT, Alex Menkov wrote: >> ClassLoaderDataGraph::classes_do description says: >> // Walking classes through the ClassLoaderDataGraph include array classes. >> So do_load_class callback should not dump arrays for the classes and dumper >> doesn't need to call Universe

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

2022-02-16 Thread David Holmes
On Tue, 15 Feb 2022 20:17:09 GMT, Chris Plummer wrote: >> I am not sure classTrack_activate() has the problem, but it is called >> outside of initialization, inside debug loop ... so I assume that event >> callback might happen. > > I agree. This code is called when the debug agent receives a C

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

2022-02-16 Thread David Holmes
On Thu, 17 Feb 2022 02:11:13 GMT, David Holmes wrote: >> I agree. This code is called when the debug agent receives a CLASS_UNLOAD >> EventRequest (which the debug agent handles by requesting JVMTI GC_FINISH >> events). So there is nothing that prevents `classTrack_processUnloads()` >> from be

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

2022-02-16 Thread David Holmes
On Thu, 17 Feb 2022 02:14:05 GMT, David Holmes wrote: >> In that case the `classTrack_processUnloads` is racing with the >> `classTrack_activate` call. I would not expect it to be possible to generate >> an event in relation to this before things have been "activated". But moving >> on ... > >

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

2022-02-16 Thread David Holmes
On Wed, 16 Feb 2022 00:16:48 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 [v4]

2022-02-16 Thread Chris Plummer
On Thu, 17 Feb 2022 02:16:41 GMT, David Holmes wrote: >> Okay I see from later comments that in fact no such race exists, but we have >> to synchronize with cbTrackingObjectFree > > Bah! But then a comment after that says it does exist again. > > There seem to be issues understanding exactly wh

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

2022-02-16 Thread Chris Plummer
On Thu, 17 Feb 2022 05:21:06 GMT, Chris Plummer wrote: >> Bah! But then a comment after that says it does exist again. >> >> There seem to be issues understanding exactly what the concurrent call >> sequences can be with this code. > > I think you might be confusing `classTrack_activate()` with

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

2022-02-16 Thread Chris Plummer
On Wed, 16 Feb 2022 00:16:48 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 [v4]

2022-02-16 Thread Chris Plummer
On Wed, 16 Feb 2022 00:16:48 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 [v4]

2022-02-16 Thread David Holmes
On Thu, 17 Feb 2022 06:57:07 GMT, Chris Plummer wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify classTrack_reset and revert bagSize check > > Actually a bit of a correction to my last statement above. proces