Skip to content

Commit a8ddbd1

Browse files
committed
8265683: vmTestbase/nsk/jdb tests failed with "JDWP exit error AGENT_ERROR_INTERNAL(181)"
Reviewed-by: amenkov, dcubed
1 parent 7a55914 commit a8ddbd1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,15 @@ findThread(ThreadList *list, jthread thread)
253253
if ( list == NULL || list == &otherThreads ) {
254254
node = nonTlsSearch(getEnv(), &otherThreads, thread);
255255
}
256-
/* A thread with no TLS should never be in the runningThreads list. */
257-
JDI_ASSERT(!nonTlsSearch(getEnv(), &runningThreads, thread));
256+
/*
257+
* Search runningThreads list. The TLS lookup may have failed because the
258+
* thread has terminated, but the ThreadNode may still be present.
259+
*/
260+
if ( node == NULL ) {
261+
if ( list == NULL || list == &runningThreads ) {
262+
node = nonTlsSearch(getEnv(), &runningThreads, thread);
263+
}
264+
}
258265
}
259266

260267
/* If a list is supplied, only return ones in this list */

0 commit comments

Comments
 (0)