Skip to content

8390546: C2: EncodeISOArray intrinsic uses incorrect destination memory alias - #32425

Closed
TobiHartmann wants to merge 1 commit into
openjdk:jdk27from
TobiHartmann:8390546_bp
Closed

8390546: C2: EncodeISOArray intrinsic uses incorrect destination memory alias#32425
TobiHartmann wants to merge 1 commit into
openjdk:jdk27from
TobiHartmann:8390546_bp

Conversation

@TobiHartmann

@TobiHartmann TobiHartmann commented Aug 18, 2026

Copy link
Copy Markdown
Member

This is a regression from JDK-8373591 in JDK 27-ea+24. LibraryCallKit::inline_encodeISOArray passes src_type and dst_type to capture_memory() and memory_effect(). When used as memory address types, these array oop types have offset zero and therefore alias the array header rather than its payload.

As a result, C2 does not connect the intrinsic to the BYTES memory slice and later loads from that slice can observe the pre-intrinsic state or stale memory. This affects _encodeAsciiArray, _encodeISOArray and _encodeByteISOArray.

The fix is to pass the array body types to both helpers. I verified that all sub tests fail without the fix and pass with the fix on both Linux x64 and Linux AArch64.

Many thanks to Lorenzo Dematte lorenzo.dematte@protonmail.com who originally reported this and provided a reproducer that I incorporated into the test.

Thanks,
Tobias



Progress

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

Issue

  • JDK-8390546: C2: EncodeISOArray intrinsic uses incorrect destination memory alias (Bug - P1) ⚠️ Issue is not open.

Contributors

  • Lorenzo Dematte <lorenzo.dematte@protonmail.com>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32425

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

Using diff file

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

@bridgekeeper

bridgekeeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into jdk27 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 Aug 18, 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 hotspot-compiler hotspot-compiler-dev@openjdk.org label Aug 18, 2026
@openjdk

openjdk Bot commented Aug 18, 2026

Copy link
Copy Markdown

@TobiHartmann The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk

openjdk Bot commented Aug 18, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-compiler. This can be overridden with the /reviewers command.

@TobiHartmann

Copy link
Copy Markdown
Member Author

/contributor add Lorenzo Dematte lorenzo.dematte@protonmail.com

@openjdk

openjdk Bot commented Aug 18, 2026

Copy link
Copy Markdown

@TobiHartmann
Contributor Lorenzo Dematte <lorenzo.dematte@protonmail.com> successfully added.

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

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant