-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix up potential stale pointer after GC #16414
Conversation
jenkins test sanity amac jdk19 |
jenkins test sanity win jdk19 |
jenkins test sanity plinux jdk19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR builds don't need to be relaunched. The old PR builds are still good since only the comment was updated.
- amac: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/3109 (PASSED)
- win_x64: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/3110 (PASSED)
- pLinux: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/3111 (PASSED)
Fixes eclipse-openj9#16351 Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
jenkins test sanity amac jdk19 |
@@ -343,6 +343,10 @@ JVM_VirtualThreadMountEnd(JNIEnv *env, jobject thread, jboolean firstMount) | |||
vmFuncs->setHeapOutOfMemoryError(currentThread); | |||
goto release1; | |||
} | |||
|
|||
/* Re-fetch as the memory allocation above may have moved the object. */ | |||
threadObj = J9_JNI_UNWRAP_REFERENCE(thread); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the same reasoning, rootVirtualThread
may have moved as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rootVirtualThread
cannot be moved as the GC will only occur if there is not enough space perform the requested allocation. So the allocation of rootVirtualThread
would only happen after the GC.
Fix up potential stale pointer after GC
Fixes #16351
Signed-off-by: Tobi Ajila atobia@ca.ibm.com