-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
name -v
Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64
-
b04
-
x86_64
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8032562 | 9 | Staffan Larsen | P3 | Resolved | Fixed | b03 |
JDK-8045230 | 8u25 | Staffan Larsen | P3 | Resolved | Fixed | b01 |
JDK-8053234 | emb-8u26 | Staffan Larsen | P3 | Resolved | Fixed | b17 |
Agent Start-Up (Live phase)
...
If an agent is started during the live phase then its agent library must export a start-up function with the following prototype:
JNIEXPORT jint JNICALL
Agent_OnAttach(JavaVM* vm, char *options, void *reserved)
Or for a statically linked agent named 'L':
JNIEXPORT jint JNICALL
Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)
The VM will start the agent by calling this function.
....
According to this assertion the VM will never call Agent_OnAttach_L if the function exists and the agent library is dynamically linked.
This issue causes a failure of 366 JCK 8 tests (JCK-7301996)
Error log is:
--''--
Successfully attached to JVM with id: 15050
Native agent successfully loaded: name=jckjvmti opts=ascl00101
Agent_OnAttach_jckjvmti entry was unexpectedly invoked
--''--
Source file that returns "failed" status is JCK-runtime-8/src/javasoft/sqe/jck/lib/jvmti/Agent.java
Appropriate code snippet is:
if (isOnAttachMode) {
if (isJckjvmtiStaticallyLinked) {
if (!isAgentOnAttachForJckJvmtiInvoked()) {
out.println("Agent_OnAttach_jckjvmti entry was not invoked as expected\n");
status = STAT_FAILED;
return false;
}
if (isAgentOnAttachInvoked()) {
out.println("Agent_OnAttach entry was unexpectedly invoked");
status = STAT_FAILED;
return false;
}
} else {
if (!isAgentOnAttachInvoked()) {
out.println("Agent_OnAttach entry was not invoked as expected");
status = STAT_FAILED;
return false;
}
if (isAgentOnAttachForJckJvmtiInvoked()) {
out.println("Agent_OnAttach_jckjvmti entry was unexpectedly invoked");
status = STAT_FAILED;
return false;
}
}
if (isAgentOnLoadInvoked()) {
out.println("Agent_OnLoad entry was unexpectedly invoked");
status = STAT_FAILED;
return false;
}
if (isAgentOnLoadForJckJvmtiInvoked()) {
out.println("Agent_OnLoad_jckjvmti entry was unexpectedly invoked\n");
status = STAT_FAILED;
return false;
}
}
Note: This issue only happens on Mac OS X (10.9.1)
- backported by
-
JDK-8032562 Mac OS X: VM starts the agent by calling both Agent_OnAttach and Agent_OnAttach_L functions if its agent library is dynamically linked.
- Resolved
-
JDK-8045230 Mac OS X: VM starts the agent by calling both Agent_OnAttach and Agent_OnAttach_L functions if its agent library is dynamically linked.
- Resolved
-
JDK-8053234 Mac OS X: VM starts the agent by calling both Agent_OnAttach and Agent_OnAttach_L functions if its agent library is dynamically linked.
- Resolved
- relates to
-
JDK-8035620 JVMTI tests do not work under plugin on MacOS
- Closed