-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8332065: Calling readLine(null...) or readPassword(null...) on System.console() hangs jshell #19420
Conversation
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
@lahodaj 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:
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 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
assertEval("System.console().readLine(\"%d\", \"\")", DiagCheck.DIAG_OK, DiagCheck.DIAG_OK, chain(added(Status.VALID), null, EvalException.class)); | ||
assertEval("System.console().readPassword(\"%d\", \"\")", DiagCheck.DIAG_OK, DiagCheck.DIAG_OK, chain(added(Status.VALID), null, EvalException.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right: IllegalFormatConversionException
would cause the same hang.
/integrate |
Going to push as commit 57bfd0e.
Your commit was automatically rebased without conflicts. |
JShell supports using
System.console()
when running snippets in a separate VM (the agent). This works by re-sending requests from the agent to the main process.For some
Console
methods, likereadLine
, this has two phases - first a prompt is sent, and then input is received. But, there's a mistake on the way this is handled: the protocol starts a "transaction", and then goes to process the prompt. And if the prompt processing fails, the "transaction" never ends, and the communication locks.The proposal here is to do the prompt processing before starting the communication, so if it fails, there are no problems with the communication.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19420/head:pull/19420
$ git checkout pull/19420
Update a local copy of the PR:
$ git checkout pull/19420
$ git pull https://git.openjdk.org/jdk.git pull/19420/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19420
View PR using the GUI difftool:
$ git pr show -t 19420
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19420.diff
Webrev
Link to Webrev Comment