Discussion:
[Scidvspc-users] Bug between ScidVsPC and Stockfish
Alex Wood
2016-04-21 14:27:16 UTC
Permalink
Hi,

I configured ScidVsPC to use the Stockfish chess engine and noticed an
issue where Stockfish would crash when asked to evaluate a position
already in checkmate. This issues happens frequently if Stockfish is
running during the checkmate in N training. Solving the puzzle results
in a crash.

I filed a bug on the issue at
https://bugzilla.redhat.com/show_bug.cgi?id=1325013 but the maintainer
attributed the issue to Stockfish being asked to evaluate an invalid
move. Here's the engine log of an example crash:

Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8
Scid : go infinite
[...] Engine analysis here
Scid : stop
Scid : isready
Engine: readyok
Engine: bestmove h6h8
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: info depth 0 score mate 0
Scid : stop
Scid : isready
Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: bestmove (none)
Note: Engine terminated without warning.
Note: Engine terminated without exit code: "\"$standard_error\""

Any thoughts or help would be greatly appreciated!
------------
Regards,
Alex
Steve A
2016-04-23 00:26:24 UTC
Permalink
I cant see the bug report, even after joining their bugzilla.

But if they are happy to have their app crash with very reasonable
input... i guess we should probably add a safeguard to handle it.
Stockfish does many unfriendly things in a way *no* other engine does.

This should handle it (also attached) and will probably get comitted,
but as my version of SF doesnt crash, i cant test it.

Index: tcl/tools/analysis.tcl
===================================================================
--- tcl/tools/analysis.tcl (revision 2523)
+++ tcl/tools/analysis.tcl (working copy)
@@ -3544,6 +3544,9 @@
append cmd { [ } " after $delay sendPosToEngineUCI $n $delay " { ] }
set analysis(after$n) [eval [list after idle $cmd]]
} else {
+ if {[sc_pos moves] == {}} {
+ return
+ }
### Dont send position if annotating and in book
if { $::annotate(Engine) == $n && ! $::wentOutOfBook &&
$::useAnalysisBook} {
bookAnnotation
Post by Alex Wood
Hi,
I configured ScidVsPC to use the Stockfish chess engine and noticed an
issue where Stockfish would crash when asked to evaluate a position
already in checkmate. This issues happens frequently if Stockfish is
running during the checkmate in N training. Solving the puzzle results
in a crash.
I filed a bug on the issue at
https://bugzilla.redhat.com/show_bug.cgi?id=1325013 but the maintainer
attributed the issue to Stockfish being asked to evaluate an invalid
Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8
Scid : go infinite
[...] Engine analysis here
Scid : stop
Scid : isready
Engine: readyok
Engine: bestmove h6h8
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: info depth 0 score mate 0
Scid : stop
Scid : isready
Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: bestmove (none)
Note: Engine terminated without warning.
Note: Engine terminated without exit code: "\"$standard_error\""
Any thoughts or help would be greatly appreciated!
------------
Regards,
Alex
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Scidvspc-users mailing list
https://lists.sourceforge.net/lists/listinfo/scidvspc-users
Gregor Cramer
2016-04-23 06:53:55 UTC
Permalink
Of course, this crash is a severe Stockfish bug, a full.-hearted implementation
would test the position before analyzing.

But that's not the only issue with Stockfish. Stockfish is designed for reaching
high ELO ratings, it is doing this with aggressive pruning. In analyze mode
this aggressive pruning has the effect that Stockfish is often overlooking even
simple drawing combinations, and other quite obvious things.

For analysis mode alternative engines are of interest, but I don't know which
engines are the best for analysis. Some years ago (the free version of) Zappa
was a very good engines for wild positions, but the last release is 2005.

Gregor
Jerome Monscavoir
2016-04-23 12:22:26 UTC
Permalink
Hello

I can t réplicate it on ubuntu and sf7 for the moment but i keep go on with
your position
Post by Steve A
I cant see the bug report, even after joining their bugzilla.
But if they are happy to have their app crash with very reasonable
input... i guess we should probably add a safeguard to handle it.
Stockfish does many unfriendly things in a way *no* other engine does.
This should handle it (also attached) and will probably get comitted,
but as my version of SF doesnt crash, i cant test it.
Index: tcl/tools/analysis.tcl
===================================================================
--- tcl/tools/analysis.tcl (revision 2523)
+++ tcl/tools/analysis.tcl (working copy)
@@ -3544,6 +3544,9 @@
append cmd { [ } " after $delay sendPosToEngineUCI $n $delay " { ] }
set analysis(after$n) [eval [list after idle $cmd]]
} else {
+ if {[sc_pos moves] == {}} {
+ return
+ }
### Dont send position if annotating and in book
if { $::annotate(Engine) == $n && ! $::wentOutOfBook &&
$::useAnalysisBook} {
bookAnnotation
Post by Alex Wood
Hi,
I configured ScidVsPC to use the Stockfish chess engine and noticed an
issue where Stockfish would crash when asked to evaluate a position
already in checkmate. This issues happens frequently if Stockfish is
running during the checkmate in N training. Solving the puzzle results
in a crash.
I filed a bug on the issue at
https://bugzilla.redhat.com/show_bug.cgi?id=1325013 but the maintainer
attributed the issue to Stockfish being asked to evaluate an invalid
Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8
Scid : go infinite
[...] Engine analysis here
Scid : stop
Scid : isready
Engine: readyok
Engine: bestmove h6h8
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: info depth 0 score mate 0
Scid : stop
Scid : isready
Engine: readyok
Scid : position fen 4k3/8/4K2Q/8/8/8/8/8 w - - 3 8 moves h6h8
Scid : go infinite
Engine: bestmove (none)
Note: Engine terminated without warning.
Note: Engine terminated without exit code: "\"$standard_error\""
Any thoughts or help would be greatly appreciated!
------------
Regards,
Alex
------------------------------------------------------------------------------
Post by Alex Wood
Find and fix application performance issues faster with Applications
Manager
Post by Alex Wood
Applications Manager provides deep performance insights into multiple
tiers of
Post by Alex Wood
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Scidvspc-users mailing list
https://lists.sourceforge.net/lists/listinfo/scidvspc-users
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Scidvspc-users mailing list
https://lists.sourceforge.net/lists/listinfo/scidvspc-users
Alex Wood
2016-04-23 17:59:00 UTC
Permalink
Post by Steve A
I cant see the bug report, even after joining their bugzilla.
But if they are happy to have their app crash with very reasonable
input... i guess we should probably add a safeguard to handle it.
Stockfish does many unfriendly things in a way *no* other engine does.
This should handle it (also attached) and will probably get comitted,
but as my version of SF doesnt crash, i cant test it.
Index: tcl/tools/analysis.tcl
===================================================================
--- tcl/tools/analysis.tcl (revision 2523)
+++ tcl/tools/analysis.tcl (working copy)
@@ -3544,6 +3544,9 @@
append cmd { [ } " after $delay sendPosToEngineUCI $n $delay " { ] }
set analysis(after$n) [eval [list after idle $cmd]]
} else {
+ if {[sc_pos moves] == {}} {
+ return
+ }
### Dont send position if annotating and in book
if { $::annotate(Engine) == $n && ! $::wentOutOfBook &&
$::useAnalysisBook} {
bookAnnotation
Sorry about that. I just updated the bug
https://bugzilla.redhat.com/show_bug.cgi?id=1325013 so that it is public.

Thanks for the patch. On Monday, I can drop that patch into the RPM
that I've built for Fedora, rebuild it, and test it out. Thanks for the
quick response!
------------
Regards,
Alex

P.S. I'm 99.99% sure I'm subscribed properly to the mailing list, but
Steve, if you have to moderate this email let me know and I'll try to
get it figured out.
Alex Wood
2016-04-27 17:13:05 UTC
Permalink
Post by Alex Wood
Post by Steve A
Index: tcl/tools/analysis.tcl
===================================================================
--- tcl/tools/analysis.tcl (revision 2523)
+++ tcl/tools/analysis.tcl (working copy)
@@ -3544,6 +3544,9 @@
append cmd { [ } " after $delay sendPosToEngineUCI $n $delay " { ] }
set analysis(after$n) [eval [list after idle $cmd]]
} else {
+ if {[sc_pos moves] == {}} {
+ return
+ }
### Dont send position if annotating and in book
if { $::annotate(Engine) == $n && ! $::wentOutOfBook &&
$::useAnalysisBook} {
bookAnnotation
Sorry about that. I just updated the bug
https://bugzilla.redhat.com/show_bug.cgi?id=1325013 so that it is public.
Thanks for the patch. On Monday, I can drop that patch into the RPM
that I've built for Fedora, rebuild it, and test it out. Thanks for
the quick response!
The patch worked. I've already incorporated it into the Fedora build at
http://copr.fedoraproject.org/coprs/awood/scid_vs_pc

Thanks for the assistance!
---------------
Regards,
Alex

Loading...