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

VMDeathEvent results in com.sun.jdi.InternalException

XMLWordPrintable

    • generic
    • generic



      Name: abR10010 Date: 11/05/2001



      Hotspot fails to pass the test against the method EventSet.resume()
      invoked on a set containing VMDeathEvent with
      the suspend policy EventRequest.SUSPEND_EVENT_THREAD.
      The test works as follows.

      A debugger creates the VMDeathRequest, sets up

          request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);

      and makes a debuggee to end.
      Upon getting new EventSet object, containing VMDeathEvent,
      the debugger invokes
                              eventSet.resume();
      that results in throwing
          com.sun.jdi.InternalException: Inconsistent suspend policy

      The specifications for the methods in both VMDeathRequest and EventRequest
      neither prohibit the argument SUSPEND_EVENT_THREAD
      nor contain the Internalexception among those to throw.
      Note, that the specification for VMDeathRequest
      contains the following non-obligatory statement:
          This request would typically be created so that
          a VMDeathEvent with a suspend policy of SUSPEND_ALL will be sent.

      At the same time the specification for InternalException
          public class InternalException
          extends RuntimeException
          Thrown to indicate that an unexpected internal error has occurred.
      points out at some internal problem.

      So, it is hard to state what is the reason of the failure,
      the specification or the JDI reference implementation.


      This unspecified result is observed
      when HS 1.4.0-beta3-b84 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}


          This bug affects the following testbase_nsk tests:
          
          nsk/jdi/EventSet/resume/resume012


      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


      lines 313-332 :

              log1(" TESTING BEGINS");

              EventRequest eventRequest2 = null;

              final int SUSPEND_THREAD = EventRequest.SUSPEND_EVENT_THREAD;


      breakpointForCommunication();

              //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ variable part

              eventRequest2 = settingVMDeathRequest ( SUSPEND_THREAD,
      "VMDeathRequest2");
              eventRequest2.enable();

              mainThread.resume();

      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      log1(" TESTING ENDS");
      return;



      lines 241-247 :

                      log2("waiting for VMDeathEvent");
                      getEventSet();
                      if ( !(eventIterator.nextEvent() instanceof VMDeathEvent) ) {
                          log3("ERROR: last event is not the VMDeathEvent");
                          return 1;
                      }
                      check();


      lines 462-474 :

          void check() {

              log2("......checking up on EventSet.resume()");
              try {
                  log2(" eventSet.resume(); :: no Exception expected");
                  eventSet.resume();
              } catch ( Exception e ) {
                  log3("ERROR: Exception : " + e);
                  testExitCode = FAILED;
                  log2(" vm.resume;");
                  vm.resume();
              }
          }


      ======================================================
      // log with comments


      ==> nsk/jdi/EventSet/resume/resume012 TESTING BEGINS
      --> debugger: breakpointForCommunication
      debugee.stderr> **> debuggee: debuggee started!
      --> debugger: ......setting up VMDeathRequest:
      --> debugger: suspendPolicy: 1; property: VMDeathRequest2

      ==> nsk/jdi/EventSet/resume/resume012 TESTING ENDS
      --> debugger: waiting for VMDeathEvent
      --> debugger: ......checking up on EventSet.resume()
      --> debugger: eventSet.resume(); :: no Exception expected
      # ERROR: ##> debugger: ERROR: Exception : com.sun.jdi.InternalException:
      Inconsistent suspend policy
                                                
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      --> debugger: vm.resume;
      --> debugger: waiting for VMDisconnectEvent
      --> debugger: test phase has finished normally
      --> debugger: waiting for the debuggee to finish ...
      --> debugger: ......getting the debuggee's exit status
      --> debugger: ......debuggee returned expected exit status: 95 == PASS_BASE
      TEST FAILED

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

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

            Unassigned Unassigned
            bondsunw Bond Bond (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: