RFR: 8343140: JfrJavaSupport uses the wrong accessors for sub-int fields
Aleksey Shipilev
shade at openjdk.org
Thu Nov 7 17:20:43 UTC 2024
On Thu, 7 Nov 2024 12:57:20 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> This test fixes the accessor used by `read_boolean_field` to access boolean fields of the `jdk.jfr.internal.dcmd.Argument` record. It also fixes the read accessors for `short` and `char` types, and marks the write accessors for `boolean`, `short` and `char` as unimplemented.
>
> The existing accessor reads the boolean field as int. This results in unaligned access, and probably reads incorrect value on big-endian CPUs.
>
> No new tests. I'm sure a test would be useful, but I have no idea how to write one. Existing tier1-3 tests continue to pass.
Ouch, good find.
src/hotspot/share/jfr/jni/jfrJavaSupport.cpp line 347:
> 345: case T_SHORT:
> 346: Unimplemented();
> 347: break;
Why not implement these, while we are at it?
-------------
PR Review: https://git.openjdk.org/jdk/pull/21952#pullrequestreview-2421678492
PR Review Comment: https://git.openjdk.org/jdk/pull/21952#discussion_r1833081878
More information about the hotspot-jfr-dev
mailing list