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 696475 - Hang when Phalanx attempts to promote a piece
Hang when Phalanx attempts to promote a piece
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
git master
Other Linux
: Normal critical
: ---
Assigned To: gnome-chess-maint
gnome-chess-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-24 02:56 UTC by Michael Catanzaro
Modified: 2013-04-15 04:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pgn to make the AI try to promote. Just move the King up a rank. (197 bytes, application/octet-stream)
2013-03-24 02:56 UTC, Michael Catanzaro
  Details
Let Phalanx promote (2.98 KB, patch)
2013-03-24 03:01 UTC, Michael Catanzaro
committed Details | Review
Fix AI hang when Phalanx attempts to promote (2.98 KB, patch)
2013-04-15 04:35 UTC, Jason Clinton
committed Details | Review

Description Michael Catanzaro 2013-03-24 02:56:54 UTC
Created attachment 239658 [details]
pgn to make the AI try to promote. Just move the King up a rank.

Phalanx can't promote pieces. When it tries to promote, the game "hangs" forever. (This of course is not a real UI hang, but the AI will never move again.)

** (glchess:5195): DEBUG: chess-engine.vala:155: Writing line to engine: 'go'
** (glchess:5195): DEBUG: chess-engine-cecp.vala:41: Read from engine: 'my move is Pd2xc1Q  '
** (glchess:5195): DEBUG: chess-engine-cecp.vala:49: Engine moves Pd2xc1Q  
** (glchess:5195): DEBUG: chess-game.vala:1150: Move Pd2xc1Q has unexpected characters
** (glchess:5195): DEBUG: chess-engine-cecp.vala:41: Read from engine: '5. ... d2c1q'

The problem is that gnome-chess is expecting a lowercase letter for the promotion type, and the uppercase Q is throwing it off.

I'll attach a patch to fix this, and also update the testcases to be a bit more robust for promotions. (One of the test cases promotes to a Knight instead of a Queen, and will fail until Bug #691050 is resolved.)
Comment 1 Michael Catanzaro 2013-03-24 03:01:42 UTC
Created attachment 239659 [details] [review]
Let Phalanx promote

Suggested patch
Comment 2 Jason Clinton 2013-04-15 04:34:01 UTC
Comment on attachment 239659 [details] [review]
Let Phalanx promote

LGTM
Comment 3 Jason Clinton 2013-04-15 04:35:21 UTC
The following fix has been pushed:
d190d8b Fix AI hang when Phalanx attempts to promote
Comment 4 Jason Clinton 2013-04-15 04:35:25 UTC
Created attachment 241545 [details] [review]
Fix AI hang when Phalanx attempts to promote

Also, add two promotion tests