fowode / pychess

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

PyChess freezes after my partner aborted a FICS game before move 1. #834

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Accepted an unrated blitz seek
2. My partner aborted the game before any move was taken
3. freeze

Original issue reported on code.google.com by gbtami on 4 Feb 2014 at 8:42

Attachments:

GoogleCodeExporter commented 9 years ago
Were you running with the debugging output patch from issue 818? Did the board 
and all the pieces get drawn? I'll commit that patch.

Original comment by mattgatto on 6 Feb 2014 at 2:42

GoogleCodeExporter commented 9 years ago
No, I was running it without that patch. The board and pieces was drawn, but a 
tooltip box of player under mouse cursor was visible over the board too.

Original comment by gbtami on 6 Feb 2014 at 9:29

GoogleCodeExporter commented 9 years ago
Still see this? I have a feeling that this bug -- like issue 838 -- was fixed 
by revision 4b9d2a1c38e2 (because you mentioned the tooltip in comment 2).

Original comment by mattgatto on 12 Mar 2014 at 9:52

GoogleCodeExporter commented 9 years ago
No, haven't seen. I agree that it fixed this too.

Original comment by gbtami on 12 Mar 2014 at 10:06

GoogleCodeExporter commented 9 years ago
Got it exactly as the original and comment #2.

Original comment by gbtami on 19 Mar 2014 at 8:59

Attachments:

GoogleCodeExporter commented 9 years ago
And again, but now no gamewidget appeared, just freeze with tooltip box shown.

Original comment by gbtami on 19 Mar 2014 at 9:04

Attachments:

GoogleCodeExporter commented 9 years ago
Seems this not occurring when analyze engine is not configured.

Original comment by gbtami on 19 Mar 2014 at 10:31

GoogleCodeExporter commented 9 years ago
The log file from comment 6 and the comment from comment 7 about this not 
occurring when there is no analyzer seems to indicate that the freeze/deadlock 
from comment 6 is caused by issue 836. I committed some debugging output in 
revision b93c08f0dfd2 that should indicate whether or not this conclusion is 
correct.

Original comment by mattgatto on 3 Apr 2014 at 12:25

GoogleCodeExporter commented 9 years ago
Now I was able to create a screenshot in Virtualbox Ubuntu 14.04 guest.

Original comment by gbtami on 22 Apr 2014 at 9:19

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention that Stockfish as analyzer was set in preferences.

Original comment by gbtami on 22 Apr 2014 at 9:31

GoogleCodeExporter commented 9 years ago
I added some debugging for log from comment 9 in revision e06e19576a24. I don't 
think this is related to the other FICS aborted game problems earlier in this 
issue; I think it's a some kind of race condition in widget/model startup. In 
the comment 9 log file your opponent aborted the game 1 minute after it 
started, so probably your interface locked up and he gave up waiting and 
aborted.

Original comment by mattgatto on 27 Apr 2014 at 7:31

GoogleCodeExporter commented 9 years ago
Agreed.
The next one with debugging log attached.

Original comment by gbtami on 30 Apr 2014 at 6:27

Attachments:

GoogleCodeExporter commented 9 years ago
Screenshot for #12

Original comment by gbtami on 30 Apr 2014 at 6:29

Attachments:

GoogleCodeExporter commented 9 years ago
What happens with the attached patch?

Original comment by mattgatto on 30 Apr 2014 at 7:09

Attachments:

GoogleCodeExporter commented 9 years ago
Can't reproduce it with patch yet.

Original comment by gbtami on 2 May 2014 at 6:41

GoogleCodeExporter commented 9 years ago
That patch is not right because, the original code was correct; those 
players_changed callbacks in the sidepanels need to be glocked. I've restarted 
work on a patch to make --glock-debug and --thread-debug on by default. 
Hopefully that patch -- when it's finished -- will show the sources of these 
deadlocks.

Original comment by mattgatto on 4 May 2014 at 8:56

GoogleCodeExporter commented 9 years ago
Can you still reproduce this with the debugging changes I just committed in 
revision 1e6f1a5a08d0?

Original comment by mattgatto on 10 May 2014 at 6:41

GoogleCodeExporter commented 9 years ago
Produced a new one, but maybe it's not the same as it happened on game end 
(forfeit on time).

Original comment by gbtami on 10 May 2014 at 9:36

Attachments:

GoogleCodeExporter commented 9 years ago
Screenshot for #18

Original comment by gbtami on 10 May 2014 at 9:37

Attachments:

GoogleCodeExporter commented 9 years ago
Yeah, the log in comment 18 is a different bug. Looks like a deadlock between 
the MainThread, which probably has the Gdk lock and is trying to get the 
BoardControl.stateLock, and the FICSConnection thread, which already has the 
BoardControl.stateLock and is trying to get the Gdk lock with threads_enter.

has glock
Thread: FICSConnection.run:288 (139966004299520)
...
  File "/home/tamas/pychess/lib/pychess/ic/VerboseTelnet.py", line 222, in test_prediction
    answer = prediction.handle(line.line)
  File "/home/tamas/pychess/lib/pychess/ic/VerboseTelnet.py", line 49, in handle
    self.callback(match)
  File "/home/tamas/pychess/lib/pychess/ic/managers/HelperManager.py", line 129, in on_game_remove
    self.connection.games.game_ended(game)
  File "/home/tamas/pychess/lib/pychess/ic/FICSObjects.py", line 949, in game_ended
    self.emit("FICSGameEnded", game)
  File "/home/tamas/pychess/lib/pychess/ic/managers/BoardManager.py", line 822, in onGameEnd
    self.emit("curGameEnded", game)
  File "/home/tamas/pychess/lib/pychess/ic/ICGameModel.py", line 120, in onGameEnded
    self.end(ficsgame.result, ficsgame.reason)
  File "/home/tamas/pychess/lib/pychess/ic/ICGameModel.py", line 210, in end
    GameModel.end(self, status, reason)
  File "/home/tamas/pychess/lib/pychess/Utils/GameModel.py", line 706, in end
    self.emit("game_ended", reason)
  File "/home/tamas/pychess/lib/pychess/widgets/BoardControl.py", line 174, in game_ended
    self.view.startAnimation()
  File "/home/tamas/pychess/lib/pychess/widgets/BoardView.py", line 542, in startAnimation
    self.runAnimation(redrawMisc = True)
  File "/home/tamas/pychess/lib/pychess/widgets/BoardView.py", line 536, in runAnimation
    self.redraw_canvas(rect(paintBox))
  File "/home/tamas/pychess/lib/pychess/widgets/BoardView.py", line 605, in redraw_canvas
    glock.acquire()
  File "/home/tamas/pychess/lib/pychess/System/glock.py", line 34, in acquire
    threads_enter()

Thread: MainThread (139966265501504)
  File "./pychess", line 138, in <module>
    chess_file, ics_host, ics_port)
  File "/home/tamas/pychess/lib/pychess/Main.py", line 492, in run
    gtk.main()
  File "/home/tamas/pychess/lib/pychess/widgets/BoardControl.py", line 249, in button_press
    return self.currentState.press(event.x, event.y, event.button)
  File "/home/tamas/pychess/lib/pychess/widgets/BoardControl.py", line 565, in press
    self.parent.setStateNormal()
  File "/home/tamas/pychess/lib/pychess/widgets/BoardControl.py", line 237, in setStateNormal
    self.stateLock.acquire()

Original comment by mattgatto on 10 May 2014 at 10:36

GoogleCodeExporter commented 9 years ago
When you get more freezes/deadlocks could you open new bugs for them, attach 
the log, and CC me? If they're the same as this one, we can just mark them 
duplicates. 

Original comment by mattgatto on 10 May 2014 at 10:39

GoogleCodeExporter commented 9 years ago
Sure. And sorry for mixing-up things.

Original comment by gbtami on 10 May 2014 at 10:57

GoogleCodeExporter commented 9 years ago
Fixed the deadlock from comment 18 in revision 873eea589e7e

Original comment by mattgatto on 10 May 2014 at 11:13

GoogleCodeExporter commented 9 years ago

Original comment by mattgatto on 23 May 2014 at 6:21