Closed jeffli678 closed 1 year ago
The symbolized stack trace is:
__pthread_kill_implementation 0x00007ffff7ae8a7c
__pthread_kill_internal 0x00007ffff7ae8a7c
__GI___pthread_kill 0x00007ffff7ae8a7c
__GI_raise 0x00007ffff7a94476
__GI_abort 0x00007ffff7a7a7f3
__assert_fail_base 0x00007ffff7a7a71b
__GI___assert_fail 0x00007ffff7a8be96
Stockfish::Position::square<…> position.h:237
Stockfish::Position::set_state position.cpp:203
Stockfish::Position::set position.cpp:164
Stockfish::position uci.cpp:70
Stockfish::UCI::loop uci.cpp:271
main main.cpp:39
__libc_start_call_main 0x00007ffff7a7bd90
__libc_start_main_impl 0x00007ffff7a7be40
_start 0x000055555555b1c5
I checked the UCI protocol here http://wbec-ridderkerk.nl/html/UCIProtocol.html and it does not really specify a standard response on invalid FEN input. I guess we will just figure out one
It appears to me that the intention is to crash if the input FEN is invalid, https://github.com/PikaCat-OuO/Pikafish/blob/580020e05b0aff782c8ab6bf58168bc113af7532/src/position.cpp#L166. If this is the case, this issue can be closed
Expected behavior. Stockfish does not check it too? You can crash stockfish in the same way.
To be precise, stockfish (and pikafish as well) crashes intentionally. I will close this issue now.
Describe the issue
Pikafish engine crashes when an invalid FEN is sent through the
fen
command. It is not a big deal since the GUI front-end should not send such FEN positions in the first place. However, it would still be better not crash and send an error message according to the UCI protocal.Expected behavior
No crash, and optionally return an error message about the situation.
Steps to reproduce
Anything else?
Operating system
Linux
Pikafish version
56a1939cb100d5c2f7093299ced5c92fe80de3af