Bug 283952

Summary: Crash - Illegal Initial Human Move
Product: [Applications] knights Reporter: Dave Kaye <d_k>
Component: generalAssignee: Miha Čančula <miha>
Status: RESOLVED FIXED    
Severity: normal CC: kde-games-bugs
Priority: NOR    
Version: 2.3.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dave Kaye 2011-10-13 23:17:04 UTC
Version:           2.3.2
OS:                Linux

The Knights program 2.3.2 and also the git master branch:

If an illegal move is made as the first move by a human the program will crash.  Touching a piece with no moves possible (bishop, king, queen, rook) or an opponents piece with a drag-and-drop mouse action will crash the program before the move is completed.

It occurs only on the first move.  All other times after this the program successfully ignores the illegal move attempt.

It occurs with or without markers activated.

Reproducible: Always

Steps to Reproduce:
1) start Knights in human vs human or human vs chess engine mode.

2) Attempt to drag the white king.

3) System crash before mouse moves significant distance (must be activating the drag-drop event; appears to be immediately after mouse has moved the startDragDistance).

Actual Results:  
crash

Expected Results:  
ignore move attempt

Any click event on a piece will stop the crash if a subsequent illegal move is attempted still on the first human move.

Drag and return to starting point a legal piece (pawn) then attempt an illegal move will also prevent the crash.

It occurs only on an immediate, first mouse move after startup.
Comment 1 Miha Čančula 2011-10-14 08:14:49 UTC
Git commit bdee59d77d60d394890170139a37828f05b4f352 by Miha Čančula.
Committed on 14/10/2011 at 10:13.
Pushed by mihac into branch '2.3'.

Avoid crash when trying to drag a piece for the first time.

BUG: 283952

M  +1    -0    src/board.cpp

http://commits.kde.org/knights/bdee59d77d60d394890170139a37828f05b4f352
Comment 2 Miha Čančula 2011-10-14 08:14:50 UTC
Git commit 12a9fc17d5b15f75f1610380d955e0387fb2cff9 by Miha Čančula.
Committed on 14/10/2011 at 10:13.
Pushed by mihac into branch 'master'.

Avoid crash when trying to drag a piece for the first time.

BUG: 283952

M  +1    -0    src/board.cpp

http://commits.kde.org/knights/12a9fc17d5b15f75f1610380d955e0387fb2cff9