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

Thread.stop() and Stop thread mechanism is not working in hotspot VM.

XMLWordPrintable

    • generic
    • generic

      This bug affects the following tests from testbase_nsk:
       
          nsk/jdb/kill/kill001


      Thread stop mechanism is not working in 1.4.2 and 1.5. Thread.Stop() is
      deprecated but jvmdi/jvmti still need this functionality.

      I am attaching a test case which is modified from jvmdi test case
      which does not use jvmdi interface.

      Expected output:

      =>/java/re/jdk/1.4.1/latest/binaries/solaris-sparc/bin/java kill001a
      Thread started: MyThread-0
      Thread started: MyThread-1
      Thread started: MyThread-2
      Thread started: MyThread-3
      Thread started: MyThread-4
      notKilled == 0 <========== This indicates all threads stopped.

      Current output:
      Thread started: MyThread-0
      Thread started: MyThread-1
      Thread started: MyThread-2
      Thread started: MyThread-3
      Thread started: MyThread-4
      notKilled == 4 <====== This indicates Thread.stop() did not stop
      4 java threads and it continued to execute.

      Signal mechanism used to stop thread seems to be broken. I do not know
      the details yet.



      ###@###.### 2003-06-19
       

      After adding a Thread.sleep() in the code it seems to work
      fine. Looks like adding any statement in the code which
      makes thread transition from Java to VM seems to work.
      And I wonder why synchronized (kill001a.lock) {}
      does not make any state transition?

      I guess we could close this bug or transfer it to the
      test group to fix the test case.

      Fix for test case would be add Thread.sleep(1) or any other
      call which makes java to vm thread state transition.

      Thamnks Mingyao for looking at this problem.

      -Swamy



            myangsunw Mingyao Yang (Inactive)
            swamyv Swamy Venkataramanappa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: