https://bugs.kde.org/show_bug.cgi?id=424263
Bug ID: 424263 Summary: Golf with Black Hole Solver crashes when dealing last card from the deck Product: kpat Version: 20.04 Platform: Archlinux Packages OS: Linux Status: REPORTED Severity: crash Priority: NOR Component: solver Assignee: co...@kde.org Reporter: maciej.stancze...@gmail.com CC: kde-games-b...@kde.org Target Milestone: --- Created attachment 130151 --> https://bugs.kde.org/attachment.cgi?id=130151&action=edit Ensure space after "Talon:" entry SUMMARY Using Black Hole Solver, sometimes when dealing the last card from the deck the game will crash. This happens when BH solver is called on the last card (i.e. when the game is not lost). It can also be triggered by doing an Undo and replaying the last card from the deck. STEPS TO REPRODUCE 1. Start a game of Golf 2. Deal all cards from the deck 3. Undo the last move (one card back to the deck) 4. Deal last card from the deck OBSERVED RESULT The application crashes with message "Error reading the board at line No. 2!". EXPECTED RESULT Same behavior as in step #2 -- no crash, solver reporting "This game is lost". SOFTWARE/OS VERSIONS KDE Plasma Version: 5.19.3 KDE Frameworks Version: 5.72.0 Qt Version: 5.15.0 ADDITIONAL INFORMATION This error is returned from Black Hole Solver because of missing space in board description. When there are no cards in the deck, Golf will produce a line "Talon:", but BH Solver expects there to always be a space after the colon, like in "Talon: ". I have attached a patch that should solve the issue. Also, about being able to reproduce it with the Undo button: this could be related to bug 424261. When reaching "This game is lost" state while there are still cards in the deck, BH Solver will no longer be called, so we will not encounter the missing space issue. However after doing an Undo and replaying the last move BH Solver is called again, leading to the crash. -- You are receiving this mail because: You are watching all bug changes.