Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8279283 - BufferedInputStream should override transferTo #6935

Closed
wants to merge 17 commits into from

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Dec 26, 2021

Implementation of JDK-8279283


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

Issue

  • JDK-8279283: BufferedInputStream should override transferTo

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6935

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 26, 2021

👋 Welcome back mkarg! 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 openjdk bot added the rfr Pull request is ready for review label Dec 26, 2021
@openjdk
Copy link

openjdk bot commented Dec 26, 2021

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

  • core-libs

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 added the core-libs core-libs-dev@openjdk.org label Dec 26, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 26, 2021

@AlanBateman
Copy link
Contributor

BIS is not specified to be thread safe but the existing read/write operations are. If transferTo is overridden then this is an area that will require close attention.

Have you surveyed the existing tests to see if transferTo is invoked on a BIS? New tests may be needed.

@mkarg
Copy link
Contributor Author

mkarg commented Dec 27, 2021

BIS is not specified to be thread safe but the existing read/write operations are. If transferTo is overridden then this is an area that will require close attention.

In analogy to the other read/write operations I now have synchronized transferTo in 8dac240 to be on the safe side.

Have you surveyed the existing tests to see if transferTo is invoked on a BIS? New tests may be needed.

Did not find an existing test for BIS.transferTo, so I will write a new test for this.

@mkarg
Copy link
Contributor Author

mkarg commented Dec 27, 2021

Have you surveyed the existing tests to see if transferTo is invoked on a BIS? New tests may be needed.

I have provided a test for BIS.transferTo in fbc5def.

@mkarg mkarg changed the title 8279283 - (ch) BufferedInputStream should override transferTo 8279283 - BufferedInputStream should override transferTo Dec 27, 2021
@stsypanov
Copy link
Contributor

Maybe we need to include into this patch the benchmark referenced to in the body of the ticket?

@AlanBateman
Copy link
Contributor

I think you'll need to look at the interaction with mark/reset. I don't think you can bypass the buffering when there is a mark set.

@mkarg
Copy link
Contributor Author

mkarg commented Jan 15, 2022

Good catches, I will look into your comments!

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 12, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mkarg
Copy link
Contributor Author

mkarg commented Feb 12, 2022

Please keep open, still working on it.

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 12, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mkarg
Copy link
Contributor Author

mkarg commented Mar 13, 2022

Please keep this PR open; I will continune work on it soon.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 10, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mkarg
Copy link
Contributor Author

mkarg commented Apr 10, 2022

Please keep this PR open; I will continune work on it soon.

@bridgekeeper
Copy link

bridgekeeper bot commented May 8, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mkarg
Copy link
Contributor Author

mkarg commented May 13, 2022

Please keep this PR open; I will continune work on it soon.

@AlanBateman
Copy link
Contributor

Can this PR be closed or returned to daft?

@mkarg
Copy link
Contributor Author

mkarg commented Jun 6, 2022

I think we should turn it back to draft.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 4, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@mkarg
Copy link
Contributor Author

mkarg commented Jul 6, 2022

Please keep this PR open; I will continune work on it soon.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 4, 2022

@mkarg This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 2, 2022

@mkarg This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Sep 2, 2022
@stsypanov
Copy link
Contributor

Will this be reopened somewhen? The proposed changes seems useful

@mkarg
Copy link
Contributor Author

mkarg commented Sep 24, 2022

@bplb Fixed the issues you pointed out. Kindly requesting approval. :-)

@AlanBateman
Copy link
Contributor

@AlanBateman Kindly requesting approval. :-)

I don't have any more comments, the recent test cleanups are good. I assume @bplb will sponsor.

@mkarg
Copy link
Contributor Author

mkarg commented Sep 25, 2022

@AlanBateman Kindly requesting approval. :-)

I don't have any more comments, the recent test cleanups are good. I assume @bplb will sponsor.

Thanks a lot for all your kind help with this PR! :-)

@mkarg
Copy link
Contributor Author

mkarg commented Sep 25, 2022

@AlanBateman Kindly asking for /approve. Thanks. :-)

@bplb
Copy link
Member

bplb commented Sep 26, 2022

@bplb Fixed the issues you pointed out.

@mkarg You are welcome.

@openjdk
Copy link

openjdk bot commented Sep 26, 2022

⚠️ @mkarg the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout bufferedinputstream-transferto
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Sep 26, 2022

@mkarg 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:

8279283: BufferedInputStream should override transferTo

Reviewed-by: bpb

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 263 new commits pushed to the master branch:

  • 79ccc79: 8293613: need to properly handle and hide tmp VTMS transitions
  • 5e1e449: 8290920: sspi_bridge.dll not built if BUILD_CRYPTO is false
  • d827fd8: 8294430: RISC-V: Small refactoring for movptr_with_offset
  • 9d76ac8: 8292158: AES-CTR cipher state corruption with AVX-512
  • e5b65c4: 8290482: Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications
  • f8d9fa8: 8294483: Remove vmTestbase/nsk/jvmti/GetThreadState tests.
  • 6ad151d: 8293143: Workaround for JDK-8292217 when doing "step over" of bytecode with unresolved cp reference
  • 22b59b6: 8294471: SpecTaglet is inconsistent with SpecTree for inline property
  • 763d4bf: 8293592: Remove JVM_StopThread, stillborn, and related cleanup
  • 739fdec: 8289162: runtime/NMT/ThreadedMallocTestType.java should print out memory allocations to help debug
  • ... and 253 more: https://git.openjdk.org/jdk/compare/ef20ffe4d222d48f0bdba81a0b864d9fb455e9a6...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 (@bplb) 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 openjdk bot added the ready Pull request is ready to be integrated label Sep 26, 2022
@mkarg
Copy link
Contributor Author

mkarg commented Sep 28, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 28, 2022
@openjdk
Copy link

openjdk bot commented Sep 28, 2022

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

@mkarg
Copy link
Contributor Author

mkarg commented Sep 28, 2022

@bplb I would be very glad if you would /sponsor my PR. :-)

@bplb
Copy link
Member

bplb commented Sep 28, 2022

/sponsor

@bplb
Copy link
Member

bplb commented Sep 28, 2022

@bplb I would be very glad if you would /sponsor my PR. :-)

Done.

@openjdk
Copy link

openjdk bot commented Sep 28, 2022

Going to push as commit 7515b30.
Since your change was applied there have been 273 commits pushed to the master branch:

  • 7401fe0: 8292912: Make guard card in CardTable inaccessible
  • 70d8428: 8294520: Problemlist java/nio/file/Files/CopyProcFile.java
  • 30e3bf9: 8291805: IGV: Improve Zooming
  • 37f83b9: 8294375: test/jdk/java/nio/channels/vthread/BlockingChannelOps.java is slow
  • 60616f2: 8294059: Serial: Refactor GenCollectedHeap::collect
  • ea61671: 8294359: Interpreter(AArch64) intrinsify Thread.currentThread()
  • c42ef70: 7148092: [macosx] When Alt+down arrow key is pressed, the combobox popup does not appear.
  • 94e14da: 8294057: Parallel: Tighten ParallelCompactData::initialize_region_data
  • 1ea0d6b: 8292301: [REDO v2] C2 crash when allocating array of size too large
  • c13e0ef: 8292848: AWT_Mixing and TrayIcon tests fail on el8 with hard-coded isOel7
  • ... and 263 more: https://git.openjdk.org/jdk/compare/ef20ffe4d222d48f0bdba81a0b864d9fb455e9a6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 28, 2022
@openjdk openjdk bot closed this Sep 28, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Sep 28, 2022
@openjdk
Copy link

openjdk bot commented Sep 28, 2022

@bplb @mkarg Pushed as commit 7515b30.

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

@mkarg mkarg deleted the bufferedinputstream-transferto branch September 28, 2022 16:11
@mkarg
Copy link
Contributor Author

mkarg commented Oct 1, 2022

I think you are asking if is safe to leak a reference to the internal buffer. If there is no mark then it might be okay because there is no replay for an evil output stream to attack. However, I think it would require wider review to be confident that there aren't other interesting ways to break it; hence the suggestion in one of the earlier comments to keep it simple and limit it when there is no subclassing, no mark, and no bytes buffered. This does not prevent widening the conditions in the future.

@AlanBateman I opened another PR to continue this discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

6 participants