8372957: After JDK-8282441 JDWP might allow some invalid FrameIDs to be used

Reviewed-by: amenkov, sspitsyn
This commit is contained in:
Chris Plummer 2025-12-03 17:15:37 +00:00
parent c432150397
commit 0bcef61a6d

View File

@ -70,6 +70,7 @@ typedef struct ThreadNode {
unsigned int popFrameEvent : 1;
unsigned int popFrameProceed : 1;
unsigned int popFrameThread : 1;
unsigned int frameGeneration_accessed:1; /* true if frameGeneration accessed to produce a FrameID */
EventIndex current_ei; /* Used to determine if we are currently handling an event on this thread. */
jobject pendingStop; /* Object we are throwing to stop the thread (ThreadReferenceImpl.stop). */
jint suspendCount; /* Number of outstanding suspends from the debugger. */
@ -616,6 +617,7 @@ freeUnusedVThreadNode(JNIEnv *env, ThreadNode* node)
!node->popFrameEvent &&
!node->popFrameProceed &&
!node->popFrameThread &&
!node->frameGeneration_accessed &&
node->pendingStop == NULL)
{
removeNode(node);
@ -2683,6 +2685,7 @@ threadControl_getFrameGeneration(jthread thread)
if (node != NULL) {
frameGeneration = node->frameGeneration;
node->frameGeneration_accessed = JNI_TRUE;
}
}
debugMonitorExit(threadLock);