<AWT Dev> Review request for 8075964: java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.html fails intermittently with timeout error
Manajit Halder
manajit.halder at oracle.com
Fri Jan 22 10:18:22 UTC 2016
Hi All,
Kindly review the fix for JDK9.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8075964 <https://bugs.openjdk.java.net/browse/JDK-8075964>
Webrev:
http://cr.openjdk.java.net/~arapte/manajit/8075964/webrev.00 <http://cr.openjdk.java.net/~arapte/manajit/8075964/webrev.00>
Issue:
Test java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.html fails intermittently with timeout error.
Fix:
The timeout error was observed on MacOS, Windows and Ubuntu. Fixed by removing the Util.waitForIdle(robot) call from the end of the start() method. The provided fix solves the time-out problem on all the three (MacOS, Windows and Ubuntu) platforms.
Justification of fix:
Stack Trace of the issue:
"Attach Listener" #17 daemon prio=9 os_prio=31 tid=0x00007fbed98cd000 nid=0x470f waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"AWT-EventQueue-0" #16 prio=6 os_prio=31 tid=0x00007fbed9a2b000 nid=0x413 waiting for monitor entry [0x000000012028b000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.awt.Robot.mouseMove(Robot.java:198)
- waiting to lock <0x00000007bfbc7d80> (a java.awt.Robot)
at TitleBarDoubleClick.doTest(TitleBarDoubleClick.java:111)
at TitleBarDoubleClick.windowActivated(TitleBarDoubleClick.java:174)
at java.awt.Window.processWindowEvent(Window.java:2077)
Cause:
Util.waitForIdle(robot) called at the end of start() method locks the robot. Immediately after frame becomes visible and windowActivated(WindowEvent e) event is generated. windowActivated(WindowEvent e) calls doTest() on the event dispatcher thread. In the doTest() method, mouseMove() call tries to lock robot which is already locked by waitForIdle() call in start() method.
This scenario results in deadlock between two threads and the test times out. Therefore Util.waitForIdle(robot) shouldn't be called at the end of start() method to avoid the deadlock.
New Issue observed on Ubuntu:
The test passes on Mac OS and Windows but fails on Ubuntu due to some other issue. For the new problem a new issue is created with link https://bugs.openjdk.java.net/browse/JDK-8148041 <https://bugs.openjdk.java.net/browse/JDK-8148041>
Regards,
Manajit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160122/b8f54381/attachment.html>
More information about the awt-dev
mailing list