Aleks31 / pychess

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

crash upon receipt of engine analysis move list recommending castling in fischer random game #596

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The first log shows what happens without an assert in CECPEngine.__parseLine 
and the second log shows the crash after adding an assert.

With assert added:
20:56:22 stdout Debug: Traceback (most recent call last):
20:56:22 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/Players/CECPEngine.p
y", line 614, in parseLines
20:56:22 stdout Debug:     self.__parseLine(line)
20:56:22 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/Players/CECPEngine.p
y", line 693, in __parseLine
20:56:22 stdout Debug:     assert moves[0].cords[0] != moves[0].cords[1], "%s 
%s" % (line, moves)
20:56:22 stdout Debug: AssertionError: 4    231 3.19    10129   O-O Qe1 Ng4 Bxg7 Kxg7

Without assert added:
18:23:47 stdout Debug: Traceback (most recent call last):
18:23:47 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/widgets/BoardView.py
", line 486, in expose
18:23:47 ('Python', '18:10:44.421') Debug: 7.0 moves/position; 5716.9 n/s
18:23:47 stdout Debug:     self.draw(context, event.area)
18:23:47 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/widgets/BoardView.py
", line 554, in draw
18:23:47 stdout Debug:     self.drawArrows (context)
18:23:47 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/widgets/BoardView.py
", line 950, in drawArrows
18:23:47 stdout Debug:     (.54,.886,.2,0.9), (.306,.604,.024,1))
18:23:47 stdout Debug:   File 
"/home/gatto/code/hg/pychess-actionsinsensitive/lib/pychess/widgets/BoardView.py
", line 897, in __drawArrow
18:23:47 stdout Debug:     vx = lvx/l
18:23:47 stdout Debug: ZeroDivisionError: float division

Original issue reported on code.google.com by mattgatto on 14 Oct 2010 at 4:25

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in revision a06daa16c5.

Original comment by mattgatto on 14 Oct 2010 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by mattgatto on 14 Oct 2010 at 4:28

GoogleCodeExporter commented 9 years ago
The real question here is how we should handle fischer random castling moves 
for positions like "br1b2kr/p3qppp/1p1ppnn1/1Pp5/2P1P3/1R1P1N2/P3QPPP/B1NB1RK1 
b hb - 0 9" where the source and destination cord are the same for black's 
castling move 0-0. Before the patch was applied, lmove.parseSAN converted "0-0" 
to a Move == "g8g8", and with the patch applied, converts it to a Move == 
"g8h8", which simplifies generating hint arrows.

My question is, if we update lmovegen.genCastles (and testing/frc_castling.py) 
to do the same thing and be consistent, will this break anything anywhere else 
in the code, such as in the PyChess engine?

Original comment by mattgatto on 14 Oct 2010 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago
Matt, if updating lmovegen.genCastles doesn't fix further issues, I vote for 
not updating it, because it's code is simple and compact now. 

Original comment by gbtami on 14 Oct 2010 at 12:54