Question for Linux chess programmers: broken pipe

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Question for Linux chess programmers: broken pipe

Postby Leen Ammeraal » 12 Jun 2008, 16:17

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
User avatar
Leen Ammeraal
 
Posts: 63
Joined: 14 Oct 2004, 19:46

Re: Question for Linux chess programmers: broken pipe

Postby Zach Wegner » 12 Jun 2008, 18:58

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.
User avatar
Zach Wegner
 
Posts: 182
Joined: 26 Sep 2004, 22:02
Location: Austin, Texas, USA

Re: Question for Linux chess programmers: broken pipe

Postby Leen Ammeraal » 12 Jun 2008, 19:50

Thanks for your reply. I will look for the error that causes this crash.
Leen
User avatar
Leen Ammeraal
 
Posts: 63
Joined: 14 Oct 2004, 19:46

Re: Question for Linux chess programmers: broken pipe

Postby Sven Schüle » 13 Jun 2008, 22:03

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
User avatar
Sven Schüle
 
Posts: 240
Joined: 26 Sep 2004, 20:19
Location: Berlin, Germany

Re: Question for Linux chess programmers: broken pipe

Postby Leen Ammeraal » 14 Jun 2008, 07:14

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
User avatar
Leen Ammeraal
 
Posts: 63
Joined: 14 Oct 2004, 19:46

Re: Question for Linux chess programmers: broken pipe

Postby Marountas John » 03 Jan 2009, 11:14

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 .
User avatar
Marountas John
 
Posts: 22
Joined: 21 Nov 2004, 19:17
Location: Heraklion, Crete, Greece


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 25 guests