4.5.2a (Linux) sends result after program termination

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

4.5.2a (Linux) sends result after program termination

Postby jdart » 21 Mar 2012, 01:25

I saw some strange behavior - Arasan was playing Gnuchess on FICS, and after the game was over (FICS had sent result), Arasan crashed. xboard though is still trying to send it commands (although the process is dead) and it is sending the incorrect result (result was 1-0 because GnuChess resigned, but xboard sends 0-1 because Arasanx later crashed). I don't think this causes any actual problem but xboard probably shouldn't try to send commands to a process it knows is dead. End of the debug log follows.

Code: Select all
1600947 >first : result 1-0 {GnuCheese resigns}
1600948 >first : force
1600948 >first : ping 4
>ICS: gameend\015\012
>ICS: \015\012
Reset(1, 1) from gameMode 11
recognized 'normal' (-1) as variant normal
GameEnds(0, (null), 2)
shuffleOpenings = 0
1600950 >first : memory 516
1600950 >first : egtpath nalimov c:\egtb
1600950 >first : cores 4
1600950 >first : new
random
1600950 >first : ics freechess.org
1600950 >first : post
1600950 >first : hard
1600950 >first : ping 5
1600950 <first : # received 31 chars: # check_command: result 1-0 {GnuCheese resigns}
1600950 <first : # adding to pending list result 1-0 {GnuCheese resigns}, list size=0
1600950 <first : # received_result: result 1-0 {GnuCheese resigns}
1600950 <first : # terminating search (controller)
1600950 <first : # received 6 chars: # check_command: force
1600950 <first : # terminating search (controller)
1600950 <first : # received 7 chars: # check_command: ping 4
1600950 <first : # time check interval=508124 elapsed_time=553pong 4
1600950 <first :  target=99999
1600950 <first : # done pondering
1600950 <first : # ponder move = a5-a6
1600950 <first : # out of ponder()
1600950 <first : removing:
<ICS: Your seek has been posted with index 7.\012\015(1 player(s) saw the seek.)\012\015fics%
ics input 0, castling = 7 0 4 7 0 4
GameEnds(26, Error: first chess program (/home/jdart/arasan-14.2.0/export/arasanx -H 512m -c 4 -ics -t) exited unexpectedly, 2)
1600984 >first : result 0-1 {Error: first chess program (/home/jdart/arasan-14.2.0/export/arasanx -H 512m -c 4 -ics -t) exited unexpectedly}
1600985 >first : force
1600985 >first : ping 6
1600985 >first : quit
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA

Re: 4.5.2a (Linux) sends result after program termination

Postby H.G.Muller » 21 Mar 2012, 09:20

The 0-1 is for the next game (with no moves yet). In Zippy mode XBoard always starts a new game as soon as the old one finishes. The result of the GNU Chess game (1-0) was properly sent to Arasan before. (That makes you wonder why the crash is adjudicated as 0-1, as it is at this point not clear which color the engine will play. So XBoard is neither in the mode IcsPlayingWhite or IcsPlayingBlack, but just at BeginningOfGame. Games without moves are never saved, however, so this is a moot point.)

Obviously no commands can be send to a dead process at all, and XBoard doesn't really attempt that, as the detection of the crash (by an EOF on the input thread for the engine) that triggered GameEnds has already closed down the output channel (to prevent recursion of errors producing an avalanche of error popups). The commands normally sent in the process of terminating a game by GameEnds still go into the debug file, though. Apparently the testing if the output is still open is done after the write to the debug file.

I don't consider this harmful in any way. It can in fact be helpful to diagnose problems in XBoard caused by the engine crash. Which is the primary purpose of the debug file in the first place.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: 4.5.2a (Linux) sends result after program termination

Postby jdart » 21 Mar 2012, 16:25

Ok, thanks for the explanation.

--Jon
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 37 guests