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

/test/java/awt/Robot/RobotTest Multithreaded Stress Test deadlocks

XMLWordPrintable

    • b03
    • sparc
    • solaris_9
    • Verified

      Run the test, and choose Other, Multithreaded Stress Test

      I put a few extra printlns in to show what is happening. My modifications
      are below, and the thread dump is below that:

      sccs diffs -C RobotTest.java

      ------- RobotTest.java -------
      *** /tmp/sccs.APaOF6 Sun Apr 27 21:13:41 2003
      --- RobotTest.java Sun Apr 27 21:05:11 2003
      ***************
      *** 375,386 ****
                      threads[nthread].start();
                  }
        
      ! for ( int nthread = 0; nthread < threads.length; nthread++ ) {
      ! try {
      ! threads[nthread].join();
      ! } catch (InterruptedException ie) {
      ! }
      ! }
        
                  new MessageDialog(RobotFrame.this, "Stress Test", "Test completed.");
              }
      --- 375,388 ----
                      threads[nthread].start();
                  }
        
      ! for ( int nthread = 0; nthread < threads.length; nthread++ ) {
      ! try {
      ! System.out.println("Joining Thread");
      ! threads[nthread].join();
      ! } catch (InterruptedException ie) {
      ! System.out.println("Caught IE from joining");
      ! }
      ! }
        
                  new MessageDialog(RobotFrame.this, "Stress Test", "Test completed.");
              }
      ***************
      *** 396,408 ****
              }
        
              public void run() {
                  for( int iteration = 0; iteration < maxIters; iteration++) {
                      Random rand = new Random();
                      try {
                          Robot robot = new Robot();
                      } catch(AWTException ae) {
      - new MessageDialog(RobotFrame.this, "Robot", ae.getMessage());
                          ae.printStackTrace();
                      }
                      Rectangle captureRect = new Rectangle();
                      Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
      --- 398,412 ----
              }
        
              public void run() {
      + System.out.println("Starting Thread #" + tnum);
                  for( int iteration = 0; iteration < maxIters; iteration++) {
                      Random rand = new Random();
                      try {
                          Robot robot = new Robot();
      + System.out.println(" Thread #" + tnum +" created Robot iteration #"+iteration);
                      } catch(AWTException ae) {
                          ae.printStackTrace();
      + new MessageDialog(RobotFrame.this, "Robot", ae.getMessage());
                      }
                      Rectangle captureRect = new Rectangle();
                      Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
      ***************
      *** 412,419 ****
                      captureRect.width = Math.abs(rand.nextInt() % size.width);
                      captureRect.height = Math.abs(rand.nextInt() % size.height);
                      robot.createScreenCapture(captureRect);
                      robot.mouseMove(captureRect.x, captureRect.y);
      ! System.out.println("Thread #" + tnum +" iteration #"+iteration);
                  }
              }
            }
      --- 416,424 ----
                      captureRect.width = Math.abs(rand.nextInt() % size.width);
                      captureRect.height = Math.abs(rand.nextInt() % size.height);
                      robot.createScreenCapture(captureRect);
      + System.out.println(" Thread #" + tnum +" captured iteration #"+iteration);
                      robot.mouseMove(captureRect.x, captureRect.y);
      ! System.out.println("Thread #" + tnum +" finishing iteration #"+iteration);
                  }
              }
            }
      echawkes@gradgrind:/net/jano/export/disk26/awt/echawkes/jdk15-3/test/java/awt/Robot/RobotTest( 180 )%


      echawkes@gradgrind:/net/jano/export/disk26/awt/echawkes/jdk15-3/test/java/awt/Robot/RobotTest( 178 )% /import/java/jdk1.5/solaris-sparc/bin/java RobotTest
      Joining Thread
      Starting Thread #0
      Starting Thread #1
      Starting Thread #2
      Starting Thread #3
      Starting Thread #4
      Starting Thread #5
      Starting Thread #6
      Starting Thread #7
      Starting Thread #8
      Starting Thread #9
      Starting Thread #10
      Starting Thread #11
      Starting Thread #12
      Starting Thread #13
      Starting Thread #14
      Starting Thread #15
      Starting Thread #16
      Starting Thread #17
      Starting Thread #18
      Starting Thread #19
        Thread #0 created Robot iteration #0
        Thread #1 created Robot iteration #0
        Thread #2 created Robot iteration #0
        Thread #3 created Robot iteration #0
        Thread #4 created Robot iteration #0
        Thread #5 created Robot iteration #0
        Thread #6 created Robot iteration #0
        Thread #7 created Robot iteration #0
        Thread #8 created Robot iteration #0
        Thread #9 created Robot iteration #0
        Thread #10 created Robot iteration #0
        Thread #11 created Robot iteration #0
        Thread #12 created Robot iteration #0
        Thread #13 created Robot iteration #0
        Thread #14 created Robot iteration #0
        Thread #15 created Robot iteration #0
        Thread #16 created Robot iteration #0
        Thread #17 created Robot iteration #0
        Thread #18 created Robot iteration #0
        Thread #19 created Robot iteration #0
        Thread #0 captured iteration #0
        Thread #1 captured iteration #0
        Thread #2 captured iteration #0
      ^\Full thread dump Java HotSpot(TM) Client VM (1.5.0-beta-b05 mixed mode):

      "Thread-20" prio=6 tid=0x0013a670 nid=0x20 waiting for monitor entry [ef8ff000..ef8ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-19" prio=6 tid=0x00139bc8 nid=0x1f waiting for monitor entry [ef9ff000..ef9ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-18" prio=6 tid=0x00139120 nid=0x1e waiting for monitor entry [efaff000..efaffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-17" prio=6 tid=0x00138678 nid=0x1d waiting for monitor entry [efbff000..efbffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-16" prio=6 tid=0x00137bd0 nid=0x1c waiting for monitor entry [efcff000..efcffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-15" prio=6 tid=0x00137128 nid=0x1b waiting for monitor entry [efdff000..efdffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-14" prio=6 tid=0x00136680 nid=0x1a waiting for monitor entry [efeff000..efeffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-13" prio=6 tid=0x00135bd8 nid=0x19 waiting for monitor entry [effff000..effffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-12" prio=6 tid=0x000a5f58 nid=0x18 waiting for monitor entry [f00ff000..f00ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-11" prio=6 tid=0x000a54b0 nid=0x17 waiting for monitor entry [f01ff000..f01ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-10" prio=6 tid=0x000a4a08 nid=0x16 waiting for monitor entry [f02ff000..f02ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-9" prio=6 tid=0x000a3f60 nid=0x15 waiting for monitor entry [f03ff000..f03ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-8" prio=6 tid=0x000a34b8 nid=0x14 waiting for monitor entry [f04ff000..f04ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-7" prio=6 tid=0x000a2aa8 nid=0x13 waiting for monitor entry [f05ff000..f05ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-6" prio=6 tid=0x000a99d8 nid=0x12 waiting for monitor entry [f06ff000..f06ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-5" prio=6 tid=0x000a8f30 nid=0x11 waiting for monitor entry [f07ff000..f07ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-4" prio=6 tid=0x000a8488 nid=0x10 waiting for monitor entry [f08ff000..f08ffc2c]
              at java.awt.Robot.createScreenCapture(Robot.java:266)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:418)

      "Thread-3" prio=6 tid=0x000a79e0 nid=0xf in Object.wait() [f09ff000..f09ffc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf15d9658> (a java.awt.EventQueue$1AWTInvocationLock)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.invokeAndWait(EventQueue.java:829)
              - locked <0xf15d9658> (a java.awt.EventQueue$1AWTInvocationLock)
              at java.awt.Robot.waitForIdle(Robot.java:408)
              - locked <0xf1614dc0> (a java.awt.Robot)
              at java.awt.Robot.autoWaitForIdle(Robot.java:348)
              at java.awt.Robot.afterEvent(Robot.java:321)
              at java.awt.Robot.mouseMove(Robot.java:140)
              - locked <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:420)

      "Thread-2" prio=6 tid=0x000a6f98 nid=0xe waiting for monitor entry [f0aff000..f0affc2c]
              at java.awt.Robot.mouseMove(Robot.java:139)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:420)

      "Thread-1" prio=6 tid=0x000a6600 nid=0xd waiting for monitor entry [f0bff000..f0bffc2c]
              at java.awt.Robot.mouseMove(Robot.java:139)
              - waiting to lock <0xf1614dc0> (a java.awt.Robot)
              at RobotFrame$StressThread.run(RobotTest.java:420)

      "DestroyJavaVM" prio=5 tid=0x0002d050 nid=0x1 waiting on condition [0..ffbfe30c]

      "AWT-EventQueue-0" prio=6 tid=0x001f5bf8 nid=0xc in Object.wait() [f0cff000..f0cffc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf1615518> (a RobotFrame$StressThread)
              at java.lang.Thread.join(Thread.java:1001)
              - locked <0xf1615518> (a RobotFrame$StressThread)
              at java.lang.Thread.join(Thread.java:1054)
              at RobotFrame$StressTest.actionPerformed(RobotTest.java:381)
              at java.awt.MenuItem.processActionEvent(MenuItem.java:589)
              at java.awt.MenuItem.processEvent(MenuItem.java:548)
              at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:294)
              at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:282)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:458)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:208)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:151)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:143)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:104)

      "Java2D Disposer" daemon prio=10 tid=0x001e9088 nid=0xb in Object.wait() [f0dff000..f0dffc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf1615808> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
              - locked <0xf1615808> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at sun.java2d.Disposer.run(Disposer.java:106)
              at java.lang.Thread.run(Thread.java:534)

      "AWT-Motif" daemon prio=6 tid=0x001951a8 nid=0xa runnable [f0eff000..f0effc2c]
              at sun.awt.motif.MToolkit.run(Native Method)
              at java.lang.Thread.run(Thread.java:534)

      "AWT-Shutdown" prio=5 tid=0x00194f30 nid=0x9 in Object.wait() [f0fff000..f0fffc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf16158c8> (a java.lang.Object)
              at java.lang.Object.wait(Object.java:429)
              at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
              - locked <0xf16158c8> (a java.lang.Object)
              at java.lang.Thread.run(Thread.java:534)

      "CompilerThread0" daemon prio=5 tid=0x000cd558 nid=0x7 waiting on condition [0..fba7f578]

      "Signal Dispatcher" daemon prio=10 tid=0x000cc900 nid=0x6 waiting on condition [0..0]

      "Finalizer" daemon prio=8 tid=0x000c94e0 nid=0x4 in Object.wait() [fc37f000..fc37fc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf16159c8> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
              - locked <0xf16159c8> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

      "Reference Handler" daemon prio=10 tid=0x000c7b88 nid=0x3 in Object.wait() [fe27f000..fe27fc2c]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf1615570> (a java.lang.ref.Reference$Lock)
              at java.lang.Object.wait(Object.java:429)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
              - locked <0xf1615570> (a java.lang.ref.Reference$Lock)

      "VM Thread" prio=5 tid=0x000c6d58 nid=0x2 runnable

      "VM Periodic Task Thread" prio=10 tid=0x000e8cc8 nid=0x8 waiting on condition

      "Suspend Checker Thread" prio=10 tid=0x000cbf98 nid=0x5 runnable

            art Artem Ananiev (Inactive)
            ehawkessunw Eric Hawkes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: