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

8285794: AsyncGetCallTrace might acquire a lock via JavaThread::thread_from_jni_environment #8446

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/hotspot/share/prims/forte.cpp
Expand Up @@ -563,10 +563,9 @@ extern "C" {
JNIEXPORT
void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {

JavaThread* thread;
JavaThread* thread = JavaThread::current_or_null();
parttimenerd marked this conversation as resolved.
Show resolved Hide resolved

if (trace->env_id == NULL ||
(thread = JavaThread::thread_from_jni_environment(trace->env_id))->is_exiting()) {
if (trace->env_id == NULL || thread == NULL || thread->is_terminated() || thread->is_exiting()) {
parttimenerd marked this conversation as resolved.
Show resolved Hide resolved
// bad env_id, thread has exited or thread is exiting
trace->num_frames = ticks_thread_exit; // -8
return;
Expand All @@ -578,7 +577,7 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
return;
}

assert(JavaThread::current() == thread,
assert(thread == JavaThread::thread_from_jni_environment(trace->env_id),
parttimenerd marked this conversation as resolved.
Show resolved Hide resolved
"AsyncGetCallTrace must be called by the current interrupted thread");

if (!JvmtiExport::should_post_class_load()) {
Expand Down