RFR: 8297402: jfr tool processes large padded integers incorrectly

Ekaterina Vergizova evergizova at openjdk.org
Tue Nov 22 15:14:33 UTC 2022


Could I have a review of a PR that fixes jfr tool reading of large padded integers.

Some integer values are written to jfr recordings using write_padded_at_offset<u4>() method. Their size in recording is always 4 bytes.
jfr tool reads all integer values by readInt() method, which doesn't take size into account.
For padded values greater than (1 << 28), jfr tool tries to read 5 bytes from recording and fails.

I suggest to fix reading of padded integers in jfr tool.
If a value is written by write_padded_at_offset<u4>() then it should be read by readPaddedInt() method which doesn't read more than 4 bytes.
(It can be less then 4 bytes due to JDK-8246260)

Tested with jdk/jfr and tier1.
jfr recording generated by TestHugeStackTracePool.java with jdk11 (attached to JDK-8297402) is successfully processed by jfr tool after the fix.

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

Commit messages:
 - 8297402: jfr tool processes large padded integers incorrectly

Changes: https://git.openjdk.org/jdk/pull/11289/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11289&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297402
  Stats: 27 lines in 5 files changed: 20 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/11289.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11289/head:pull/11289

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


More information about the hotspot-jfr-dev mailing list