Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: UCI Issues

Author: Peter McKenzie

Date: 23:16:41 02/27/01

Go up one level in this thread


On February 27, 2001 at 21:37:04, Tim Mann wrote:

>On February 26, 2001 at 14:09:08, Peter McKenzie wrote:
>
>>If my guess is correct, then it is rather awkward for me because my input
>>processing is not line oriented at all.  I use the C++ 'cin >> string' type of
>>input which just gives me the next token and strips out the whitespace
>>(including the newline).  Oh well, I'm sure I can find a way around it.
>>
>>So the problem for me is that you seem to be using '\n' as a command terminator
>>for commands which have a variable number of arguments.  This is a different
>>paradigm to the winboard way, I would say inferior even.
>
>It's definitely not the "winboard way" to regard newlines and other whitespace
>as being equivalent.  It's just luck if you can parse winboard output that way
>without making a mistake.

oh darn, looks like I got the wrong end of the stick!

>
>Someone (I forget who) had a bug where he parsed winboard output without regard
>to newlines, and he didn't implement all the commands.  In particular, he didn't
>implement the "name" command.  So, suppose someone named "quit" on ICS were to
>play his engine, leading winboard to send the command
>
>  name quit
>
>This would cause his engine to quit!  (Perhaps after generating an error message

Yes, as we discussed on ICC today, if an engine had a name of "crafty quit" (not
very likely - right Bob?) then the string: "name crafty quit\n" gets sent to the
engine.  This would cause MY engine to quit!!  Looks like I've got some fixing
to do...

I wonder if anyone else has this bug :-)

>saying that "name" was not understood.)  To prevent this, the engine should have
>been ignoring the rest of the line after noticing that "name" was a command it
>did not understand.
>
>This kind of thing used to be much more dangerous in protocol version 1, where
>it was considered acceptable for winboard to add new commands in new releases
>and send them to engines that weren't expecting them.  It's safer now in version
>2, where new commands don't get sent unless you turn them on with the "feature"
>command.  But you still have to handle the default set of commands without
>choking...
>
>	--Tim



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.