Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4419459

JDI spec: Locatable.location() returns non-null for a native method

XMLWordPrintable

    • beta2
    • generic
    • generic
    • Verified



      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

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


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

            rfield Robert Field (Inactive)
            latkinsunw Latkin Latkin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: