On Thu, 16 Oct 2025 00:41:37 GMT, Leonid Mesnik <[email protected]> wrote:

>> 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.
>
> Leonid Mesnik has updated the pull request incrementally with three 
> additional commits since the last revision:
> 
>  - space added
>  - fix
>  - fixed applied

Changes requested by amenkov (Reviewer).

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t001/tc03t001.cpp
 line 151:

> 149:         return NSK_FALSE;
> 150: 
> 151:     for (i = 0; i < debuggee_thread_cnt; i++) {

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`

-------------

PR Review: https://git.openjdk.org/jdk/pull/27831#pullrequestreview-3347562624
PR Review Comment: https://git.openjdk.org/jdk/pull/27831#discussion_r2437900091

Reply via email to