Page 1 of 1

Another small glitch with hgmaster-20110508

PostPosted: 15 May 2011, 06:37
by EdCollins
Greetings,

Here is another small glitch I found in my WinBoard hgmaster-20110508 version, that you may want to be aware of:

I select JUST VIEW OR EDIT GAME FILES in the WinBoard Startup window.
I click OK.
I click ENGINE and then LOAD ENGINE.
I select an engine from the drop down box.
I click OK.

I then click ENGINE and select ENGINE #2 SETTINGS... and WinBoard immediately quits.

(I selected ENGINE #2 SETTINGS by accident. I knew there was no 2nd engine loaded. I meant to click the ENGINE #1 SETTINGS.)

The last few lines of my winboard.debug file look like this:

StartChildProcess (dir=".")
Fatal Error: Startup failure on '':
The system cannot find the file specified.


GameEnds(28, xboard exit, 2)
11433 >first : quit


Just so you know, my winboard.ini file is using the /singleEngineList=true option. But my guess is, that is irrelevant. I think I would get this abrupt program termination even with the old method of listing the engines twice. (firstchessProgramName and SecondChessProgramName.)

Re: Another small glitch with hgmaster-20110508

PostPosted: 15 May 2011, 11:21
by H.G.Muller
You are right. In general WinBoard still crashed when you asked for a non-existing engine (i.e. also when you type some gibberish in the first-engine combobox of the startup dialog, or in the engine-executable field of the Load Engine dialog). The idea was that these should be non-fatal errors, now that the user can correct the problem by simply loading another engine.

But there was a subtle difference between WinBoard and XBoard here. XBoard would first fork of a child process, and if that couldn't start the engine, it would print an error message and die. The main process would learn of this only by failure to communicate with the started process. I had added the necessary actions to make such I/O failure non-fatal. On WinBoard the main process has direct knowledge whether startup of the engine succeeded, however, and generated a fatal error in that case as well.

I have changed it such that WinBoard now simply pops up a non-fatal error box in that case. Failure to start the second engine is further ignored completely, (i.e. any further consequences are handled when WinBoard discovers the pipes to it do not work, which seemed to work well enough in XBoard), but failure to start the first engine would switch you back to -ncp mode. This seems to work in all cases I tried (bad first engine in startup dialog, switching to a bad engine in the Load Engine dialog, discovering the second engine is bad in the Engine #2 Settings menu).

New version is uploaded in the usual place.

Re: Another small glitch with hgmaster-20110508

PostPosted: 15 May 2011, 15:51
by EdCollins
Works fine now. Thanks.

I thought you might just keep ENGINE #2 SETTINGS greyed out, so it isn't selectable at all (with just one engine loaded), but the error message is fine too.

Re: Another small glitch with hgmaster-20110508

PostPosted: 15 May 2011, 19:02
by H.G.Muller
I considerd graying out, but this seemed to be a bit against the design of WinBoard, which does not have an explicit single-engine mode. You can either select noChessProgram or two, but the second engine is never used unless you use Two Machines mode. In engine mode, the first engine is always active, checking your moves, even in Edit game mode.

Another problem with gaying it out is that it still will not protect you from the similar crash if you did select a second engine,but made a typo in the name. So the crash had to be suppressed anyway.

I guess the best way to handle it would be to make sure that a default engine is selected (e.g. the first of the list) for second engine when you change from ncp mode to engine mode by loading a first engine. Basically the same as what happens when you use the Startup dialog to select a first engine, and don't bother to select a second (because you don't plan to do engine-engine games).