[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gnuchessx bug

I have been looking into a bug in gnuchessx which has plagued me for years (I
first recall seeing it in 1994).  When you are in the middle of playing a game
and you kill the Xboard window (double-click on the switch button at the top
left or whatever the window manager requires) the gnuchessx program keeps on
running forever taking up all spare CPU time.  When I run it from the command
line I get the following display after closing the window:
rjc@lyta:/tmp$gnuchessx | xboard
X connection to :0.0 broken (explicit kill or server shutdown).

But it's still active and I don't get a command-prompt back so I know to kill
it with ^C.  However it's a more insidious problem when run from a window
manager as there may be no sign that that it's still running in the background
(until weeks later you wonder why the load average is always at least 1).

Running gdb on a core file after sending a SEGV to it when it's in this state I
find that it's at line 1102 of dspcom.c, the gets() in the following fragment:
      s[0] = sx[0] = '\0';
      while (!sx[0])
        (void) gets (sx);

Does anyone know what they are trying to do here?  It seems to be while STDIN
is closed do infinite loop...

She says "This, is the real thing,
coz you're never gonna find the door"
I'm on my way.

Reply to: