Possible WB bug?

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

Moderators: hgm, Andres Valverde

Possible WB bug?

Postby JVMerlino » 20 Sep 2010, 16:49

I'm using WB version 4.20.100.228 and I just released a new version of Myrddin which appears to cause a problem in WB in some cases.

I had Jim Ablett compile the executables, and we were having problems figuring out why his compile couldn't find the Gaviota TBs when mine could. To make a long story short, I decided to add checks for 3, 4 and 5-man TBs and spit out some text about the results of those checks. One of the lines, if successful, is this:

Gaviota Tablebases found, sample position shows Draw

Note that this is after Myrddin sends "done=0" and before any "feature" commands or other input from the GUI is handled.

So the problem is when Myrddin is involved in an engine match locally and sends this string, WB thinks that the above line is a draw claim and the game ends immediately, before Myrddin ever even sends "done=1" (many thanks to Olivier for pointing this out). But the reason I did not see this is because I tested Myrddin by using WB to connect to FICS, and the problem does not happen in that case. Is this intentional, and I need to release a new version? Or is it an inconsistent implementation?

Many thanks,
jm
JVMerlino
 
Posts: 17
Joined: 23 Feb 2010, 20:35

Re: Possible WB bug?

Postby Jim Ablett » 20 Sep 2010, 17:32

I got the same problem with initial welcome message in TSCP >

Code: Select all
------------------------------------------------------
printf("setboard and analysis capabilities - J.Ablett 5/7/10)\n");
-------------------------------------------------------------------


Winboard thought engine was sending the setboard command and terminated engine by sending 'BAD FEN'.

Jim.
___________________________
http://jimablett.net63.net/
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England

Re: Possible WB bug?

Postby H.G.Muller » 20 Sep 2010, 18:05

This is not valid WB protocol:

Code: Select all
Gaviota Tablebases found, sample position shows Draw


This is also not valid WB protocol:

Code: Select all
setboard and analysis capabilities - J.Ablett 5/7/10)


When engines send such non-compliant chatter to WinBoard, and something bad happens, why would you think it is a WB bug? :shock: Looks to me that it is an engine bug that it sends it...

The effect of any non-compliant command is by nature undefined. And 'undefined' means anything can happen: you could be logged out, resign switch to Xiangqi, delete the PGN file... WinBoard is sensitive to lots of undocumented commands(as a legacy of a policy to cater to non-compliant engines in the era where engines were a scarce commoditity). And what you get away with today, might not work in another implementation tomorrow. So if you don't want surprises, don't send them! If you must make a verbose engine, WB protocol supplies the possibility to 'disarm' such output by feature debug=1, and starting the line with a '#'.

This would be harmless after feature debug=1:

Code: Select all
printf("# setboard and analysis capabilities - J.Ablett 5/7/10)\n");


and probably even without the feature, as setboard is not the first thing on the line.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Possible WB bug?

Postby JVMerlino » 20 Sep 2010, 20:07

Ok, I understand. When I make the change, I will either do what you say (with "debug" and # characters) or simply send these lines only to the logfile.

Thanks very much, H.G.!

jm
JVMerlino
 
Posts: 17
Joined: 23 Feb 2010, 20:35


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 6 guests

cron