Page 1 of 1

Question for Linux chess programmers: broken pipe

PostPosted: 12 Jun 2008, 16:17
by Leen Ammeraal
After installing Linux Ubuntu (besides Windows Vista) I made a Linux version of my chess engine Queen for running only under XBoard. Currently it works most of the time, but in matches against other chess engines XBoard sometimes displays error messages about a broken pipe and will not continue. Any idea what is wrong?
Leen Ammeraal

Re: Question for Linux chess programmers: broken pipe

PostPosted: 12 Jun 2008, 18:58
by Zach Wegner
That basically means your engine crashed. A pipe is used to connect each of the standard input and output to xboard. When it's broken it means that either the engine crashed for some reason, or one of stdin/stdout was closed. I would doubt that you would be closing them ;), so it crashed.

What can help is running xboard with -debug. Then you can see the communication between the engine and xboard before the crash. Then you can compile again with -g and run gdb.

Re: Question for Linux chess programmers: broken pipe

PostPosted: 12 Jun 2008, 19:50
by Leen Ammeraal
Thanks for your reply. I will look for the error that causes this crash.
Leen

Re: Question for Linux chess programmers: broken pipe

PostPosted: 13 Jun 2008, 22:03
by Sven Schüle
Hi Leen,

maybe you should check your SIGINT handling. I had a similar behaviour, too, when porting my engine to Linux for the first time.

Assuming WB protocol 2, you may send "feature sigint=0" at program startup to prevent xboard from sending a SIGINT from time to time.

Sven

Re: Question for Linux chess programmers: broken pipe

PostPosted: 14 Jun 2008, 07:14
by Leen Ammeraal
Hi Sven,
In my case the cause of the crash is related to my external openings book. My program now works fine if I don't use this and disable the program fragment related to it. I think I can fix the problem.
As for your suggestion about SIGINT, I also had problems with this, but these disappeared after inserting the statement "signal(SIGINT, SIG_IGN);" (based on header file signal.h), which I found in the code of tscp. I did not know that I could possibly have used "feature sigint=0" instead.
Anyway, thanks for your message.
Leen

Re: Question for Linux chess programmers: broken pipe

PostPosted: 03 Jan 2009, 11:14
by Marountas John
Hi

Sven's suggestion sending the "feature sigint=0" worked also for me
when trying to use xboard and java .

The problem was that the xboard would always crash after 1 or 2 moves with a broken pipe error .