Skip to content

8337299: vmTestbase/nsk/jdb/stop_at/stop_at002/stop_at002.java failure goes undetected #20366

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
wants to merge 1 commit into from

Conversation

plummercj
Copy link
Contributor

@plummercj plummercj commented Jul 27, 2024

The test is setting breakpoints on the wrong line numbers, which causes setting up the breakpoint to fail, but the test also has buggy error checking, so the test doesn't detect the failures and still passes. I fixed the breakpoint line numbers and the error checking. More details in the first comment.

Testing: tier5 svc CI testing, which includes this test suite.


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-8337299: vmTestbase/nsk/jdb/stop_at/stop_at002/stop_at002.java failure goes undetected (Bug - P5)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20366

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 27, 2024

👋 Welcome back cjplummer! 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.

@plummercj
Copy link
Contributor Author

The test is testing to make sure a jdb deferred breakpoint on an inner class works. The breakpoint line number information for the debuggee is wrong, so the test should be failing, but isn't. The debugger side has:

static final String DEBUGGEE_LOCATION1 = DEBUGGEE_CLASS + "$Nested$DeeperNested$DeepestNested:43";
static final String DEBUGGEE_LOCATION2 = DEBUGGEE_CLASS + "$Inner$MoreInner:57";

And the debuggee side has:

                flag = input; /* <-------- This is line number 43 */

and

            content += input; /* <-------- This is line number 57 */

However line numbers (even the ones in the comments) are wrong. They probably have been ever since this file was open sourced and the new copyright header was added. As a result, in the jdb out you see failures like:

[17:24:22.782] reply[0]: > Unable to set deferred breakpoint nsk.jdb.stop_at.stop_at002.stop_at002a$Nested$DeeperNested$DeepestNested:43 : No code at line 43 in nsk.jdb.stop_at.stop_at002.stop_at002a$Nested$DeeperNested$DeepestNested

However, this is not caught by the test. The test only checks for the failed setting of the deferred breakpoint when executing the jdb "stop at" command. The failure does not actually happen until after the test continues, allowing the class to be loaded and for jdb to actually attempt to set the breakpoint.

So there are two issues with the test: wrong breakpoint line number information, and failure to determine that a deferred breakpoint failed to be setup when the class was loaded.

@openjdk
Copy link

openjdk bot commented Jul 27, 2024

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

8337299: vmTestbase/nsk/jdb/stop_at/stop_at002/stop_at002.java failure goes undetected

Reviewed-by: amenkov, sspitsyn

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

  • 08f697f: 8337819: Update GHA JDKs to 22.0.2
  • 42652b2: 8337787: Fix -Wzero-as-null-pointer-constant warnings when JVMTI feature is disabled
  • 807186f: 8337784: Fix simple -Wzero-as-null-pointer-constant warnings in linux/posix code
  • e68df52: 8337054: JDK 23 RDP2 L10n resource files update
  • 9856216: 8336928: GHA: Bundle artifacts removal broken
  • 219e1eb: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis
  • 97afbd9: 8336410: runtime/NMT/TotalMallocMmapDiffTest.java Total malloc diff is incorrect. Expected malloc diff range
  • c095c0e: 8336489: Track scoped accesses in JVMCI compiled code
  • 7e925d7: 8337283: configure.log is truncated when build dir is on different filesystem
  • 2e093b0: 8337779: test/jdk/jdk/jfr/jvm/TestHiddenWait.java is a bit fragile
  • ... and 104 more: https://git.openjdk.org/jdk/compare/4ea4d7c68444200ab38cbd76762c2f27848e264e...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.

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

@openjdk openjdk bot changed the title 8337299 8337299: vmTestbase/nsk/jdb/stop_at/stop_at002/stop_at002.java failure goes undetected Jul 27, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 27, 2024
@openjdk
Copy link

openjdk bot commented Jul 27, 2024

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

  • serviceability

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 serviceability serviceability-dev@openjdk.org label Jul 27, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 27, 2024

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 29, 2024
Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

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

This looks good. I've posted one question.

return false;
}

found = grep.findFirst("Breakpoint hit: \"thread=main\", ");
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Is it possible to check for the exact breakpoint location here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is in the test we have:

static final String DEBUGGEE_LOCATION2 = DEBUGGEE_CLASS + "$Inner$MoreInner:78";

And the jdb output is:

reply[2]: Breakpoint hit: "thread=main", nsk.jdb.stop_at.stop_at002.stop_at002a$Inner$MoreInner.foo(), line=78 bci=0

So I can't just search for DEBUGGEE_LOCATION2 in the output. I could do further factoring of DEBUGGEE_LOCATION2 so it is easier to construct a search pattern that would work, but I don't feel it is worth it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, thanks.

@plummercj
Copy link
Contributor Author

Thanks for the reviews Alex and Serguei!

/integrate

@openjdk
Copy link

openjdk bot commented Aug 5, 2024

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

  • 08f697f: 8337819: Update GHA JDKs to 22.0.2
  • 42652b2: 8337787: Fix -Wzero-as-null-pointer-constant warnings when JVMTI feature is disabled
  • 807186f: 8337784: Fix simple -Wzero-as-null-pointer-constant warnings in linux/posix code
  • e68df52: 8337054: JDK 23 RDP2 L10n resource files update
  • 9856216: 8336928: GHA: Bundle artifacts removal broken
  • 219e1eb: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis
  • 97afbd9: 8336410: runtime/NMT/TotalMallocMmapDiffTest.java Total malloc diff is incorrect. Expected malloc diff range
  • c095c0e: 8336489: Track scoped accesses in JVMCI compiled code
  • 7e925d7: 8337283: configure.log is truncated when build dir is on different filesystem
  • 2e093b0: 8337779: test/jdk/jdk/jfr/jvm/TestHiddenWait.java is a bit fragile
  • ... and 104 more: https://git.openjdk.org/jdk/compare/4ea4d7c68444200ab38cbd76762c2f27848e264e...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 5, 2024

@plummercj Pushed as commit e2c07d5.

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

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

Successfully merging this pull request may close these issues.

3 participants