GNOME Bugzilla – Bug 709232
segfault in chess
Last modified: 2013-10-05 07:16:15 UTC
Hello, On pc Debian x86-64 with these info from apt: Package: gcompris Version: 12.11-1 Installed-Size: 1582 Maintainer: Yann Dirson <dirson@debian.org> Architecture: amd64 Replaces: gcompris-data (<< 8.4.1) I got a segfault after these steps: - open gcompris - select Strategy games (last category) - select first category (practice) - select first category again - just move the pawn in front of the Queen (D2-D4) => crash Program received signal SIGSEGV, Segmentation fault. move_piece_to (from=496, to=510) at chess.c:699 699 chess.c: Aucun fichier ou dossier de ce type. (gdb) bt
+ Trace 232564
Julien
GCompris does not work well with a random version of the external program gnuchess. I thus packaged gnuchess myself within GCompris but I don't know how it was packaged on debian. If you don't have the binary gcompris-gnuchess then you are using the official gnuchess.
Thank you Bruno for your quick feedback. Indeed, I uninstalled gnuchess and when I tried to launch chess from gcompris, I got this: Error: The external program gnuchess is mandatory to play chess in gcompris. First install it, and check it is in /usr/games/gnuchess So it seems a Debian packaging bug. I'll try to find some time to fill a bug on Debian side (if there's not already one! :-)) Thank you again!
BTW, the testing Debian package version of GnuChess is 6.0.3-1 Just by curiosity, which version is included in Gcompris?
I don't remember excactly but it is gnuchess 5.x
I had not even ealized there was a copy of gnuchess in the source package, and it is highly discouraged if not completely prohibited by the Debian policy to ship old versions that way: it makes it a nightmare of maintainance - think about fixing various issues, notably security ones... If gcompris segfaults, there is clearly a bug in the code...
I tried some debugging and noticed this: Breakpoint 1, ascii_to_move (pos=0x1af1a50, p=0x7fffffffdc59 "f6", p@entry=0x7fffffffdc57 "g8f6", from=from@entry=0x7fffffffdc3c, to=to@entry=0x7fffffffdc3e) at chess_notation.c:242 242 *to = (*p - 'a' + 1) + (*(p + 1) - '1' + 2 ) * 10; (gdb) c Continuing. Breakpoint 1, ascii_to_move (pos=0x1af1a50, p=0x7fffffffdc6a "8f6", p@entry=0x7fffffffdc68 " g8f6", from=from@entry=0x7fffffffdc3c, to=to@entry=0x7fffffffdc3e) at chess_notation.c:242 242 *to = (*p - 'a' + 1) + (*(p + 1) - '1' + 2 ) * 10; (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. move_piece_to (from=496, to=510) at chess.c:699 For a reason I ignore the send time we enter in ascii_to_move, p = " g8f6" instead of "g8f6" So I create a delete_space function (as the other delete_.. functions) + added it in ascii_to_move just after the call of delete_x Now the crash disappeared but if I've got the move of black ok then, my next white move hangs. I mean I can see the authorized moves but when I try to move, the piece moves back to its initial position as if it was illegal. But of course I know it's another issue.