JDK-6421984 : realSync throws InfiniteLoop some times.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6,6u10,7
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS:
    generic,solaris_10,windows_xp,windows_vista generic,solaris_10,windows_xp,windows_vista
  • CPU: generic,x86,sparc
  • Submitted: 2006-05-04
  • Updated: 2014-10-07
  • Resolved: 2014-03-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolResolved
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
Here's a test case:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/*
 * @test %I% %E%
 * @bug 4942216
 * @summary Tests 4942216
 * @library ../../../../javax/swing/regtesthelpers
 * @build SwingTestHelper Test JRobot Assert
 * @run main bug4942216
 * @author Scott Violet
 */
public class bug4942216 extends SwingTestHelper {
    private JTextField textField;

    public static void main(String[] args) throws Throwable {
        new bug4942216().run(args);
    }

    protected Component createContentPane() {
        textField = new JTextField();
        textField.setAutoscrolls(true);
        return textField;
    }

    public void onEDT10() {
        robot.moveMouseTo(textField);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        waitForEvent(textField, MouseEvent.MOUSE_PRESSED);
    }

    public void onEDT20() {
        Point loc = textField.getLocationOnScreen();
        robot.mouseMove(loc.x + textField.getWidth() + 10,
                        loc.y + textField.getHeight() + 10);
        waitForEvent(textField, MouseEvent.MOUSE_EXITED);
    }

    public void onEDT30() {
        Point loc = textField.getLocationOnScreen();
        textField.setVisible(false);
        robot.mouseMove(loc.x + textField.getWidth() + 20,
                        loc.y + textField.getHeight() + 20);
        waitForEvent(textField, MouseEvent.MOUSE_DRAGGED);
    }

    public void onEDT40() {
        robot.mouseRelease(InputEvent.BUTTON1_MASK);
        waitForEvent(textField, MouseEvent.MOUSE_RELEASED);
    }
}

This relies on SwingTestHelper and other classes which can be found in test/javax/swing/regtesthelpers. On my solaris box running this test produces:

Exception in thread "Thread-1" sun.awt.SunToolkit$InfiniteLoop
> >>>>    at sun.awt.SunToolkit.realSync(SunToolkit.java:1424)
> >>>>    at SwingTestHelper.controlLoop(SwingTestHelper.java:513)
> >>>>    at SwingTestHelper.access$600(SwingTestHelper.java:173)
> >>>>    at SwingTestHelper$4.run(SwingTestHelper.java:470)
> >>>>    at java.lang.Thread.run(Thread.java:619)

Comments
It passes on Windows 7 with JDK8 b132. Fails on Oracle Linux 6.4 with JDK8 b132 with the following error: Test FAILED: an exception is caught in the target thread group on thread InitThread sun.awt.SunToolkit$OperationTimedOut: 10010 at sun.awt.X11.XToolkit.syncNativeQueue(XToolkit.java:2427) at sun.awt.SunToolkit.realSync(SunToolkit.java:1501) at sun.awt.SunToolkit.realSync(SunToolkit.java:1433) at TestShutdown$TestRunnable.run(TestShutdown.java:138) at java.lang.Thread.run(Thread.java:744) As you see it's not an InfiniteLoop, it's another known problem that will be fixed in future.
27-03-2014

It was fixed some time ago.
25-03-2014

EVALUATION it is important to find the problem in this method since we use it for testing
23-06-2006