JDK-6335921 : AttachProvider.listVirtualMachines should only return VMs that we can attach too
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux_redhat_3.0
  • CPU: generic,x86
  • Submitted: 2005-10-12
  • Updated: 2017-05-16
  • Resolved: 2005-12-03
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.
6 b63Fixed
Related Reports
Duplicate :  
Relates :  
Currently the VirtualMachine.list method is implemented to enumerate all 1.4.2+ VMs. The method is not a general purpose enumeration API so this should be changed to return only 6.0+ VMs that we can attach too. 

In addition, the AttachProvider.listVirtualMachines methods has wording to allow for non-attachable VMs to be included in the list. This wording should be tweaked to avoiding tools being concerned that the returned lists includes other VMs. The revised wording cannot of course provide a guarantee that the attach will succeed.

Also the current signature of the list method is this:
  public static List<? extends VirtualMachineDescriptor> list()
which forces the user of the API to use the wildcard too. It would be simpler if this were changed to:
  public static List<VirtualMachineDescriptor> list()

Finally, as the current implementation of the listVirtualMachines is based on jvmstat is means that an empty list is returned on Windows when the temporary file system is FAT. An alternative implementation should be provided to avoid this issue.

EVALUATION The signature & spec update is minor and should be done before the spec freezes. I've prototyped the fix to the TMP/FAT "problem" so the only remaining piece is to have the listVirtualMachine implementation return only 6.0+ VMs. Very low risk and will do for RC.