Skip to content

Conversation

@lmesnik
Copy link
Member

@lmesnik lmesnik commented Oct 15, 2025

Test might fail with

----------System.out:(5/399)----------
The following fake exception stacktrace is for failure analysis.
nsk.share.Fake_Exception_for_RULE_Creation: (tc03t002.cpp:144) jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)
at nsk_lvcomplain(nsk_tools.cpp:172)
# ERROR: tc03t002.cpp, 144: jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)
# jvmti error: code=15, name=JVMTI_ERROR_THREAD_NOT_ALIVE

if some of threads unexpectedly finishes during test execution. 

It might happens only for some tests that are not started and verified by thread. So the fix is to skip them and verify only "Debugee" threads that might be in the deadlock.


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-8321687: Test vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/TestDescription.java failed: JVMTI_ERROR_THREAD_NOT_ALIVE (Bug - P5)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27831

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…/TestDescription.java failed: JVMTI_ERROR_THREAD_NOT_ALIVE
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 15, 2025

👋 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 bot commented Oct 15, 2025

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

8321687: Test vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/TestDescription.java failed: JVMTI_ERROR_THREAD_NOT_ALIVE

Reviewed-by: amenkov, cjplummer, 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 53 new commits pushed to the master branch:

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 serviceability serviceability-dev@openjdk.org label Oct 15, 2025
@openjdk
Copy link

openjdk bot commented Oct 15, 2025

@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 rfr Pull request is ready for review label Oct 15, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 15, 2025

Copy link
Contributor

@plummercj plummercj left a comment

Choose a reason for hiding this comment

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

Isn't this also an issue for tc03t001?

@lmesnik
Copy link
Member Author

lmesnik commented Oct 15, 2025

Isn't this also an issue for tc03t001?

Thanks, I've updated this test also.

int tDfn = 0, gDfn = 0;
int pThread, cThread;
int i;
int debuggee_thread_cnt = 0;
Copy link
Contributor

@sspitsyn sspitsyn Oct 16, 2025

Choose a reason for hiding this comment

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

This does not follow the same pattern as in tc03t002.cpp.
The variable debuggee_thread_cnt is not correctly set and used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Corrected.

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.

Thank you for update. Looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 16, 2025
return NSK_FALSE;

for (i = 0; i < threads_count; i++) {
for (i = 0; i < debuggee_thread_cnt; i++) {

Choose a reason for hiding this comment

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

The fix looks incomplete.
There is global threads_count variable and it's used in a number of places in the file.
I think it would be simpler to add local total_thread_count and use it only to initialize threadList (GetAllThreads, allocate threadList, iteration through threads); debuggee_thread_cnt needs to be replaced with threads_count

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you! You are correct, the debuggee_thread_cnt is made global and used while printing locks.
I also renamed it to debuggee_threads_cnt

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 17, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 17, 2025
Copy link

@alexmenkov alexmenkov left a comment

Choose a reason for hiding this comment

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

There are still some wrong usage thread_count instead of debuggee_threads_cnt

Co-authored-by: Alex Menkov <alexey.menkov@oracle.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 17, 2025
@lmesnik
Copy link
Member Author

lmesnik commented Oct 17, 2025

There are still some wrong usage thread_count instead of debuggee_threads_cnt
Thanks, I applied your changes and tested them.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 17, 2025
@lmesnik
Copy link
Member Author

lmesnik commented Oct 18, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Oct 18, 2025

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 18, 2025

@lmesnik Pushed as commit 1816570.

💡 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.

4 participants