mcostalba / scoutfish

Chess Query Engine
GNU General Public License v3.0
156 stars 23 forks source link

Crash on a lichess PGN #55

Open vladkvit opened 1 month ago

vladkvit commented 1 month ago

I found that scoutfish crashes on an assert on a game from the Lichess database. I'm attaching the PGN of the particular game that causes the crash. The assert is in movegen.h on line 66 (assert(!pos.checkers());). Below is the stack trace:

libc.so.6!__GI___assert_fail(const char * assertion, const char * file, unsigned int line, const char * function) (assert.c:101)
generate_castling<(CastlingRight)4, false, false>( pos, ExtMove * moveList, Color us) (\mnt\d\scoutfish\src\movegen.h:66)
generate_castling_moves<(Color)1, (GenType)4, false>(ExtMove * moveList, const Position & pos) (\mnt\d\scoutfish\src\movegen.h:320)
Position::san_to_move(const Position * const this, const char * cur, const char * end, size_t & fixed) (\mnt\d\scoutfish\src\position.cpp:1300)
(anonymous namespace)::parse_game<true>(const char * moves, const char * end, const char * fen, size_t & fixed,  db) (\mnt\d\scoutfish\src\parser.cpp:120)
play_game(const Position & pos, Move move, const char * cur, const char * end) (\usr\include\c++\11\bits\basic_string.h:194)
Position::san_to_move(const Position * const this, const char * cur, const char * end, size_t & fixed) (\mnt\d\scoutfish\src\position.cpp:1355)
(anonymous namespace)::parse_game<>(const char *, const char *, std::ofstream &, const char *, const char *, size_t &, uint64_t, Scout::GameResult)(const char * moves, const char * end, std::ofstream & db, const char * fen, const char * fenEnd, size_t & fixed, uint64_t ofs, Scout::GameResult result) (\mnt\d\scoutfish\src\parser.cpp:120)
(anonymous namespace)::parse_pgn(void * baseAddress, uint64_t size, (anonymous namespace)::PGNStats & stats, std::ofstream & db, uint64_t startOfs) (\mnt\d\scoutfish\src\parser.cpp:306)
Parser::make_db(std::istringstream & is) (\mnt\d\scoutfish\src\parser.cpp:568)
UCI::loop(int argc, char ** argv) (\mnt\d\scoutfish\src\uci.cpp:240)
main(int argc, char ** argv) (\mnt\d\scoutfish\src\main.cpp:53)

tester_pgn.txt