Skip to content

Conversation

@dtmhuang
Copy link

@dtmhuang dtmhuang commented Jun 30, 2025

Backport for RandomSupport issue. There is a loss of information when using convertSeedBytesToLongs() with a bad seed, causing a lot of the original bytes to be overwritten by 1s. The fix involves using a bitwise AND with the seed before distributing the seed bytes into the result.

Clean backport, ran GHA sanity checks and locally tested tier1, tier2.


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
  • JDK-8294509 needs maintainer approval

Issue

  • JDK-8294509: The sign extension bug applies to 'public static int[] convertSeedBytesToInts(byte[] seed, int n, int z)' in RandomSupport (Bug - P4) ⚠️ Issue is already resolved. Consider making this a "backport pull request" by setting the PR title to Backport <hash> with the hash of the original commit. See Backports.

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3693/head:pull/3693
$ git checkout pull/3693

Update a local copy of the PR:
$ git checkout pull/3693
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3693/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3693

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3693.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 30, 2025

👋 Welcome back dtmhuang! 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
Copy link

openjdk bot commented Jun 30, 2025

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

@dtmhuang dtmhuang changed the title Backport 8294509 random support sign extension 8294509: The sign extension bug applies to 'public static int[] convertSeedBytesToInts(byte[] seed, int n, int z)' in RandomSupport Jun 30, 2025
@dtmhuang dtmhuang marked this pull request as ready for review June 30, 2025 17:00
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 30, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 30, 2025

Webrevs

@openjdk
Copy link

openjdk bot commented Jun 30, 2025

@dtmhuang To use the /backport command, you need to be in the OpenJDK census and your GitHub account needs to be linked with your OpenJDK username (how to associate your GitHub account with your OpenJDK username).

@dtmhuang dtmhuang closed this Jun 30, 2025
@dtmhuang dtmhuang deleted the backport-8294509-RandomSupport-sign-extension branch June 30, 2025 17:11
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

Development

Successfully merging this pull request may close these issues.

1 participant