Integrated: 8366341: [BACKOUT] JDK-8365256: RelocIterator should use indexes instead of pointers
Johan Sjölen
jsjolen at openjdk.org
Thu Aug 28 12:17:50 UTC 2025
On Thu, 28 Aug 2025 10:59:06 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
> Hi,
>
> When a null pointer is accessed in SA it's serialized into the null Java object, this in turn causes runtime NPE:s when attempts are made to perform arithmetic on them. As we changed `_immutable_data` to be null when missing, this hits that corner case in the SA.
>
> Example of code which fails:
>
>
> public PCDesc getPCDescAt(Address pc) {
> // NOTE: scopesPCsBegin() depends on the value of _immutable_data and will throw NPE if immutable_data is null
> for (Address p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize)) {
> PCDesc pcDesc = new PCDesc(p);
> if (pcDesc.getRealPC(this).equals(pc)) {
> return pcDesc;
> }
> }
> return null;
> }
>
>
> There are similar iterators in Hotspot code, they will cause UBSAN to complain instead as we're adding something to a null pointer.
>
> The "real fix" requires a lot of work on the SA side, and we cannot prioritize that. Instead, I'm backing out my changes.
This pull request has now been integrated.
Changeset: 5c78c7cd
Author: Johan Sjölen <jsjolen at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/5c78c7cd83d2d1ca1ba19151d6be40f5bd6077c8
Stats: 88 lines in 4 files changed: 24 ins; 19 del; 45 mod
8366341: [BACKOUT] JDK-8365256: RelocIterator should use indexes instead of pointers
Reviewed-by: ayang
-------------
PR: https://git.openjdk.org/jdk/pull/26984
More information about the hotspot-compiler-dev
mailing list