Stockfish crashing on checkmate positions, and erroneous evaluation I asked the same question on Stockfish's forum.

Black to move in the classic scholar's mate position. mate in 1. Engine produce erroneous results?

position fen rnbqkbnr/pppp1ppp/8/4p3/6P1/5P2/PPPPP2P/RNBQKBNR b KQkq -

eval

Total Evaluation: -0.85 (white side)


Same position, except black checkmated white. White to move:

position fen rnb1kbnr/pppp1ppp/8/4p3/6Pq/5P2/PPPPP2P/RNBQKBNR w KQkq -

eval

Debug error! abort() has been called


Here is another position that crashes:

1b1B1k2/8/2B1p1p1/3n1p2/4KP2/6P1/8/8 w
eval


Go seems to work properly, showing that its mate in 1, and checkmate. However eval is not showing the correct numbers.

Or am I misunderstanding something here?
Everything works perfectly.


You should add 50 move counter to your FEN, but this is not the biggest issue.
The eval command returns a static evaluation of your position. It doesn't start the search, that's why Stockfish gave you back the results immediately.


Try this:

ucinewgame
position fen rnbqkbnr/pppp1ppp/8/4p3/6P1/5P2/PPPPP2P/RNBQKBNR b KQkq - 0 1
go movetime 1000


The engine gives you back mate in one:

info depth 126 seldepth 2 multipv 1 score mate 1 nodes 3781 nps 945250 tbhits 0 time 4 pv d8h4