Skip to content

8342086: FileInputStream.available() fails with "Incorrect function" for "nul" path (win) #21543

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

Closed

Conversation

bplb
Copy link
Member

@bplb bplb commented Oct 16, 2024

Modify the handleAvailable native code path to ignore an ERROR_INVALID_FUNCTION encountered by PeekNamedPipe and update an existing test to verify this change.


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-8342086: FileInputStream.available() fails with "Incorrect function" for "nul" path (win) (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21543

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2024

👋 Welcome back bpb! 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 Oct 16, 2024

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

8342086: FileInputStream.available() fails with "Incorrect function" for "nul" path (win)

Reviewed-by: alanb

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

  • 525f33b: 8345324: Update comment in SourceVersion for language evolution history for changes in 24
  • d6a5f1b: 8344768: Consider removing "sun.security.krb5.autodeducerealm" system property
  • 7c944ee: 8345172: x86: Some CPU feature asserts are declared as 32-bit only
  • 67f18cc: 8345142: Remove uses of SecurityManager in Printing related classes
  • 352201d: 8343788: Provide means to alter lib/tzmappings entries on Windows
  • 29c57e8: 8342677: Add IR validation tests for newly added saturated vector add / sub operations

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 16, 2024
@bplb
Copy link
Member Author

bplb commented Oct 16, 2024

If PeekNamedPipe fails with ERROR_INVALID_FUNCTION, then the number of bytes available is set to zero, the default. The test is updated to JUnit 5 and a sub-test is added for this case of reading form the NUL device.

@openjdk
Copy link

openjdk bot commented Oct 16, 2024

@bplb 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 Oct 16, 2024
@mlbridge
Copy link

mlbridge bot commented Oct 16, 2024

Webrevs

@bplb
Copy link
Member Author

bplb commented Oct 16, 2024

I verified that PeekNamedPipe also fails with ERROR_INVALID_FUNCTION when the supplied handle is STD_INPUT_HANDLE.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 13, 2024

@bplb 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!

@bplb
Copy link
Member Author

bplb commented Nov 13, 2024

continue;

@bplb
Copy link
Member Author

bplb commented Dec 2, 2024

Ping ...

if (GetLastError() != ERROR_BROKEN_PIPE) {
DWORD lastError = GetLastError();
if (lastError != ERROR_BROKEN_PIPE &&
lastError != ERROR_INVALID_FUNCTION) {
return FALSE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think about not special case these errors and instead pbytes=0 and TRUE if PeekNamedPipe fails.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] not special case these errors and instead pbytes=0 and TRUE if PeekNamedPipe fails.

Sounds reasonable.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 2, 2024
@bplb
Copy link
Member Author

bplb commented Dec 3, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 3, 2024

Going to push as commit 3eaa761.
Since your change was applied there have been 38 commits pushed to the master branch:

  • 60bd73a: 8342089: Require --enable-native-access to be the same between CDS dump time and run time
  • 2be27e1: 8345393: ProblemList java/util/concurrent/locks/StampedLock/OOMEInStampedLock.java on generic-all JTREG_TEST_THREAD_FACTORY=Virtual
  • ba50939: 8341649: Regressions with large metaspace apps after 8338526
  • caf053b: 8337287: Update image in javax.swing.text.Document.insert
  • 8647c00: 8342602: Remove JButton/PressedButtonRightClickTest test
  • fcf185c: 8345325: SM cleanup of GetPropertyAction in java.base
  • eac00f6: 8345396: Fix headers after JDK-8345164
  • dfa5620: 8345164: Remove residual --enable-preview in FFM tests and benchmarks
  • 65b5a2e: 8345158: IGV: local scheduling should not place successors before predecessors
  • 8cad043: 8336768: Allow captureCallState and critical linker options to be combined
  • ... and 28 more: https://git.openjdk.org/jdk/compare/30b8bbe255c1653d25961c3fe79096b2b8d62bd6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 3, 2024
@openjdk openjdk bot closed this Dec 3, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 3, 2024
@openjdk
Copy link

openjdk bot commented Dec 3, 2024

@bplb Pushed as commit 3eaa761.

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

@bplb bplb deleted the FileInputStream-available-NUL-8342086 branch December 3, 2024 18:34
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.

2 participants