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

8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL" #293

Closed
Closed
Changes from all 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
@@ -154,7 +154,6 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all

vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -138,34 +138,25 @@ jvmtiEnv* nsk_jvmti_getAgentJVMTIEnv() {
return jvmti_env;
}

/* ============================================================================= */
static void set_agent_thread_state(thread_state_t value) {
rawMonitorEnter(jvmti_env, agent_data.monitor);
agent_data.thread_state = value;
rawMonitorNotify(jvmti_env, agent_data.monitor);
rawMonitorExit(jvmti_env, agent_data.monitor);
}

/** Wrapper for user agent thread. */
static void JNICALL
agentThreadWrapper(jvmtiEnv* jvmti_env, JNIEnv* agentJNI, void* arg) {
jni_env = agentJNI;

/* run user agent proc */
{
set_agent_thread_state(RUNNABLE);
rawMonitorEnter(jvmti_env, agent_data.monitor);
agent_data.thread_state = RUNNABLE;
rawMonitorNotify(jvmti_env, agent_data.monitor);
rawMonitorExit(jvmti_env, agent_data.monitor);

NSK_TRACE((*agentThreadProc)(jvmti_env, agentJNI, agentThreadArg));
NSK_TRACE((*agentThreadProc)(jvmti_env, agentJNI, agentThreadArg));

set_agent_thread_state(TERMINATED);
}
rawMonitorEnter(jvmti_env, agent_data.monitor);
agent_data.thread_state = TERMINATED;
agentJNI->DeleteGlobalRef(agentThread);
agentThread = NULL;
rawMonitorNotify(jvmti_env, agent_data.monitor);
rawMonitorExit(jvmti_env, agent_data.monitor);

/* finalize agent thread */
{
/* gelete global ref for agent thread */
agentJNI->DeleteGlobalRef(agentThread);
agentThread = NULL;
}
}

/** Start wrapper for user agent thread. */