RFR: 8345569: [ubsan] filemap.cpp:2215:47: runtime error: applying non-zero offset 34358689792 to null pointer

David Holmes dholmes at openjdk.org
Mon Dec 9 02:18:38 UTC 2024


On Fri, 6 Dec 2024 10:22:04 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> error: applying non-zero offset to non-null pointer 0x000080000000 produced null pointer

So that sounds like signed arithmetic is being performed instead of unsigned.

src/hotspot/share/cds/filemap.cpp line 2248:

> 2246:     // the value P can remain 0x1200. The decoded address = (0x4000 + (0x1200 << 0)) = 0x5200,
> 2247:     // which is the runtime location of the referenced object.
> 2248:     return /*runtime*/ (address)((uintptr_t)CompressedOops::base() + r->mapping_offset());

If `base()` can return 0 (nullptr) then how does the casting help with the warning?

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

PR Comment: https://git.openjdk.org/jdk/pull/22603#issuecomment-2526659081
PR Review Comment: https://git.openjdk.org/jdk/pull/22603#discussion_r1875185094


More information about the hotspot-runtime-dev mailing list