jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

8287003: InputStreamReader::read() can return zero despite writing a char in the buffer

Open toddjonker opened this issue 1 year ago • 5 comments
trafficstars

Backports a fix for a potential data-loss defect from JDK19 to JDK17.

This change is not clean, but the conflict is minimal and localized to StreamDecoder.java.

Viewing this diff alongside the original fix here and expanding context upward a bit should be illuminating. The conflict is due to structural/indentation difference when the lock acquisition at L158 was hoisted into a separate method. That happened here (wherein this file has an ugly diff obscuring relatively simple changes).

Additional testing:

  • [x] New regression test fails without the fix, passes with it
  • [x] linux-x86_64-server-release: JTREG_KEYWORDS="\!headful & \!external-dep & \!printer" make test (tier1-3)

Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8287003 needs maintainer approval
  • [x] Commit message must refer to an issue

Error

 ⚠️ OCA signatory status must be verified

Issue

  • JDK-8287003: InputStreamReader::read() can return zero despite writing a char in the buffer (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2726

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

Using diff file

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

toddjonker avatar Jul 18 '24 22:07 toddjonker

Hi @toddjonker, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user toddjonker" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

bridgekeeper[bot] avatar Jul 18 '24 22:07 bridgekeeper[bot]

@toddjonker This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8287003: InputStreamReader::read() can return zero despite writing a char in the buffer

Reviewed-by: phh

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 38 new commits pushed to the master branch:

  • a9d755ca35b6bd952c5e48c2975d1c813cb5b0cd: 8336342: Fix known X11 library locations in sysroot
  • 7374e7d9060abc9519180aeeb7f0a6f1234e62e7: 8336343: Add more known sysroot library locations for ALSA
  • fd38e86f84b0c1044ef6fce3836fc319e3df646e: 8338286: GHA: Demote x86_32 to hotspot build only
  • ada58fa55bb265aa62bbe9389d08cbc39e3e32e0: 8336854: CAInterop.java#actalisauthenticationrootca conflicted with /manual and /timeout
  • 6f382d1fcfb514ab11e991ceb3c94967e8cbc054: 8332903: ubsan: opto/output.cpp:1002:18: runtime error: load of value 171, which is not a valid value for type 'bool'
  • e50b81503b0ee3cd3116345ff6bf31fa591dd3fc: 8339081: Bump update version for OpenJDK: jdk-17.0.14
  • 99b7468ef39571d5276b071f7040e2dfb01f703c: 8330814: Cleanups for KeepAliveCache tests
  • 03cbfaa733bc6a59da6ba5c0d0918245e534752a: 8315024: Vector API FP reduction tests should not test for exact equality
  • 803c2c27d88ee0948611f11f1d099d7fe5c7d593: 8302800: Augment NaN handling tests of FDLIBM methods
  • cd0bb4d31ee53947234c717782f9d9bf9b488986: 8310683: Refactor StandardCharset/standard.java to use JUnit
  • ... and 28 more: https://git.openjdk.org/jdk17u-dev/compare/2e9152dc268ee946680f274c9e6006edfb8d0398...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@phohensee) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

openjdk[bot] avatar Jul 18 '24 22:07 openjdk[bot]

This backport pull request has now been updated with issue from the original commit.

openjdk[bot] avatar Jul 18 '24 22:07 openjdk[bot]

/covered

toddjonker avatar Jul 19 '24 19:07 toddjonker

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

bridgekeeper[bot] avatar Jul 19 '24 19:07 bridgekeeper[bot]

Webrevs

mlbridge[bot] avatar Aug 09 '24 20:08 mlbridge[bot]

⚠️ @toddjonker This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

openjdk[bot] avatar Aug 12 '24 19:08 openjdk[bot]

/approval request Backports to JDK17 a fix for a potential data-loss defect fixed in JDK19.

This change is not clean, but the conflict is minimal and localized to StreamDecoder.java; see PR for explanation of the structural conflict.

Passes headless tests tier 1-3.

toddjonker avatar Aug 12 '24 20:08 toddjonker

@toddjonker 8287003: The approval request has been created successfully.

openjdk[bot] avatar Aug 12 '24 20:08 openjdk[bot]

/sponsor

phohensee avatar Aug 29 '24 13:08 phohensee

@phohensee The change author (@toddjonker) must issue an integrate command before the integration can be sponsored.

openjdk[bot] avatar Aug 29 '24 13:08 openjdk[bot]

/integrate

toddjonker avatar Aug 30 '24 00:08 toddjonker

@toddjonker Your change (at version cbc1398810aa928440e8f5f89c9e6ab212f76259) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Aug 30 '24 00:08 openjdk[bot]

/sponsor

phohensee avatar Aug 30 '24 15:08 phohensee

Going to push as commit 42b5e12b58f6f6014ff841fe980fcf160c0330e0. Since your change was applied there have been 40 commits pushed to the master branch:

  • 3ddae292e04a66e03d2cb761826dfab08ace7108: 8331789: ubsan: deoptimization.cpp:403:29: runtime error: load of value 208, which is not a valid value for type 'bool'
  • acfce69612d5e6f18c48551417ba6702ab84e5b6: 8332904: ubsan ppc64le: c1_LIRGenerator_ppc.cpp:581:21: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'
  • a9d755ca35b6bd952c5e48c2975d1c813cb5b0cd: 8336342: Fix known X11 library locations in sysroot
  • 7374e7d9060abc9519180aeeb7f0a6f1234e62e7: 8336343: Add more known sysroot library locations for ALSA
  • fd38e86f84b0c1044ef6fce3836fc319e3df646e: 8338286: GHA: Demote x86_32 to hotspot build only
  • ada58fa55bb265aa62bbe9389d08cbc39e3e32e0: 8336854: CAInterop.java#actalisauthenticationrootca conflicted with /manual and /timeout
  • 6f382d1fcfb514ab11e991ceb3c94967e8cbc054: 8332903: ubsan: opto/output.cpp:1002:18: runtime error: load of value 171, which is not a valid value for type 'bool'
  • e50b81503b0ee3cd3116345ff6bf31fa591dd3fc: 8339081: Bump update version for OpenJDK: jdk-17.0.14
  • 99b7468ef39571d5276b071f7040e2dfb01f703c: 8330814: Cleanups for KeepAliveCache tests
  • 03cbfaa733bc6a59da6ba5c0d0918245e534752a: 8315024: Vector API FP reduction tests should not test for exact equality
  • ... and 30 more: https://git.openjdk.org/jdk17u-dev/compare/2e9152dc268ee946680f274c9e6006edfb8d0398...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Aug 30 '24 15:08 openjdk[bot]

@phohensee @toddjonker Pushed as commit 42b5e12b58f6f6014ff841fe980fcf160c0330e0.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar Aug 30 '24 15:08 openjdk[bot]