fowode / pychess

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

deadlock when changing Hint analyzer #836

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start pychess with a fresh config (not sure this step is necessary)
2. change Preferences->Hint analyzer from pychess to something else  
3. if step 2 didn't trigger it, keep changing the Hint analyzer until it's 
triggered

What is the expected output? What do you see instead?

Something similar to:
04:58:47 (u'Python', '04:02:47.679') ERROR: Traceback (most recent call last):
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
04:58:47 (u'Python', '04:02:47.679') ERROR:     self.run()
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib64/python2.7/threading.py", line 764, in run
04:58:47 (u'Python', '04:02:47.679') ERROR:     self.__target(*self.__args, 
**self.__kwargs)
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Players/PyChess.py", line 175, in 
__analyze
04:58:47 (u'Python', '04:02:47.679') ERROR:     pv = " 
".join(listToSan(self.board, mvs))
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 72, in 
listToSan
04:58:47 (u'Python', '04:02:47.679') ERROR:     san = toSAN (board, move)
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 222, in 
toSAN
04:58:47 (u'Python', '04:02:47.679') ERROR:     return "%s%s" % (notat, 
check_or_mate())
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 128, in 
check_or_mate
04:58:47 (u'Python', '04:02:47.679') ERROR:     for altmove in genAllMoves 
(board_clone):
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmovegen.py", line 165, 
in genAllMoves
04:58:47 (u'Python', '04:02:47.679') ERROR:     attackBoard = 
attack00[cord][ray00[cord] & blocker] | \
04:58:47 (u'Python', '04:02:47.679') ERROR: KeyError: 239L
04:58:47 (u'Python', '04:02:47.679') ERROR: Traceback (most recent call last):
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
04:58:47 (u'Python', '04:02:47.679') ERROR:     self.run()
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib64/python2.7/threading.py", line 764, in run
04:58:47 (u'Python', '04:02:47.679') ERROR:     self.__target(*self.__args, 
**self.__kwargs)
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Players/PyChess.py", line 175, in 
__analyze
04:58:47 (u'Python', '04:02:47.679') ERROR:     pv = " 
".join(listToSan(self.board, mvs))
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 72, in 
listToSan
04:58:47 (u'Python', '04:02:47.679') ERROR:     san = toSAN (board, move)
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 222, in 
toSAN
04:58:47 (u'Python', '04:02:47.679') ERROR:     return "%s%s" % (notat, 
check_or_mate())
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmove.py", line 128, in 
check_or_mate
04:58:47 (u'Python', '04:02:47.679') ERROR:     for altmove in genAllMoves 
(board_clone):
04:58:47 (u'Python', '04:02:47.679') ERROR:   File 
"/usr/lib/python2.7/site-packages/pychess/Utils/lutils/lmovegen.py", line 165, 
in genAllMoves
04:58:47 (u'Python', '04:02:47.679') ERROR:     attackBoard = 
attack00[cord][ray00[cord] & blocker] | \
04:58:47 (u'Python', '04:02:47.679') ERROR: KeyError: 239L

Original issue reported on code.google.com by mattgatto on 14 Feb 2014 at 1:27

Attachments:

GoogleCodeExporter commented 9 years ago
Okay, it's a deadlock and not a crash because I just had it happen trying to 
changed from Sjeng to Stockfish and there was no crashes but pychess locked up. 
Log is attached.

Original comment by mattgatto on 14 Feb 2014 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
... and step 1 (having a fresh config) is not necessary.

Original comment by mattgatto on 14 Feb 2014 at 2:44

GoogleCodeExporter commented 9 years ago
So after adding a bunch of debugging to figure out exactly where it is locking 
up, I've found that it's because this line in SubProcess.__init__() is not 
returning:
         gobject.child_watch_add(self.pid, self.__child_watch_callback)

I still have no idea why.

Original comment by mattgatto on 21 Feb 2014 at 4:09

GoogleCodeExporter commented 9 years ago
I committed debugging output in revision b93c08f0dfd2 to show when this bug 
appears.

Original comment by mattgatto on 3 Apr 2014 at 1:35

GoogleCodeExporter commented 9 years ago
I can't reproduce this anymore so I guess revision 1919a1724fcd fixed it. Nice 
job Tamás!

Original comment by mattgatto on 25 Apr 2014 at 10:29