bug-gnu-chess
[Top][All Lists]
Advanced

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

Re: xboard sends SIGINT to gnuchess, and gnuchess exits


From: Tim Mann
Subject: Re: xboard sends SIGINT to gnuchess, and gnuchess exits
Date: Mon, 31 Dec 2001 15:59:38 -0800

It is well documented that xboard sends those signals.  See engine-intf.html 
included with xboard.  If GNU Chess 5 doesn't need the signals at all, one 
easy fix would to add "feature sigint=0 sigterm=0" to the feature commands 
that GNU Chess sends to xboard when starting up.

        --Tim

Michael Wang wrote:
> I run xboard (4.2.5) without any option
> and xboard starts up gnuchessx (5.02).
> 
> The truss results clear shows that xboard
> sends SIGINT to gnuchessx, and gnuchessx
> exits. This is the reason for
> 
>   xboard: Error writing to first chess program: Broken pipe
> 
> error message.
> 
> I added
> 
>   #include <signal.h>
>   signal(SIGINT,SIG_IGN);
> 
> to main.c, it does not work. Then I added the lines to
> the two longer functions in book.c (it is the code in book.c
> is running when xboard sends SIGINT to gnuchess), and this
> "fixed" the problem.  I am now able to play games with computer.
> 
> (1) Please advise why xboard needs to send SIGINT to gnuchess.
> (2) Please provide a permanent fix. I still have the problem
> when I do other things. I believe the signal is not caught
> when other part of the gnuchess code is running at the time.
> 
> I am on Solaris 2.8 sparc. The problem, I believe, is very
> easy to reproduce. I am using gcc compiler.
> 
> Thanks, and have a happy New Year!
> 
> PS: xboard (PID 26134) sends signal (kill()) to PID 26135 (gnuchess)
>     and gnuchess "exit()"s.
> 
> The gnuchess (PID 26135) was "write()"ing and "read()"ing
> when this happened. The write() and read() are part of the code
> in book.c, and adding "signal(SIGINT,SIG_IGN);" to book.c
> avoided the problem. But I do not know xboard (PID 26134) needs
> to "kill(26135, SIGINT)"
> 
> Thanks.
> 
> > 26134:        kill(26135, SIGINT)                             = 0
> > 26134:        write(6, " t i m e   2 9 1 9 2\n o".., 22)      = 22
> > 26134:        write(6, " c 1 b 2\n", 5)                       = 5
> > 26134:        write(3, "0201\00406\0\01D\0\0\002".., 584)     = 584
> > 26134:        read(3, 0xEFFFEED0, 32)                         Err#11 EAGAIN
> > 26135:            Received signal #2, SIGINT, in read() [caught]
> > 26135:              siginfo: SIGINT pid=26134 uid=100
> > 26135:        read(0, 0x046F6744, 5120)                       Err#4 EINTR
> > 26135:        sigaction(SIGINT, 0xEFFFF590, 0xEFFFF610)       = 0
> > 26135:        setcontext(0xEFFFF710)
> > 26135:        llseek(0, 0, SEEK_CUR)                          Err#29 ESPIPE
> > 26135:        _exit(0)

-- 
Tim Mann  address@hidden  http://www.tim-mann.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]