fowode / pychess

Automatically exported from code.google.com/p/pychess
GNU General Public License v3.0
0 stars 0 forks source link

pychess partially locks up after undo against gnuchess #865

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Play a Human (white in this case) vs gnuchess game (black in this case)
2. Keep playing and undoing moves until the board/gamewidget locks up (but not 
the interface)

What is the expected output? What do you see instead?
The board locks up (but not the interface) and you can't pause the game; 
black's clock runs but black can't move.

According to the log, the GameModel thread is stuck at:

Thread: GameModel.newFunction:25 (139875055552256)
  File "/usr/lib64/python2.7/threading.py", line 784, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/gatto/code/hg/pychess/lib/pychess/System/ThreadPool.py", line 91, in run
    self.func()
  File "/home/gatto/code/hg/pychess/lib/pychess/System/ThreadPool.py", line 62, in <lambda>
    a.func = lambda: func(*args, **kw)
  File "/home/gatto/code/hg/pychess/lib/pychess/Utils/GameModel.py", line 39, in newFunction
    func(*args, **kw)
  File "/home/gatto/code/hg/pychess/lib/pychess/Utils/GameModel.py", line 780, in undoMoves
    player.playerUndoMoves(moves, self)
  File "/home/gatto/code/hg/pychess/lib/pychess/Players/CECPEngine.py", line 92, in newFunction
    func_(*args_, **kw_)
  File "/home/gatto/code/hg/pychess/lib/pychess/Players/CECPEngine.py", line 573, in playerUndoMoves
    self._blockTillMove()
  File "/home/gatto/code/hg/pychess/lib/pychess/Players/CECPEngine.py", line 702, in _blockTillMove
    self.movecon.wait()
  File "/usr/lib64/python2.7/threading.py", line 339, in wait
    waiter.acquire()

Original issue reported on code.google.com by mattgatto on 10 May 2014 at 7:02

Attachments:

GoogleCodeExporter commented 9 years ago
I think this is same as issue #855, Undo fails if opponent has not moved.

In playerUndoMoves() of CECPEngine.py after

        self.__tellEngineToStopPlayingCurrentColor()

the code block

        if self.board and gamemodel.status in UNFINISHED_STATES:
            log.debug("playerUndoMoves: self.__tellEngineToMoveNow(), self._blockTillMove()")
            self.__tellEngineToMoveNow()
            self._blockTillMove()

seems unnecessary for me.
If I remove it, undo works ok with all engines except pychess.

Original comment by gbtami on 10 May 2014 at 8:43

GoogleCodeExporter commented 9 years ago
I think revision 8cd17599a5fa fixed this too. Can you try it, please?

Original comment by gbtami on 10 May 2014 at 5:08

GoogleCodeExporter commented 9 years ago
Seems fixed.

Original comment by mattgatto on 10 May 2014 at 9:55