-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
JDK-8299470: sun/jvm/hotspot/SALauncher.java handling of negative rmiport args #11811
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
Webrevs
|
I adjusted the exception message a bit to show what is wrong (-1 as an argument is not expected/supported). Any reviews ? |
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.
I've got one suggestion, plus, the copyright year now is 2023 😉
@@ -500,6 +500,8 @@ public static void main(String[] args) { | |||
func.accept(oldArgs); | |||
} | |||
} catch (SAGetoptException e) { | |||
System.err.println("SA agent option related exception occured"); |
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.
Maybe you could do here:
System.err.println("SA agent option exception occured: " + e.getMessage);
and remove the System.err.println(e.getMessage());
in line 505.
@MBaesken 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 39 new commits pushed to the
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 |
The changes here to log a better error are I think good (maybe adding the stacktrace printing is not needed now the error is more understandable!), but aborting the launch attempt in the caller, if it gets -1 when trying to find a free port, should be even clearer? In the method testWithPid() finds an rmiPort: final int rmiPort = useRmiPort ? Utils.findUnreservedFreePort(REGISTRY_DEFAULT_PORT, registryPort) : -1; ...but can proceed to launch even if it gets the -1 value which findUnreservedFreePort could return? That looks like a mistake. In the "if (useRmiPort) {" block, we should be failing the test if rmiPort is -1, saying something like A similar abort if setting registryPort gets -1 might also be good? |
Hi Kevin, I think you are correct, adjusting the test test/hotspot/jtreg/serviceability/sa/sadebugd/SADebugDTest.java in those two cases (rmiPort / registryPort -1) probably makes sense. Should we do it in another JBS issue or here ? |
SADebugDTest is only one test, so seems OK to have it fail as soon as we realise we need a port, and it has a value of -1. I would do it in this change as they are so connected, but really whichever works best for you. (I don't see other uses of findUnreservedFreePort() in the same test hierarchy, so this task should not keep on growing... 8-) ) |
Hi Kevin, I adjusted the mentioned test, please have a look ! |
Looks good! Rereading the change, occured should be "occurred" (we do have a lot of "occured" in the JDK, but many more "occurred") Then can you could make it "a registryPort" rather than "an", and I think I'm done with comments. Thanks! |
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.
Looks good.
Thanks,
Serguei
Thanks for updating. |
/integrate |
Going to push as commit 2ccdefc.
Your commit was automatically rebased without conflicts. |
This change has introduced a test failure in our tier 5 CI testing: |
I missed an issue had already been filed for the failure. |
The test serviceability/sa/sadebugd/SADebugDTest.java can pass under some circumstances a negative rmiport (--rmiport -1) to SALauncher.java.
This leads to a somewhat misleading message
[debugd] Argument is expected for 'rmiport'
(we set an argument [-1] but probably this is not what is really expected) and additionally the real exception is not shown.
Probably also a warning in case of negative rmiport values should be printed because they seem to lead to errors.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11811/head:pull/11811
$ git checkout pull/11811
Update a local copy of the PR:
$ git checkout pull/11811
$ git pull https://git.openjdk.org/jdk pull/11811/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11811
View PR using the GUI difftool:
$ git pr show -t 11811
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11811.diff