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

Four EventRequest methods are invokable on deleted request

XMLWordPrintable

    • b10
    • generic
    • generic

      : NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: VMDeath
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();

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

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


      Name: abR10010 Date: 12/14/2001


      This is the part of the specification for the method
          EventRequestManager.deleteEventRequest(EventRequest eventRequest) :

          public void deleteEventRequest(EventRequest eventRequest)
          Removes an eventRequest.
          The eventRequest is disabled and the removed from the
          requests managed by this EventRequestManager.
          Once the eventRequest is deleted, no operations
          (for example, EventRequest.setEnabled(boolean)) are permitted -
          attempts to do so will generally cause an InvalidRequestStateException.

      However, the test

          nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002

      shows that no InvalidRequestStateException is thrown if
      any of the following methods:

          EventRequest.getProperty(Object key)
          EventRequest.isEnabled()
          EventRequest.putProperty(Object key, Object value)
          EventRequest.suspendPolicy()

      is invoked on a deleted request;
      this is so for all request subclasses.


      This unspecified result is observed
      when HS 1.4.0-rc-b89 is runnning a test program
      on the following H/S configurations:

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


      Corresponding code fragments in a debugger and a debuggee
      and corresponding log for the tested case are below.


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


      The tests will be in the next release of testbase_nsk;
      the current release of testbase_nsk (1.4) is accessible through:

          /net/sqesvr.sfbay/export/vsn/VM/testbase/testbase_nsk.v14


      ///////////////////////////////////////////////////////////////////////

      ///////////// code fragments in the debugger

              EventRequest requestArray[] = new EventRequest[12];

              String fieldName1 = "testField1";
              String fieldName2 = "testField2";
              String fieldName3 = "testField3";



                  Field field1 = debuggeeClass.fieldByName(fieldName1);

              ReferenceType refType = (ReferenceType)
              debuggeeClass.getValue(debuggeeClass.fieldByName(fieldName2)).type();

                  ThreadReference threadRef = (ThreadReference)
                                      debuggeeClass.getValue(debuggeeClass.fieldByName(fieldName3));

                  String requests[] = { "AccessWatchpoint", "ModificationWatchpoint",
                                        "Breakpoint", "ClassPrepare",
                                        "ClassUnload", "Exception",
                                        "MethodEntry", "MethodExit",
                                        "Step", "ThreadDeath",
                                        "ThreadStart", "VMDeath" };

              requestArray[0] = eventRManager.createAccessWatchpointRequest(field1);
              requestArray[1] = eventRManager.createModificationWatchpointRequest(field1);
              requestArray[2] = eventRManager.createBreakpointRequest(breakpLocation);
              requestArray[3] = eventRManager.createClassPrepareRequest();
              requestArray[4] = eventRManager.createClassUnloadRequest();
              requestArray[5] = eventRManager.createExceptionRequest(refType, false, false);
              requestArray[6] = eventRManager.createMethodEntryRequest();
              requestArray[7] = eventRManager.createMethodExitRequest();
              requestArray[8] = eventRManager.createStepRequest(threadRef, StepRequest.STEP_MIN,
      StepRequest.STEP_OUT);
              requestArray[9] = eventRManager.createThreadDeathRequest();
              requestArray[10] = eventRManager.createThreadStartRequest();
              requestArray[11] = eventRManager.createVMDeathRequest();

              for (int i1 = 0; i1 < requestArray.length; i1++) {

              log2("......eventRManager.deleteEventRequest(requestArray[i1]); :: " + requests[i1]);
              eventRManager.deleteEventRequest(requestArray[i1]);

              try {
              requestArray[i1].addCountFilter(1);
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for addCountFilter(1);");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].disable();
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for disable();");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].enable();
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for enable();");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].getProperty("number");
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for getProperty('number');");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].isEnabled();
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for isEnabled();");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].putProperty("number", "request" + i1);
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for putProperty('number', 'request' +
      i1);");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].setEnabled(true);
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for setEnabled(true);");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].setSuspendPolicy(EventRequest.SUSPEND_NONE);
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for
      setSuspendPolicy(EventRequest.SUSPEND_NONE);");
              } catch ( InvalidRequestStateException e ) {
              }
              try {
              requestArray[i1].suspendPolicy();
              testExitCode = FAILED;
              log3("ERROR: NO InvalidRequestStateException for suspendPolicy();");
              } catch ( InvalidRequestStateException e ) {
              }
              }


      ///////////// code fragments in the debuggee

          static int testField1 = 0;
          static NullPointerException testField2 = new NullPointerException("test");
          static Thread1delevtreq002a testField3 = null;

          //------------------------------------------------------ common section

          static int exitCode = PASSED;

          static int instruction = 1;
          static int end = 0;
                                         // static int quit = 0;
                                         // static int continue = 2;
          static int maxInstr = 1; // 2;

          static int lineForComm = 2;
          
          private static void methodForCommunication() {
              int i1 = instruction;
              int i2 = i1;
              int i3 = i2;
          }
          //---------------------------------------------------- main method
          
          public static void main (String argv[]) {

              argHandler = new ArgumentHandler(argv);
              log = argHandler.createDebugeeLog();

              log1("debuggee started!");

              label0:
                  for (int i = 0; ; i++) {

                      if (instruction > maxInstr) {
      logErr("ERROR: unexpected instruction: " + instruction);
                          exitCode = FAILED;
      break ;
      }
       
                      switch (i) {

          //------------------------------------------------------ section tested

                          case 0:
         synchronized (lockObj1) {
         testField3 = new Thread1delevtreq002a("thread1");
         threadStart(testField3);
         methodForCommunication();
         }
                                  break ;
                                  
          //------------------------------------------------- standard end section

                          default:
         instruction = end;
         methodForCommunication();
                           break label0;
                      }
                  }

              log1("debuggee exits");
              System.exit(exitCode + PASS_BASE);
          }

          static Object lockObj1 = new Object();
          static Object waitnotifyObj = new Object();

          static int threadStart(Thread t) {
              synchronized (waitnotifyObj) {
                  t.start();
                  try {
                      waitnotifyObj.wait();
                  } catch ( Exception e) {
                      exitCode = FAILED;
                      logErr(" Exception : " + e );
                      return FAILED;
                  }
              }
              return PASSED;
          }
      }

      class Thread1delevtreq002a extends Thread {

          String tName = null;
       
          public Thread1delevtreq002a(String threadName) {
              super(threadName);
              tName = threadName;
          }
          
          public void run() {
              delevtreq002a.log1(" 'run': enter :: threadName == " + tName);
              synchronized(delevtreq002a.waitnotifyObj) {
                  delevtreq002a.waitnotifyObj.notify();
              }
              synchronized(delevtreq002a.lockObj1) {
                  delevtreq002a.log1(" 'run': exit :: threadName == " + tName);
              }
              return;
          }
      }







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

      // log

      ==> nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002 TESTING BEGINS
      --> debugger: breakpointForCommunication
      debugee.stderr> **> debuggee: debuggee started!
      debugee.stderr> **> debuggee: 'run': enter :: threadName == thread1

      ==> nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002 :::::: case: # 0
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: AccessWatchpoint
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: ModificationWatchpoint
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: Breakpoint
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: ClassPrepare
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: ClassUnload
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: Exception
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: MethodEntry
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: MethodExit
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: Step
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: ThreadDeath
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for getProperty('number');
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for isEnabled();
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for putProperty('number', 'request' + i1);
      # ERROR: ##> debugger: ERROR: NO InvalidRequestStateException for suspendPolicy();
      --> debugger: ......eventRManager.deleteEventRequest(requestArray[i1]); :: ThreadStart
      # ERROR: ##> debugger: ERROR

            dtitov Daniil Titov (Inactive)
            bondsunw Bond Bond (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: