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
8306758: com/sun/jdi/ConnectedVMs.java fails with "Non-zero debuggee exitValue: 143" #13848
Conversation
👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into |
BreakpointEvent bp = startToMain("InstTarg"); | ||
waitForVMStart(); | ||
StepEvent stepEvent = stepIntoLine(bp.thread()); |
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.
These changes were needed for virtual thread support. startToMain("InstTarg")
causes the debuggee to run until it it is suspended at a breakpoint in InstTarg.main()
. waitForVMStart()
will return right away since the VM has already started, and will return the main thread of the debuggee, but this is the thread running TestScaffold.main()
, which started up InstTarg.main()
in a virtual thread. If we single step in the main thread in this case, the single step is not in InstTarg.main()
as it should be, but is instead in main thread, which is blocked in the join()
call waiting for the virtual thread to complete. The single step resumes all threads, but can't complete until the virtual thread exits. So before the test ever gets to do the Process.destroy()
, InstTarg.main()
has already exited
Fortunately it was easy to find the proper thread to single step in, since the virtual thread is the BreakpointEvent
thread.
@plummercj The following label will be automatically applied to this pull request:
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. |
Webrevs
|
@plummercj 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 74 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 |
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 the reviews Alex and Serguei! /integrate |
Going to push as commit 2688364.
Your commit was automatically rebased without conflicts. |
@plummercj Pushed as commit 2688364. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This test was very rarely failing with a exitValue 143 from the debuggee. It only happened when the machine was under a lot of stress. After some investigation it was realized that on unix OSes it should always expect exitValue 143, but for some reason was normally getting exitValue 0. The reason 143 should be expected is because
Process.destroy()
is used on the debuggee, which results in a SIGTERM, which should produce exitValue 143. The reason we were not normally seeing this is because theProcess.destroy()
was done while the debuggee was suspended at a breakpoint. Nothing can be done with the SIGTERM while all threads are suspended, but once the debugger does thevm.resume()
the SIGTERM can be handled. But by that time it is a race between some thread handling SIGTERM and doing the exit(143), and the main debuggee thread resuming and exiting cleanly (producing exitValue 0). In almost all cases the clean exit was winning. By adding a 5 second sleep before exiting, I made it so the SIGTERM exit always wins. Once this was in place, I had to make changes so the test would pass with exitCode 143. This was done by adding aTestScaffold.allowExitValue()
method, which the test can override. Note I'll have more uses for this in the future, as I plan to no longer by default allow exitValue 1 (exit with an uncaught exception) and requiring tests to override this method if needed. That will be done by JDK-8307559.Tested by running all of test/jdk/com/sun/jdi with and without virtual threads, 10x times on each platform.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13848/head:pull/13848
$ git checkout pull/13848
Update a local copy of the PR:
$ git checkout pull/13848
$ git pull https://git.openjdk.org/jdk.git pull/13848/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13848
View PR using the GUI difftool:
$ git pr show -t 13848
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13848.diff
Webrev
Link to Webrev Comment