JDK-4470419 : Robot process exits unexpectedly on Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2001-06-15
  • Updated: 2006-09-04
  • Resolved: 2006-09-04
Related Reports
Relates :  
Name: dsR10078			Date: 06/15/2001


This bug is reproducible on Linux with merlin build b67 and earlier.
If a thread stops just after making a request to Robot, the Robot
child process may exit before processing the request, so that the
requested native event is not generated.

Here is the test case that reproduces the problem:
import java.awt.*;
import java.awt.event.*;

public class Test extends MouseAdapter implements Runnable {
    final Frame frame = new Frame();
    final Dialog dialog = new Dialog(frame, true);
    final Thread thread = new Thread(this);
    public static void main(String[] args) {
        new Test();

    public Test() {
        dialog.setBounds(200, 200, 200, 200);
    public void run() {
        try {
            final Robot robot = new Robot();
            final Point srcPoint = dialog.getLocationOnScreen();
            final Dimension d = dialog.getSize();
            srcPoint.translate(d.width / 2, d.height / 2);
            robot.mouseMove(srcPoint.x, srcPoint.y);
            for (int i = 0; i < 50; i++) {
                robot.mouseMove(srcPoint.x + i, srcPoint.y);
        } catch (Exception e) {

    public void mousePressed(MouseEvent e) {

    public void mouseReleased(MouseEvent e) {
Run the test case. A modal dialog will appear. The robot presses the mouse 
button, drags and then releases the mouse button.

On Linux the debug output indicates that button release event may be not
generated in response to robot request. The test works correctly on Solaris 
and Windows.

This happens as the robot child process exits when the parent process
exits. On Linux each Java thread is implemented as a separate process,
so if the Java thread that created Robot exits, the robot child
process exits as well.


EVALUATION After the fix for 6287244 the robot process is eliminated, so this bug doesn't take place anymore. Closing it as not reproducible.

WORK AROUND Name: dsR10078 Date: 06/15/2001 ======================================================================

EVALUATION Commit to fix in merlin-beta2 (serious problem with Robot). eric.hawkes@eng 2001-06-15 I am not able to reproduce this on Merlin Build 72. Running RH6.2 richard.ray@eng 2001-07-23