Some buffering problem...

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Some buffering problem...

Postby awagner » 15 Mar 2013, 20:59

My new engine, written in ruby, consistently blows up after the second move when running under xboard (Mac OSX). It's fine if i run the basic ui without xboard. The relevant section of the debug file is here:
15496 >first : usermove 15496 >first : c2c3
15497 <first : /Users/andrewwagner/workspace/ruby/tdchess/lib/tdchess/runner.rb:13:in `gets': Interrupt
15497 <first : from /Users/andrewwagner/workspace/ruby/tdchess/lib/tdchess/runner.rb:13:in `tick'
15497 <first : from bin/winboard.rb:15:in `<main>'
GameEnds(26, Error: first chess program (bin/winboard.rb) exited unexpectedly, 2)
Interrupting first
18069 >first : result 0-1 {Error: first chess program (bin/winboard.rb) exited unexpectedly}
18069 >first : force
18069 >first : quit


You can find the code at https://github.com/arwagner/tdchess if you're interested.

Any suggestions?
awagner
 
Posts: 7
Joined: 13 May 2008, 19:47

Re: Some buffering problem...

Postby awagner » 16 Mar 2013, 01:45

Here's a simple test case. This works if I just run it by itself, but has that interrupt if I run it under xboard:

Code: Select all
i = 0
moves = ["a7a6","a6a5","a5a4","a4a3"]
$stdin.each do |command|
  if command.start_with?("protover")
    $stdout.puts "feature ping=0 setboard=1 ics=1 usermove=1"
  elsif command.start_with?("usermove")
    $stdout.puts "move #{moves[i]}"
    i+=1
  end
  $stdout.flush
end
awagner
 
Posts: 7
Joined: 13 May 2008, 19:47

Re: Some buffering problem...

Postby awagner » 16 Mar 2013, 02:18

Aha, it's fixed. It was the SIGINT described in http://www.gnu.org/software/xboard/engine-intf.html#7 . I'm not entirely sure I understand why I would it would default to throwing those signals at me all the time, but I just turned them off in the initial feature command, and it's fixed.
awagner
 
Posts: 7
Joined: 13 May 2008, 19:47

Re: Some buffering problem...

Postby H.G.Muller » 16 Mar 2013, 08:11

Ah yes, I also keep getting fooled by that again and again, each time I port one of my engines to Linux. (On Windows signals do not work.) It is indeed a very silly feature of WB protocol, only good for switching off. :(

But it seems that the original GNU Chess, for which XBoard was designed as front end, needed the user to type ctrl-C to wake it up out of ponder search.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 11 guests