JDK-6434402 : REGRESSION: no longer possible to bootstrap java agent into embedded VM
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-06
  • Updated: 2012-03-22
  • Resolved: 2006-06-21
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 b89Fixed
Related Reports
Relates :  
Description
Since b65 is no longer possible to bootstrap a java agent into a VM that isn't created by the java launcher.

To duplicate this issue use a custom launcher or simply load an applet in the browser. Then try to connect using jconsole:

$ jconsole <pid>
Exception in thread "VMPanel.connect" java.lang.InternalError: instrument library is missing in target VM
        at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:87)
        at sun.tools.jconsole.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:245)
        at sun.tools.jconsole.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:83)
        at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:327)
        at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:297)
        at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:277)

When jconsole attaches to the target VM it will request the target VM to load management-agent.jar. Loading a java agent requires loading libinstrument.so and this library cannot be loaded due to the dependence on jli/libjli.so. This issue did not exist prior to b65.

Comments
SUGGESTED FIX Modify the Makefile for libinstrument.so to include a runpath entry of $(ORIGIN)/jli. Code similar to this can be found in the Makefile for the launcher, but it is simpler here because there is only one relative path between the libraries, not two as is possible for the launcher.
13-06-2006

EVALUATION This is because libinstrument does not alter the library search path directly to find libjli.so - it depended upon the java launcher to have done this for it.
13-06-2006