After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701705 - Playing chess with limited time crashes it with segfault
Playing chess with limited time crashes it with segfault
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
3.8.x
Other Linux
: High critical
: ---
Assigned To: Michael Catanzaro
gnome-chess-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-06 10:10 UTC by Marie.KOWALCZYK
Modified: 2013-06-06 22:41 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
Stop the chess clock when ChessGame is freed (1.04 KB, patch)
2013-06-06 22:38 UTC, Michael Catanzaro
committed Details | Review
Stop the chess clock when ChessGame is freed (1.11 KB, patch)
2013-06-06 22:39 UTC, Michael Catanzaro
committed Details | Review

Description Marie.KOWALCZYK 2013-06-06 10:10:54 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
Comment 1 Michael Catanzaro 2013-06-06 19:37:46 UTC
Chess is indeed very crashy when timers are in use. This is the first reproducer I've seen; thank you!
Comment 2 Michael Catanzaro 2013-06-06 22:38:34 UTC
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
Comment 3 Michael Catanzaro 2013-06-06 22:38:36 UTC
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.
Comment 4 Michael Catanzaro 2013-06-06 22:39:23 UTC
The following fix has been pushed:
c495957 Stop the chess clock when ChessGame is freed
Comment 5 Michael Catanzaro 2013-06-06 22:39:26 UTC
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)