Skip to content

8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support#2271

Open
plummercj wants to merge 4 commits intoopenjdk:lworldfrom
plummercj:8381115_flat_arrays
Open

8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support#2271
plummercj wants to merge 4 commits intoopenjdk:lworldfrom
plummercj:8381115_flat_arrays

Conversation

@plummercj
Copy link
Copy Markdown
Contributor

@plummercj plummercj commented Mar 27, 2026

Although SA has some FlatArrayKlass support, it is mostly incomplete. This is causing heap walking to abort when a flattened array of value objects is encountered. 4 SA tests are failing in non-obvious ways because of this.

JDK-8380769 [lworld] resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java fails with 'truncating to' missing from stdout/stderr with --enable-preview
JDK-8380851 [lworld] serviceability/sa/ClhsdbJstackWithConcurrentLock.java fails with "', (a java/util/concurrent/locks/ReentrantLock$NonfairSync)' not found in jstack output" when using --enable-preview
JDK-8380852 [lworld] serviceability/sa/CDSJMapClstats.java fails with "'BootClassLoader' missing from stdout/stderr" with "-XX:-UseCompressedOops --enable-preview"
JDK-8380853 [lworld] serviceability/sa/ClhsdbJhisto.java fails with "'java.nio.HeapByteBuffer' missing from stdout/stderr" with "-XX:-UseCompressedOops --enable-preview"

The main shortcoming is that there is no FlatArray type in SA yet, and also the code to instantiate it is missing in the following:

  public Oop newOop(OopHandle handle) {
...
    Klass klass = Oop.getKlassForOopHandle(handle);
    if (klass != null) {
      if (klass instanceof TypeArrayKlass) return new TypeArray(handle, this);
 + if (klass instanceof FlatArrayKlass) return new FlatArray(handle, this);
      if (klass instanceof ObjArrayKlass) return new ObjArray(handle, this);
      if (klass instanceof InstanceKlass) return new Instance(handle, this);
    }
    throw new UnknownOopException(handle.toString());
  }

Without the added code, this method throws UnknownOopException when it encounters a flattened array. That in turn causes the heap walking to stop scanning the region it is in, thinking that it has reached the top of the used part of the region. See ObjectHeap.iterateLiveRegions().

Tested tier1, tier2 svc, and tier5 svc CI testing with and w/o --enable-preview. Did tier5, tier6, and tier7 with --enable-preview on linux-x64-debug only.


Progress

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

Issue

  • JDK-8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2271

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2271.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 27, 2026

👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into lworld 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 Mar 27, 2026

@plummercj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support

Reviewed-by: amenkov

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 224 new commits pushed to the lworld branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title 8381115 8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support Mar 27, 2026
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 27, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 27, 2026

Webrevs

Copy link
Copy Markdown

@alexmenkov alexmenkov left a comment

Choose a reason for hiding this comment

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

Looks good.
I added a note about comment for the class, also Array class has
// Array is an abstract superclass for TypeArray and ObjArray
FlatArray can be added there, or the comment can be generalized, smth like 'super class for different array classes'

import sun.jvm.hotspot.utilities.Observable;
import sun.jvm.hotspot.utilities.Observer;

// A FlatArray is an array containing flattened value types.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
// A FlatArray is an array containing flattened value types.
// A FlatArray is an array containing flattened value objects.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants