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

After a suspend, the 'up' command can take you off the end of the stack

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.1.4
    • 1.1.3
    • core-svc
    • 1.1.4
    • generic
    • windows_95
    • Not verified

      When the user types the 'suspend' command in jdb, the cached image of the stack held by the client is not cleared, so if 'up' commands are given, they are based on an out of date image of the stack.


      TEST CASE #1 - Up off the end of the stack

      To use this test case, type:

      jdb UpOffEnd
      stop in UpOffEnd.stop
      run
      cont
      suspend
      up
      up
      up
      up
      up
      ...


      ---

      If the bug is present, you should be able to go up to about main[7].

      If you then type 'down' several times to get you back to main[1], and then type 'where', however, you'll be in the while loop, so the stack will only have two levels.

      This does not crash on Solaris, but it can crash horribly on Win32.


      --- Here is the test case code:

      public class UpOffEnd
      {
        public static void main(String argv[])
        {
          test1();
          int j = 0;
          while (true) {
            j++;
          }
        }

        static void test1() {test2();}
        static void test2() {test3();}
        static void test3() {test4();}
        static void test4() {stop();}
        static void stop() {}
      }

            rfield Robert Field (Inactive)
            rschiavisunw Richard Schiavi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: