8390546: C2: EncodeISOArray intrinsic uses incorrect destination memory alias - #32425
8390546: C2: EncodeISOArray intrinsic uses incorrect destination memory alias#32425TobiHartmann wants to merge 1 commit into
Conversation
|
👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@TobiHartmann 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. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
/contributor add Lorenzo Dematte lorenzo.dematte@protonmail.com |
|
@TobiHartmann |
This is a regression from JDK-8373591 in JDK 27-ea+24.
LibraryCallKit::inline_encodeISOArraypassessrc_typeanddst_typetocapture_memory()andmemory_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
BYTESmemory slice and later loads from that slice can observe the pre-intrinsic state or stale memory. This affects_encodeAsciiArray,_encodeISOArrayand_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
Issue
Contributors
<lorenzo.dematte@protonmail.com>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32425/head:pull/32425$ git checkout pull/32425Update a local copy of the PR:
$ git checkout pull/32425$ git pull https://git.openjdk.org/jdk.git pull/32425/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32425View PR using the GUI difftool:
$ git pr show -t 32425Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32425.diff