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 709232 - segfault in chess
segfault in chess
Status: RESOLVED WONTFIX
Product: gcompris
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Bruno Coudoin
Rami Aubourg-Kaires
Depends on:
Blocks:
 
 
Reported: 2013-10-01 21:53 UTC by serval2412
Modified: 2013-10-05 07:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description serval2412 2013-10-01 21:53:53 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
  • #0 move_piece_to
    at chess.c line 699
  • #1 engine_local_cb
    at chess.c line 1198
  • #2 g_main_dispatch
    at /tmp/buildd/glib2.0-2.36.4/./glib/gmain.c line 3054
  • #3 g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.36.4/./glib/gmain.c line 3630
  • #4 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.36.4/./glib/gmain.c line 3701
  • #5 g_main_loop_run
    at /tmp/buildd/glib2.0-2.36.4/./glib/gmain.c line 3895
  • #6 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #7 main
    at gcompris.c line 2059

Julien
Comment 1 Bruno Coudoin 2013-10-01 22:22:29 UTC
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.
Comment 2 serval2412 2013-10-02 05:41:34 UTC
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!
Comment 3 serval2412 2013-10-02 05:51:27 UTC
BTW, the testing Debian package version of GnuChess is 6.0.3-1

Just by curiosity, which version is included in Gcompris?
Comment 4 Bruno Coudoin 2013-10-02 16:08:49 UTC
I don't remember excactly but it is gnuchess 5.x
Comment 5 Yann Dirson 2013-10-02 19:01:23 UTC
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...
Comment 6 serval2412 2013-10-05 07:16:15 UTC
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.