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

STD: Debugger hangs when step over inside finally block

    XMLWordPrintable

Details

    • 1.2
    • x86
    • windows_nt
    • Not verified

    Description



      Name: mf23781 Date: 10/22/98


      *Test case:


      J20i_MyThread.java
      =================================================================

      class J20i_MyThread extends Thread {


      public void run() {
      try {
      for(;;) System.out.println("Forever...");
      }
      catch (ThreadDeath e ) {
      System.out.println("catch in Thread run()..."); //put a break point here; stop here after invoking stop() //LOC:TC0001.01
      throw e;
      }
      finally {
      System.out.println("finally in Thread");

      }
      }

      }
      =================================================================



      J20i_Thread.java
      =================================================================

      class J20i_Thread {


       public static void main(String[] args) {

      try {
      System.out.println("main...");
      J20i_MyThread oJ20i_MyThread1 = new J20i_MyThread();
      oJ20i_MyThread1.start();
      Thread.sleep(100); //Let the oJ20i_MyThread1 run for a while
      oJ20i_MyThread1.stop(); //LOC:TC0001.02 //Put a breakpoint here, and stepover
      //put another breakpoint at the catch(ThreadDeath) handler
      //The "future" execution point will be the catch(ThreadDeath) handler
      //Note: the catch handler may NOT be the immediate next step
      }

      catch (InterruptedException e) {} //for Thread's sleep()

      finally {
      System.out.println("finally in main()...");
      }
      System.out.println("After finally in main()...");
       }

      }
      =================================================================


      *Steps to reproduce the problem:

      jdb J20i_Thread
      stop in J20i_Thread.main
      run
      stop at J20i_Thread:14
      cont
      next
      next
      next


      The first 'next' will usually hang jdb. Sometimes, the 3rd next never
      completes.

      *Output:

      P:\defects\6933>jdb J20i_Thread
      Initializing jdb...
      0x10803a8:class(J20i_Thread)
      > stop in J20i_Thread.main
      Breakpoint set in J20i_Thread.main
      > run
      run J20i_Thread
      running ...
      main[1]
      Breakpoint hit: J20i_Thread.main (J20i_Thread:10)
      main[1] stop at J20i_Thread:14
      Breakpoint set at J20i_Thread:14
      main[1] cont
      main[1] main...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Breakpoint hit: J20i_Thread.main (J20i_Thread:14)
      main[1] next
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...
      Forever...


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

      Attachments

        Activity

          People

            ghirschsunw Gordon Hirsch (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: