RFR: 8289745: JfrStructCopyFailed uses heap words instead of bytes for object sizes

Thomas Stuefe stuefe at openjdk.org
Wed Jul 6 13:40:33 UTC 2022


On Tue, 5 Jul 2022 14:08:24 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

> The values for smallestSize, firstSize and totalSize in the CopyFailed type are set as the number of heap words, but should be number of bytes. This leads to wrong values in the PromotionFailed and EvacuationFailed JFR events containing this type.

Good catch. IIUC this issue is a day zero bug, right? Bit scary that this was not found before.

test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java line 56:

> 54:             System.out.println("Event: " + event);
> 55:             long smallestSize = Events.assertField(event, "promotionFailed.smallestSize").atLeast(1L).getValue();
> 56:             Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size.");

Testing for alignment is a good pragmatic way to check for regressions without adding more logic.

Do the numbers include object headers? If yes, we could assert to >= 8 at least.

-------------

Marked as reviewed by stuefe (Reviewer).

PR: https://git.openjdk.org/jdk/pull/9378


More information about the hotspot-dev mailing list