Skip to content

8388799: ClhsdbLongConstant should not assert a specific value for VM_Version::CPU_SHA - #32017

Open
shivshah-oracle wants to merge 1 commit into
openjdk:masterfrom
shivshah-oracle:JDK-8388799
Open

8388799: ClhsdbLongConstant should not assert a specific value for VM_Version::CPU_SHA#32017
shivshah-oracle wants to merge 1 commit into
openjdk:masterfrom
shivshah-oracle:JDK-8388799

Conversation

@shivshah-oracle

@shivshah-oracle shivshah-oracle commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

serviceability/sa/ClhsdbLongConstant.java asserts an exact value for VM_Version::CPU_SHA in checkForTruncation(). CPU_SHA is a feature-flag bit index in vm_version_x86.hpp whose value shifts whenever a CPU feature is added, so the hardcoded expectation goes stale and the test fails (it has already been bumped once, and the in-file comment lists yet another value).

This check exists only to confirm the longConstant output was not truncated, using CPU_SHA as a sentinel that appears late in the output, the exact value is irrelevant to that purpose. SA reads the value correctly from the VM in every case.

Change checkForTruncation() to verify the constant is present with a parseable long value (checkLongValuePresent) instead of asserting a specific number, so the check no longer breaks on every feature-flag change. The markWord::hash_mask_in_place assertion is unchanged, since that value is derived from a stable definition.

Testing: serviceability/sa/ClhsdbLongConstant.java (x64).



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-8388799: ClhsdbLongConstant should not assert a specific value for VM_Version::CPU_SHA (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32017

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32017.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 22, 2026

Copy link
Copy Markdown

👋 Welcome back shivshah-oracle! 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

openjdk Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the serviceability serviceability-dev@openjdk.org label Jul 22, 2026
@openjdk

openjdk Bot commented Jul 22, 2026

Copy link
Copy Markdown

@shivshah-oracle The following label will be automatically applied to this pull request:

  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@katyapav

Copy link
Copy Markdown
Member

Why the test fails only in container/docker environment? Why no failures in jdk CI?

@shivshah-oracle

Copy link
Copy Markdown
Contributor Author

Why the test fails only in container/docker environment? Why no failures in jdk CI?

What I understand is It's not container-specific… the CPU_SHA check is guarded to x86 and has nothing to do with containers

It's a test-vs-build revision mismatch. The expected value was set to 31 in JDK-8383881 and changed to 33 in JDK-8384869 two weeks later (2026-05-28)

The ATR workspace I ran from still had the pre-8384869 test source, while the pinned build (jdk-27+25) reported CPU_SHA = 33 hence "Expected 31. Obtained 33". The test at tag jdk-27+25 already expects 33, so a from-source
build of that tag passes; this only shows up when a prebuilt JDK is paired with a separately synced test workspace

Since the value has needed updating twice in two weeks, this PR drops the exact-value assertion and just checks the constant is present, which I think is all checkForTruncation needs.

@shivshah-oracle
shivshah-oracle marked this pull request as ready for review July 24, 2026 01:55
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 24, 2026
@mlbridge

mlbridge Bot commented Jul 24, 2026

Copy link
Copy Markdown

Webrevs

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 serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants