8265683: vmTestbase/nsk/jdb tests failed with "JDWP exit error AGENT_ERROR_INTERNAL(181)"

Reviewed-by: amenkov, dcubed
This commit is contained in:
Chris Plummer 2021-04-22 23:27:33 +00:00
parent 7a5591402c
commit a8ddbd155b

View File

@ -253,8 +253,15 @@ findThread(ThreadList *list, jthread thread)
if ( list == NULL || list == &otherThreads ) {
node = nonTlsSearch(getEnv(), &otherThreads, thread);
}
/* A thread with no TLS should never be in the runningThreads list. */
JDI_ASSERT(!nonTlsSearch(getEnv(), &runningThreads, thread));
/*
* Search runningThreads list. The TLS lookup may have failed because the
* thread has terminated, but the ThreadNode may still be present.
*/
if ( node == NULL ) {
if ( list == NULL || list == &runningThreads ) {
node = nonTlsSearch(getEnv(), &runningThreads, thread);
}
}
}
/* If a list is supplied, only return ones in this list */