RFR: 8331626: unsafe.cpp:162:38: runtime error in index_oop_from_field_offset_long - applying non-zero offset 4563897424 to null pointer [v2]
Martin Doerr
mdoerr at openjdk.org
Mon May 6 09:42:20 UTC 2024
> `index_oop_from_field_offset_long` is sometimes used to access an absolute address by using `p == nullptr`. Unfortunately, `nullptr + byte_offset` implies undefined behavior and should better get fixed. UBSan complains about it (see JBS issue).
> A possible solution is to replace pointer arithmetic by integer arithmetic. We can use unsigned because `assert_field_offset_sane` checks that `byte_offset >= 0`.
Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
Change coding style.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/19087/files
- new: https://git.openjdk.org/jdk/pull/19087/files/24ca3361..c8bc69b9
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=19087&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=19087&range=00-01
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/19087.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19087/head:pull/19087
PR: https://git.openjdk.org/jdk/pull/19087
More information about the hotspot-dev
mailing list