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

8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL" #6515

Closed
wants to merge 2 commits into from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Nov 23, 2021

The agentThread variable might have been set by the new agentThread iteration and then deleted in the wrapper from the previous iteration.

The deletion of agentThread variable should be synced with the termination of the agent thread.


Progress

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

Issue

  • JDK-8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL"

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6515

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 23, 2021

👋 Welcome back lmesnik! 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
Copy link

@openjdk openjdk bot commented Nov 23, 2021

@lmesnik this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8264605
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict rfr labels Nov 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2021

@lmesnik 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 label Nov 23, 2021
@openjdk openjdk bot removed the merge-conflict label Nov 23, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 23, 2021

Webrevs

@dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Nov 23, 2021

Hi Leonid,

I don't think this is sufficient. You have moved the cleanup of the agentThread under the protection of the rawMonitor for termination, but unless the initialization of agentThread is also protected by the rawMonitor then you still have a problem AFAICS.

Cheers,
David

@lmesnik
Copy link
Member Author

@lmesnik lmesnik commented Nov 23, 2021

The new thread is started in nsk_jvmti_runAgentThread which is executed under monitors also as well as nsk_jvmti_resetAgentData.
Could you please point exact location which is not protected? Seems all thread_state changes and agentThread changes are protected.

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Hi Leonid,
It looks good to me.
I see the initialization of agentThread is also protected with the data.monitor. This code is a little bit ugly, so it is not clear that startAgentThreadWrapper is executed under rawMonitor protection.
Thanks,
Serguei

@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2021

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

8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL"

Reviewed-by: sspitsyn, dholmes

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

  • 7b2d823: 8277503: compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java failed with "OnSpinWaitInst with the expected value 'isb' not found."
  • 7cb56a2: 8265796: vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java fails when running with JEP 416
  • 24e586a: 8276764: Enable deterministic file content ordering for Jar and Jmod
  • ea85e01: 8271623: Omit enclosing instance fields from inner classes that don't use it
  • 0320672: 8277451: java.lang.reflect.Field::set on static field with invalid argument type should throw IAE
  • e8acac2: 8277350: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java times out
  • 8a44e09: 8268725: jshell does not support the --enable-native-access option
  • 7b67a49: 8261847: performance of java.lang.Record::toString should be improved
  • 38802ad: 8254108: ciReplay: Support incremental inlining
  • 64bdc84: 8277649: [BACKOUT] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/bb11c55dff86706a010c93ee2cc60c87bb2d53b6...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 label Nov 23, 2021
@dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Nov 24, 2021

Sorry @lmesnik I missed the higher-level use of the monitor when starting the thread.

@lmesnik
Copy link
Member Author

@lmesnik lmesnik commented Nov 24, 2021

/integrate

@lmesnik
Copy link
Member Author

@lmesnik lmesnik commented Nov 24, 2021

@dholmes-ora, @sspitsyn - Thank you for the review!

@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2021

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

  • 077b2de: 8274161: Cleanup redundant casts in jdk.compiler
  • 951247c: 8235876: Misleading warning message in java source-file mode
  • 663e33d: 8272728: javac ignores any -J option in @argfiles silently
  • 0384739: 8276665: ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException
  • cf7adae: 8275320: NMT should perform buffer overrun checks
  • 96e3607: 8275063: Implementation of Foreign Function & Memory API (Second incubator)
  • 17e68ca: 8277042: add test for 8276036 to compiler/codecache
  • 8a8bc29: 8277562: Remove dead method c1 If::swap_sux
  • d085c2b: 8273328: Compiler implementation for Pattern Matching for switch (Second Preview)
  • 6d73460: 8277399: ZGC: Move worker thread logging out of gc+phase=debug
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/bb11c55dff86706a010c93ee2cc60c87bb2d53b6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 24, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 24, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2021

@lmesnik Pushed as commit 96fe1d0.

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

@lmesnik lmesnik deleted the 8264605 branch Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated serviceability
3 participants