JDK-4698235 : JPDA backend needs to check version before using GetCapabilities() results
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-06-06
  • Updated: 2003-04-12
  • Resolved: 2002-09-02
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.
Other
1.4.2 mantisFixed
Related Reports
Relates :  
Relates :  
Description
###@###.### 2002-06-06

The HotSpot implementation of JVM/DI GetCapabilities() does not
zero out the unused bits. This means that newer versions of the
JPDA backend will see random results when querying capabilities
of older HotSpot VMs. The backend needs to check the JVM/DI
version number before believing newer GetCapabilities() values.

The problem is mapping capabilities to JVM/DI version numbers.
Here is the info I've been able to gather so far.

JDK1.3.1 - JVMDI_VERSION_1
    baseline so, by definition, nothing new

JDK1.4.0 - jvmdi.h on 2000.11.27
    JVMDI_VERSION_1_1 added
    several new error codes added
    can_change_schema renamed to can_unrestrictedly_redefine_classes
    GetSourceDebugExtension() added

JDK1.4.0 - jvmdi.h on 2001.05.29
    JVMDI_VERSION_1_2 added
    two new error codes added
    IsMethodObsolete() added

JDK1.4.0-update2 - jvmdi.h on 2002.05.10
    JVMDI_VERSION_1_3 added
    can_suspend_resume_thread_lists added

JDK1.4.0 - VirtualMachineImpl.c on 2000.11.27
    can_redefine_classes added
    can_add_method added
    can_change_schema added
    can_unrestrictedly_redefine_classes added
    can_pop_frame added
    canPopFrames added as false
    canPopObsoleteFrames added as false

JDK1.4.0 - VirtualMachineImpl.c on 2001.03.05
    can_change_schema deleted
    JDWP minor version rolled to 5

JDK1.4.0 - VirtualMachineImpl.c on 2001.06.12
    canPopFrames merged with can_pop_frame
    canPopObsoleteFrames deleted

JDK1.4.0 - VirtualMachineImpl.c on 2001.06.20
    JDWP minor version rolled back to 4
    canUseInstanceFilters added
    canGetSourceDebugExtension added
    canRequestVMDeathEvent added

JDK1.4.0 - VirtualMachineImpl.c on 2001.07.19
    canSetDefaultStratum added

JDK1.4.0 - VirtualMachineImpl.c on 2002.05.10
    can_suspend_resume_thread_lists added

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic mantis mantis-b02 FIXED IN: mantis mantis-b02 INTEGRATED IN: mantis mantis-b02
14-06-2004

EVALUATION ###@###.### 2002-06-07 The only new JVM/DI capability field added since JVMDI_VERSION_1 is can_suspend_resume_thread_lists which was added in JVMDI_VERSION_1_3. The can_change_schema was renamed to can_unrestrictedly_redefine_classes in JVMDI_VERSION_1_1, but the field was previously initialized to false. So the only exposure we have to an uninitialized capability field is in JVMDI_VERSION_1_3 which has not yet seen the light of day. The JPDA backend work for JVMDI_VERSION_1_3 is being done with the following bug ID: 4683021 4/4 RFE: backend should use SuspendThreadList()/ ResumeThreadList() when ready
11-06-2004

SUGGESTED FIX ###@###.### 2002-06-06 After each call to GetCapabilities(), add a check for the VM's JVM/DI version number and set newer capability fields to false for JVM/DI versions that don't really support the capability. ###@###.### 2002-06-07 After e-mail and phone discussions with Robert, a better solution has emerged. Add a thin wrapper around JVM/DI GetCapabilities() that caches the capabilities and properly initilizes new capability fields in older JVM/DI versions. Change the calls to JVM/DI GetCapabilities() in VirtualMachineImpl.c to use the new wrapper. The check for the new can_suspend_resume_thread_lists capability should also use the new wrapper. See 4683021,4698235-webrev-cr1.tar attached to bug 4683021 for the proposed changes.
11-06-2004

PUBLIC COMMENTS .
10-06-2004