JDK-6434825 : JVMTI Spec: Agent_OnUnload needs clarifications
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-06
  • Updated: 2011-02-16
  • Resolved: 2006-07-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b92Fixed
Related Reports
Relates :  
Description
The JVM TI specification (1.1.95) at:
 http://download.java.net/jdk6/doc/platform/jvmti/jvmti.html
states as follows about native agent's shutdown (unloading) from VM:
  --- Excerpt-from-spec --- 
  ...
  JNIEXPORT void JNICALL 
  Agent_OnUnload(JavaVM *vm)

  This function will be called by the VM when the library is about to be unloaded.
  The library will be unloaded and this function will be called if some platform
  specific mechanism causes the unload (an unload mechanism is not specified in this 
  document) or the library is (in effect) unloaded by the termination of the VM 
  whether through normal termination or VM failure, including start-up failure. 
  ...
  This function can be used to clean-up resources allocated during Agent_OnLoad.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ...
  --- End-of-excerpt-from-spec --- 

That final statement (that is can be used to clean-up resources) should really 
say "Agent_OnLoad or Agent_OnAttach" because it's unclear from the spec 
when and how an agent which is loaded in Live Phase will be unloaded from VM.

Comments
EVALUATION When Agent_OnAttach was added, this was overlooked and must be corrected. Spec only so marking it mustang-doc.
06-06-2006