Skip to content

8373698: [Lilliput] Fix oop-checking with ZGC/CDS and compact headers#212

Open
rkennke wants to merge 2 commits intoopenjdk:masterfrom
rkennke:JDK-8373698
Open

8373698: [Lilliput] Fix oop-checking with ZGC/CDS and compact headers#212
rkennke wants to merge 2 commits intoopenjdk:masterfrom
rkennke:JDK-8373698

Conversation

@rkennke
Copy link
Copy Markdown
Collaborator

@rkennke rkennke commented Apr 2, 2026

UnsafeIntrinsicsTest.java (and some others) are failing with +COH and ZGC. The reason is:

  1. archive_object_size() (aotStreamedHeapLoader.cpp:159) operates on oopDesc* pointers to archived objects in CDS shared memory (not the GC
    heap)
  2. The COH code at lines 169 and 182 calls klass->expand_for_hash(archive_object, ...) which takes an oop parameter
  3. The implicit oopDesc* → oop conversion calls on_construction() which validates the address via ZGC's check_is_valid_zaddress()
  4. ZGC requires addresses to have the heap base bit set (zAddress.inline.hpp:450) and be within heap range (:456), but CDS objects are
    outside ZGC's virtual address space

The fix is to temporarily disable oop-checking around the affected code, because those are not real oops in the Java heap.

The alternative would have been to change all the i-hash-functions to accept oopDesc* instead of oop, but that would disable the oop-check wholesale, even for valid heap objects, which is not what we want.

Testing:

  • UnsafeIntrinsicsTest.java
  • tier1 +UCOH
  • tier1 -UCOH

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8373698: [Lilliput] Fix oop-checking with ZGC/CDS and compact headers (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/lilliput.git pull/212/head:pull/212
$ git checkout pull/212

Update a local copy of the PR:
$ git checkout pull/212
$ git pull https://git.openjdk.org/lilliput.git pull/212/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 212

View PR using the GUI difftool:
$ git pr show -t 212

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/lilliput/pull/212.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Apr 2, 2026

👋 Welcome back rkennke! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 2, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Apr 2, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Apr 2, 2026

Webrevs

Comment thread src/hotspot/share/cds/aotStreamedHeapLoader.cpp Outdated
Comment thread src/hotspot/share/cds/aotStreamedHeapLoader.cpp Outdated
Comment on lines +167 to +168
SuspendCheckOopFunction() : _saved(check_oop_function) { check_oop_function = nullptr; }
~SuspendCheckOopFunction() { check_oop_function = _saved; }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the threading model here - are you happy that this will not be used concurrently?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

archive-loading is single-threaded, so we should be ok, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants