RFR: 8336256: memcpy short value to int local is incorrect in VtableStubs::unsafe_hash

Richard Reingruber rrich at openjdk.org
Fri Jul 12 08:18:54 UTC 2024


On Fri, 12 Jul 2024 07:59:32 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Was that a big endian problem?

We got the crashes given in the JBS issue (see above) when building on PPC64 big endian (AIX and Linux).
I do think this is also incorrect with little endian order since excessive bytes after `VtableStub::_index` are copied into the local variable `vtable_index`. On LE the excessive bytes are in the high word of `vtable_index`. Maybe they are masked out by the hash function. On BE the excessive bytes end up in the low word and the short value from `_index` ends up in the high word of `vtable_index` and the hash function would mask away the bytes from `_index`.

@offamitkumar have you observed the issues too on S390?

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

PR Comment: https://git.openjdk.org/jdk/pull/20137#issuecomment-2225063573


More information about the hotspot-compiler-dev mailing list