GNOME Bugzilla – Bug 701705
Playing chess with limited time crashes it with segfault
Last modified: 2013-06-06 22:41:09 UTC
Playing Chess with limited time will make Chess crash with segfault in certain circumstances. Steps : 1. Boot system 2. Open Chess 3. Go to settings - preferences and select Game Duration : One minute 4. Click close and start a new game 5. Make a move 6. Press Game - new game, and let the "Save this game before..." on the screen 7. Wait till white player timer hits 3 seconds, and press abandon game 8. A new game will auto start, move the pawns in the front REALLY fast now (move 3 pawns in max 2 seconds, if necessary move more pawn until it segfaults) 9. Observe the crash with segfault Expected outcome: Chess does not crash Actual outcome Chess crashes Note : There are a number of ways to crash with segfault, even while playing a timed round, but this is the only way i was able to reproduce 100% the segfault
Chess is indeed very crashy when timers are in use. This is the first reproducer I've seen; thank you!
The issue is that the clock from the previous game wasn't stopped. The game would crash once the clock from the previous game expired. This would happen after an Open Game as well. The following fix has been pushed: 7862319 Stop the chess clock when ChessGame is freed
Created attachment 246197 [details] [review] Stop the chess clock when ChessGame is freed Otherwise, the timer event remains in the main loop, and causes us to crash when it expires. This would happen if the game is not stopped before starting a new one, e.g. when the player uses "New Game" or "Load Game" before the previous game has played to completion.
The following fix has been pushed: c495957 Stop the chess clock when ChessGame is freed
Created attachment 246198 [details] [review] Stop the chess clock when ChessGame is freed Otherwise, the timer event remains in the main loop, and causes us to crash when it expires. This would happen if the game is not stopped before starting a new one, e.g. when the player uses "New Game" or "Load Game" before the previous game has played to completion. https://bugzilla.gnome.org/show_bug.cgi?id=701705 (cherry picked from commit 7862319a7e4999f9b0bd9991d1480a8c2247ae91)