Skip to content
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

Merged
merged 1 commit into from
Dec 5, 2022
Merged

Conversation

tajila
Copy link
Contributor

@tajila tajila commented Dec 4, 2022

Fix up potential stale pointer after GC

Fixes #16351

Signed-off-by: Tobi Ajila atobia@ca.ibm.com

@tajila
Copy link
Contributor Author

tajila commented Dec 4, 2022

jenkins test sanity amac jdk19

@tajila
Copy link
Contributor Author

tajila commented Dec 5, 2022

jenkins test sanity win jdk19

@tajila
Copy link
Contributor Author

tajila commented Dec 5, 2022

jenkins test sanity plinux jdk19

Copy link
Contributor

@babsingh babsingh left a 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.

runtime/j9vm/javanextvmi.cpp Outdated Show resolved Hide resolved
Fixes eclipse-openj9#16351

Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
@tajila
Copy link
Contributor Author

tajila commented Dec 5, 2022

jenkins test sanity amac jdk19

@babsingh babsingh added backport:candidate Possible candidate for a backport to a `0.x.y+1` release jdk19 labels Dec 5, 2022
@babsingh babsingh merged commit 36b6300 into eclipse-openj9:master Dec 5, 2022
@@ -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);
Copy link
Contributor

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.

Copy link
Contributor Author

@tajila tajila Dec 5, 2022

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.

@pshipton pshipton removed the backport:candidate Possible candidate for a backport to a `0.x.y+1` release label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JDK19 java/lang/Thread/virtual/stress/GetStackTraceALot.java#id0 - Segmentation error vmState=0x0002000f
4 participants