8388799: ClhsdbLongConstant should not assert a specific value for VM_Version::CPU_SHA - #32017
8388799: ClhsdbLongConstant should not assert a specific value for VM_Version::CPU_SHA#32017shivshah-oracle wants to merge 1 commit into
Conversation
…_Version::CPU_SHA
|
👋 Welcome back shivshah-oracle! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@shivshah-oracle The following label will be automatically applied to this pull request:
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. |
|
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 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. |
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
longConstantoutput 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
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32017/head:pull/32017$ git checkout pull/32017Update a local copy of the PR:
$ git checkout pull/32017$ git pull https://git.openjdk.org/jdk.git pull/32017/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32017View PR using the GUI difftool:
$ git pr show -t 32017Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32017.diff
Using Webrev
Link to Webrev Comment