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

Step debugging thread seems to hang debugger

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.8
    • 1.1.6
    • core-svc
    • 1.1.8
    • generic, x86
    • generic, windows_nt
    • Not verified



        Name: mf23781 Date: 08/03/98


        To reproduce the problem simply do the following once you
        have compiled the attached test case:

        jdb J8_3_D1
        stop in J8_3_D1.main
        run
        next
        step
        step
        stop at J8_3_C3:41
        cont
        next
        next
        .
        .
        .

        Will eventually freeze jdb.


        Test case:

        public class J8_3_D1
        {

        public void f2()
        {
        J8_3_C3 o1 = new J8_3_C3();
        J8_3_C4 o2 = new J8_3_C4();
        o1.start();
        o2.start();
        }


        public static void main( String [] args )
        {
        J8_3_D1 o = new J8_3_D1();
        o.f2();
        }
        }


        class J8_3_C2
        {
        static volatile int i=0, j=0;
        public static void f1() { i++; j++; }
        public static void f2()
        {
        System.out.println("i="+i+" j="+j);
        }
        }

        class J8_3_C3 extends Thread
        {
        J8_3_C2 o = new J8_3_C2();

        public void run()
        {
        while (o.i<1000000)
        {
        o.f1();
        }
        }
        }

        class J8_3_C4 extends Thread
        {
        J8_3_C2 o = new J8_3_C2();

        public void run()
        {
        while (o.i<1000000)
        {
        o.f2();
        }
        }
        }


        The outputs on 1.1.6, 1.1.7 and 1.2beta4 vary but sample ones are
        included below:

        Against 1.1.6:

        jdb J8_3_D1
        Initializing jdb...
        Warning: JIT compiler "symcjit" not found. Will use interpreter.
        Warning: JIT compiler "symcjit" not found. Will use interpreter.
        0xf8fb68:class(J8_3_D1)
        > stop in J8_3_D1.main
        Breakpoint set in J8_3_D1.main
        > run
        run J8_3_D1
        running ...
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:17)
        main[1] next
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:18)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_D1.f2 (J8_3_D1:8)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_C3.<init> (J8_3_C3:33)
        main[1] stop at J8_3_C3:41
        Breakpoint set at J8_3_C3:41
        main[1] cont
        main[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-96[1] next
        Thread-96[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-96[1] next
        Thread-96[1] i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1

        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-96[1] next
        Thread-96[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-96[1] next
        Thread-96[1] i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        i=2 j=2
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-96[1] next
        Thread-96[1] next

        Then jdb hangs. Doens't always hang at the same point.

        Against 1.1.7:

        jdb J8_3_D1
        Initializing jdb...
        0xf8ff70:class(J8_3_D1)
        > stop in J8_3_D1.main
        Breakpoint set in J8_3_D1.main
        > run
        run J8_3_D1
        running ...
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:17)
        main[1] next
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:18)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_D1.f2 (J8_3_D1:8)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_C3.<init> (J8_3_C3:33)
        main[1] stop at J8_3_C3:41
        Breakpoint set at J8_3_C3:41
        main[1] cont
        main[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-95[1] next
        Thread-95[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-95[1] next
        Thread-95[1] i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1
        i=1 j=1

        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-95[1] next
        Thread-95[1] next

        Then jdb hangs. Again jdb doesn't always hang at the same point though.

        Against 1.2beta4:

        jdb J8_3_D1
        Initializing jdb...
        0x9e:class(J8_3_D1)
        > stop in J8_3_D1.main
        Breakpoint set in J8_3_D1.main
        > run
        run J8_3_D1
        running ...
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:17)
        main[1] next
        main[1]
        Breakpoint hit: J8_3_D1.main (J8_3_D1:18)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_D1.f2 (J8_3_D1:8)
        main[1] step
        main[1]
        Breakpoint hit: J8_3_C3.<init> (J8_3_C3:33)
        main[1] stop at J8_3_C3:41
        Breakpoint set at J8_3_C3:41
        main[1] cont
        main[1]
        Current thread "main" died. Execution continuing...
        >
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next

        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] Thread-1[1] next
        Thread-1[1]
        Breakpoint hit: J8_3_C3.run (J8_3_C3:39)
        Thread-1[1] next

        Breakpoint hit: J8_3_C3.run (J8_3_C3:41)
        Thread-1[1] Thread-1[1] next
        Thread-1[1] i=13 j=13
        i=13 j=13next

        This again hangs jdb after a random period of time.

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

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: