[lworld] Integrated: 8364579: [lworld] Null oop fields are not correctly handled in scalarized returns

Tobias Hartmann thartmann at openjdk.org
Fri Aug 22 18:07:09 UTC 2025


On Wed, 20 Aug 2025 05:21:17 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> The test that I wrote for Virtual Thread support (see [JDK-8336845](https://bugs.openjdk.org/browse/JDK-8336845)) triggers various crashes even without Virtual Threads. The problem is that null fields in scalarized returns are not zeroed which makes the GC very unhappy. This affects both x86 as well as AArch64. I added a targeted regression test for this scenario.
> 
> I then noticed that the code that handles oop fields in scalarized returns at safepoints does not correctly handle the case when a value object is returned both in scalarized form **and** as oop:
> https://github.com/openjdk/valhalla/blob/b2e518b7cf85527b90f34ba63bf5a1b775430cd0/src/hotspot/share/runtime/safepoint.cpp#L793-L803
> 
> I fixed this as well, see  changes in `InlineKlass::returned_inline_klass`.
> 
> While testing this fix, I found more issues on AArch64. After debugging for a few days straight, I found multiple issues and filed [JDK-8365996](https://bugs.openjdk.org/browse/JDK-8365996) as a follow-up. For now, I disabled the test on AArch64.
> 
> Thanks,
> Tobias

This pull request has now been integrated.

Changeset: 68b13b46
Author:    Tobias Hartmann <thartmann at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/68b13b46d1f05c22dccb8dc0b5391cc920ceb4fd
Stats:     304 lines in 14 files changed: 273 ins; 5 del; 26 mod

8364579: [lworld] Null oop fields are not correctly handled in scalarized returns

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

PR: https://git.openjdk.org/valhalla/pull/1527


More information about the valhalla-dev mailing list