Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-27 Thread Axel Boldt-Christmas
On Thu, 21 Sep 2023 06:21:25 GMT, Axel Boldt-Christmas wrote: >> ObjectMonitorIterator fails to return the most resent monitor added. It >> start with returning the `nextOM()` ObjectMonitor from the `_head` >> ObjectMonitor but fails to ever return the `_head` ObjectMonitor. >> The current imp

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread David Holmes
On Thu, 21 Sep 2023 06:21:25 GMT, Axel Boldt-Christmas wrote: >> ObjectMonitorIterator fails to return the most resent monitor added. It >> start with returning the `nextOM()` ObjectMonitor from the `_head` >> ObjectMonitor but fails to ever return the `_head` ObjectMonitor. >> The current imp

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread David Holmes
On Mon, 25 Sep 2023 14:26:00 GMT, Chris Plummer wrote: >> It is not. It is the value of `_head` when ObjectSynchronizer is >> initialised. My understanding of the serviceability agent is very limited, >> but from what I understood the JVM does not run when we are attached. So no >> code should

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread David Holmes
On Mon, 25 Sep 2023 10:19:19 GMT, Axel Boldt-Christmas wrote: >> test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java line 1: >> >>> 1: /* >> >> This test still barely actually tests the iterator code. > > Agreed. Did not want to spend time learning the SA, but maybe I should. So

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread Chris Plummer
On Mon, 25 Sep 2023 14:33:15 GMT, Chris Plummer wrote: > This code is called when you choose the hsdb "Tools -> Monitor Cache Dump" > menu item. Have you tried doing that? I tried running it against a clhsdb > process, and currently it doesn't seem to show any monitors. Does it show one > afte

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread Chris Plummer
On Thu, 21 Sep 2023 06:21:25 GMT, Axel Boldt-Christmas wrote: >> ObjectMonitorIterator fails to return the most resent monitor added. It >> start with returning the `nextOM()` ObjectMonitor from the `_head` >> ObjectMonitor but fails to ever return the `_head` ObjectMonitor. >> The current imp

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread Chris Plummer
On Mon, 25 Sep 2023 10:05:12 GMT, Axel Boldt-Christmas wrote: > My understanding of the serviceability agent is very limited, but from what I > understood the JVM does not run when we are attached. So no code should add > to the list. Your understanding is correct, although one thing SA has t

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread Axel Boldt-Christmas
On Mon, 25 Sep 2023 03:40:53 GMT, David Holmes wrote: >> Axel Boldt-Christmas has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update copyright year > > test/hotspot/jtreg/serviceability/sa/TestObjectMonitorIterate.java line 1: > >> 1: /

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-25 Thread Axel Boldt-Christmas
On Mon, 25 Sep 2023 02:08:36 GMT, David Holmes wrote: >> Axel Boldt-Christmas has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update copyright year > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java >

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-24 Thread David Holmes
On Thu, 21 Sep 2023 06:21:25 GMT, Axel Boldt-Christmas wrote: >> ObjectMonitorIterator fails to return the most resent monitor added. It >> start with returning the `nextOM()` ObjectMonitor from the `_head` >> ObjectMonitor but fails to ever return the `_head` ObjectMonitor. >> The current imp

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-21 Thread Chris Plummer
On Thu, 21 Sep 2023 06:21:13 GMT, Axel Boldt-Christmas wrote: >> `inUseList` will end up with the same value as `inUseListHead`. The reason >> the old code worked is because `getAddressField` does not type check and >> `reinterpret_cast(&ObjectSynchronizer::_in_use_list) == >> reinterpret_cas

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-21 Thread Chris Plummer
On Thu, 21 Sep 2023 06:21:25 GMT, Axel Boldt-Christmas wrote: >> ObjectMonitorIterator fails to return the most resent monitor added. It >> start with returning the `nextOM()` ObjectMonitor from the `_head` >> ObjectMonitor but fails to ever return the `_head` ObjectMonitor. >> The current imp

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-20 Thread Axel Boldt-Christmas
On Thu, 21 Sep 2023 06:11:42 GMT, Axel Boldt-Christmas wrote: >> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java >> line 86: >> >>> 84: >>> 85: ObjectMonitorIterator() { >>> 86: mon = new ObjectMonitor(inUseList); >> >> How did this ever work? `i

Re: RFR: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists [v6]

2023-09-20 Thread Axel Boldt-Christmas
> ObjectMonitorIterator fails to return the most resent monitor added. It start > with returning the `nextOM()` ObjectMonitor from the `_head` ObjectMonitor > but fails to ever return the `_head` ObjectMonitor. > The current implementation can also not handle that the `_head` is nullptr > (no mo