RFR: 8275021: Test serviceability/sa/TestJmapCore.java fails with: java.io.IOException: Stack frame 0x4 not found

David Holmes dholmes at openjdk.java.net
Mon Oct 11 12:20:09 UTC 2021


On Mon, 11 Oct 2021 10:25:01 GMT, Lin Zang <lzang at openjdk.org> wrote:

> The root cause for the fail is that there must be a flush for `BufferedOutputStream` before getting the `pos` of the file, otherwise the data length is wrongly calculated.

Fix seems good. Suggestion on the comment.

Thanks,
David

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java line 619:

> 617:             out.writeInt(0);
> 618:             // remember position of dump length, we will fixup
> 619:             // length later - hprof format require length.

The comment is not very clear to me. I suggest per your description, to simply say:
// We must flush all data to the file before reading the current file position.

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5890


More information about the serviceability-dev mailing list