gnome-chess crash on pawn promotion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Vala |
Fix Released
|
Wishlist
|
|||
gnome-chess (Debian) |
Fix Released
|
Unknown
|
|||
gnome-chess (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Yakkety |
Fix Released
|
High
|
Unassigned |
Bug Description
Impact
------
The Chess app in Ubuntu 16.10 will crash when trying to promote a pawn.
gnome-chess is not installed by default by any current Ubuntu flavors.
Test Case
---------
1. Open the Chess app and click Preferences in the app menu. Change Opposing Player to Human. Close Preferences.
2. Make a move then click New Game to start a new game without a computer player.
3. Move a pawn to the far end of the board to promote it to Queen.
Does Chess crash after promoting?
Regression Potential
-------
Low. This patch only affects pawn promotion which currently causes the game to crash so this is definitely an improvement.
Other Info
----------
There are 3 ways to fix this bug:
1) Build gnome-chess without hardening flags. (This is the approach taken in Fedora 25).
2) Apply a minimal workaround patch to gnome-chess. The patch was acknowledged by the gnome-chess maintainer, but he preferred to push for a proper fix in vala instead.
3) Fix this in vala (it was fixed in vala 0.36 and 0.34.7) and then rebuild gnome-chess against the new vala.
https:/
I initially did #2 in Ubuntu 17.04 Beta (zesty) but will replace it with #3.
I am using #2 for Ubuntu 16.10 since it seems a more minimal SRU.
This only affect Ubuntu 16.10 since that was the first release where we opted gnome-chess into all available hardening flags.
Changed in gnome-chess (Ubuntu): | |
importance: | Undecided → Medium |
affects: | gnome-chess → vala |
Changed in vala: | |
importance: | Unknown → Wishlist |
status: | Unknown → Confirmed |
description: | updated |
Changed in gnome-chess (Ubuntu): | |
importance: | Medium → High |
status: | Confirmed → Fix Committed |
Changed in gnome-chess (Ubuntu Yakkety): | |
status: | New → Triaged |
importance: | Undecided → High |
description: | updated |
summary: |
- Crash on promoting to queen fairymax engine + gnome-chess crash on pawn promotion |
tags: | added: yakkety |
Changed in gnome-chess (Debian): | |
status: | Unknown → Confirmed |
Changed in vala: | |
status: | Confirmed → Fix Released |
description: | updated |
Changed in gnome-chess (Debian): | |
status: | Confirmed → Fix Released |
Found a fix :
vala's enum type should not be nullable (with the ? suffix)
in this case the problem is in the enum: PieceType
just change the relevant declarations in
* gnome-chess.vala
* chess-scene.vala
from PieceType? to PieceType,
and add a NULL member to this enum instead using the null keyword.