Skip to content
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

8278330: dump stack trace if the jvmti test nsk/jvmti/GetThreadState/thrstat002 is failed with wrong thread state #6735

Closed
wants to merge 2 commits into from

Conversation

sspitsyn
Copy link
Contributor

@sspitsyn sspitsyn commented Dec 7, 2021

This is a fix for sub-task of:
8271065: vmTestbase/nsk/jvmti/GetThreadState/thrstat002 still fails with "Wrong thread "thr1" (...) state after SuspendThread"

The vmTestbase/nsk/jvmti/GetThreadState/thrstat002 test is intermittently failing with the wrong thread state reported.
It is most likely because of the unexpected JFR (or NMT) activity.
In order to confirm this guess we need to dump the stack trace in a case of this failure.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8278330: dump stack trace if the jvmti test nsk/jvmti/GetThreadState/thrstat002 is failed with wrong thread state

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6735/head:pull/6735
$ git checkout pull/6735

Update a local copy of the PR:
$ git checkout pull/6735
$ git pull https://git.openjdk.java.net/jdk pull/6735/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6735

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6735.diff

…State/thrstat002 is failed with wrong thread state
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 7, 2021

👋 Welcome back sspitsyn! 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 openjdk bot added the rfr Pull request is ready for review label Dec 7, 2021
@openjdk
Copy link

openjdk bot commented Dec 7, 2021

@sspitsyn 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 Dec 7, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 7, 2021

Webrevs


cname = get_method_class_name(jvmti, jni, method);

err = jvmti->GetMethodName(method, &mname, &msign, NULL);

Choose a reason for hiding this comment

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

Need to deallocate returned mname/msig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

err = jvmti->GetMethodDeclaringClass(method, &klass);
check_jvmti_status(jni, err, "get_method_class_name: error in JVMTI GetMethodDeclaringClass");

err = jvmti->GetClassSignature(klass, &cname, NULL);

Choose a reason for hiding this comment

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

Need to deallocate returned strings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

char* msign = NULL;
jvmtiError err;

cname = get_method_class_name(jvmti, jni, method);

Choose a reason for hiding this comment

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

Need to deallocate returned string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@@ -48,6 +48,104 @@ static jint state[] = {
JVMTI_THREAD_STATE_IN_OBJECT_WAIT
};

#define DBG 1
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that DBG really needs to be disabled, just print info anytime when test fails

Copy link
Contributor Author

@sspitsyn sspitsyn Dec 7, 2021

Choose a reason for hiding this comment

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

I used these ifdef's to easily identify the debugging/utility fragments in a case we want to isolate it in test library. It does not harm anyway. Okay, I've decided to replace '#ifdef DBG' with '#if 1'

Copy link
Member

@lmesnik lmesnik left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Dec 7, 2021

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

8278330: dump stack trace if the jvmti test nsk/jvmti/GetThreadState/thrstat002 is failed with wrong thread state

Reviewed-by: amenkov, lmesnik

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

  • b3faecf: 8276116: C2: optimize long range checks in int counted loops
  • fe2ae8e: 8276904: Optional.toString() is unnecessarily expensive
  • 6e7b7f3: 8278251: Enable "missing-explicit-ctor" check in the jdk.unsupported.desktop module
  • c83b781: 8278459: ProblemList javax/swing/JTree/4908142/bug4908142.java on macosx-aarch64
  • 8e8fadf: 8278428: ObjectInputStream.readFully range check incorrect
  • 5a80abf: 8272944: Use snippets in jdk.javadoc documentation
  • fb11d8f: 8272945: Use snippets in java.compiler documentation
  • 42d9b1b: 8277106: Cannot compile certain sources with --release
  • ba86dd4: 8278445: ProblemList tools/jpackage/share/IconTest.java on macosx-x64
  • 92aa75b: 8274903: Zero: Support AsyncGetCallTrace
  • ... and 47 more: https://git.openjdk.java.net/jdk/compare/2ff12966a345eaa1c16ed73165b3eb273e56f8dd...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 added the ready Pull request is ready to be integrated label Dec 7, 2021
@sspitsyn
Copy link
Contributor Author

sspitsyn commented Dec 8, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Dec 8, 2021

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

  • b3faecf: 8276116: C2: optimize long range checks in int counted loops
  • fe2ae8e: 8276904: Optional.toString() is unnecessarily expensive
  • 6e7b7f3: 8278251: Enable "missing-explicit-ctor" check in the jdk.unsupported.desktop module
  • c83b781: 8278459: ProblemList javax/swing/JTree/4908142/bug4908142.java on macosx-aarch64
  • 8e8fadf: 8278428: ObjectInputStream.readFully range check incorrect
  • 5a80abf: 8272944: Use snippets in jdk.javadoc documentation
  • fb11d8f: 8272945: Use snippets in java.compiler documentation
  • 42d9b1b: 8277106: Cannot compile certain sources with --release
  • ba86dd4: 8278445: ProblemList tools/jpackage/share/IconTest.java on macosx-x64
  • 92aa75b: 8274903: Zero: Support AsyncGetCallTrace
  • ... and 47 more: https://git.openjdk.java.net/jdk/compare/2ff12966a345eaa1c16ed73165b3eb273e56f8dd...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 8, 2021
@openjdk
Copy link

openjdk bot commented Dec 8, 2021

@sspitsyn Pushed as commit 3893f4f.

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

@sspitsyn sspitsyn deleted the br5 branch May 24, 2022 05:08
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
3 participants