JDK-4419459 : JDI spec: Locatable.location() returns non-null for a native method
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2001-02-27
  • Updated: 2002-08-30
  • Resolved: 2002-08-30
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.0 beta2Fixed
Related Reports
Relates :  
Description

Name: elR10090			Date: 02/27/2001




The method  Locatable.location()
returns incorrect non-null value 
when it is applied to object in a debugger
mirroring a native method in a debuggee.

This incorrect returned result is observed
for JDI version 1.4.0-beta-b52
when HS 1.4.0-beta-b52 is runnning a test program
on the following H/S configurations:

 - SUNW Ultra1: sparc 200MHz, RAM 128Mb;  
   OS: Solaris-8;            
   JVM: Client & Server
 - Intel: dual Pentium-III 600MHz processors, RAM 512Mb;  
   OS: Solaris-8;            
   JVM: Client & Server
 - Intel: dual Pentium-III 600MHz processors, RAM 512Mb;  
   OS: Linux/RedHat6.2;      
   JVM: Client & Server
 - Intel: Pentium-II 350MHz, RAM 128Mb;  
   OS: WinNT/4-Workstation;  
   JVM: Client & Server

The specification for the method states the following:

    public Location location()
    Returns the Location of this mirror, 
    if there is executable Java language code associated with it.
    Returns:
         the Location of this mirror, or 
         null if there is no executable code associated with it.
         For example, abstract and native Methods will return null 
         when their location method is called.

However, a special test agains the method shows that
native Method returns non-null value.

Below, there are corresponding code fragments 
in the debugger and debuggee implementing the test,
and corresponding log for the tested native method.



Steps to reproduce :
1. cd /net/sqesvr.eng/export/vsn/GammaBase/Bugs/{this bug ID}
2. ksh doit.sh {JAVA_HOME}



The tests will be in the next release of testbase_nsk 
which is accessable through:

    /net/sqesvr.eng/export/vsn/VM/testbase/testbase_nsk


    This bug affects the following testbase_nsk tests:
    
    nsk/jdi/Locatable/location/location006



------------------------------
// testing programm in the debugger

            String mName = "nsk.jdi.Locatable.location";

            List listOfDebuggeeClasses = vm.classesByName(mName + ".TestClass");
	        
	    List     methods   = null;
	    Method   m         = null;
	    Location mLocation = null;

	    methods = ((ReferenceType) listOfDebuggeeClasses.get(0)).
	              methodsByName("nativeMethod");
	    m = (Method) methods.get(0);
	    mLocation = m.location();
	                                	                
	    if (mLocation != null) {
	        log3("ERROR: mLocation != null for a native method");
                testExitCode = FAILED;
	    }	   

------------------------------
// tested method in the debuggee:

class TestClass {  

    public  native   void    nativeMethod(); 
}


-------------
// log:

==> nsk/jdi/Locatable/location/location006        TESTING BEGINS

==> nsk/jdi/Locatable/location/location006  new check: #0
##> location006: ERROR: mLocation != null for a native method
--> location006:      : returned string is 'checkend'

==> nsk/jdi/Locatable/location/location006        TESTING ENDS

------------


======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta2 FIXED IN: merlin-beta2 INTEGRATED IN: merlin-beta2 VERIFIED IN: merlin-beta2
14-06-2004

PUBLIC COMMENTS Submitter is looking at the 1.3 spec. Please see bug #4252790. The spec was inconsistent and the definition of Locatable.location() was changed for Merlin. However, the spec now says too little and should be more explanitory.
10-06-2004

EVALUATION Submitter is looking at the 1.3 spec. Please see bug #4252790. The spec was inconsistent and the definition of Locatable.location() was changed for Merlin. However, the spec now says too little and should be more explanitory. robert.field@Eng 2001-04-17
17-04-2001