fowode / pychess

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

bookPanel crashes #861

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was testing out my glock-debug patch and encountered these crashes when I 
turned on local table-bases in Preferences->Hints with a running game tab open. 
I don't actually have any table-base files on my system, I just wanted the 
option on.

Traceback (most recent call last):
  File "/home/gatto/code/hg/pychess/sidepanel/bookPanel.py", line 531, in shown_changed
    advisor.shown_changed(boardview, shown)
  File "/home/gatto/code/hg/pychess/sidepanel/bookPanel.py", line 93, in shown_changed
    openings = getOpenings(b.board)
  File "/home/gatto/code/hg/pychess/lib/pychess/Utils/book.py", line 57, in getOpenings
    entry = BookEntry._make(entrystruct.unpack(bookFile.read(entrysize)))
struct.error: unpack requires a string argument of length 16
Traceback (most recent call last):
  File "/home/gatto/code/hg/pychess/lib/pychess/Main.py", line 280, in on_preferences_activate
    preferencesDialog.run(gamewidget.getWidgets())
  File "/home/gatto/code/hg/pychess/lib/pychess/widgets/preferencesDialog.py", line 21, in run
    initialize(widgets)
  File "/home/gatto/code/hg/pychess/lib/pychess/widgets/preferencesDialog.py", line 28, in initialize
    HintTab(widgets)
  File "/home/gatto/code/hg/pychess/lib/pychess/widgets/preferencesDialog.py", line 81, in __init__
    conf.set("opening_file_entry", path)
  File "/home/gatto/code/hg/pychess/lib/pychess/System/conf.py", line 29, in set
    confmodule.set(key, value)
  File "/home/gatto/code/hg/pychess/lib/pychess/System/conf_configParser.py", line 57, in set
    func (None, *args)
  File "/home/gatto/code/hg/pychess/sidepanel/bookPanel.py", line 470, in on_opening_file_entry_changed
    advisor.shown_changed(self.boardview, self.boardview.shown)
  File "/home/gatto/code/hg/pychess/sidepanel/bookPanel.py", line 93, in shown_changed
    openings = getOpenings(b.board)
  File "/home/gatto/code/hg/pychess/lib/pychess/Utils/book.py", line 57, in getOpenings
    entry = BookEntry._make(entrystruct.unpack(bookFile.read(entrysize)))
struct.error: unpack requires a string argument of length 16

Original issue reported on code.google.com by mattgatto on 4 May 2014 at 9:01

Attachments:

GoogleCodeExporter commented 9 years ago
Was this with pychess own book file or something other? Can you reproduce this 
with unpatched log handling? The attached .log is rather hart to read :)

Original comment by gbtami on 5 May 2014 at 8:21

GoogleCodeExporter commented 9 years ago
I believe I had pychess set to use it's own book (pychess_book.bin) in the 
Hints panel, and my hint analyzer, stockfish, set to use its own book file 
(/var/lib/games/stockfish/Book.bin) in the Engine dialog options. I can't 
reproduce, but do we need to? That statement looks like it needs some error 
handling. For example, if Bookfile.read() doesn't return a string of length 16, 
gracefully fail somehow?

Sorry about the messy logging, I'm working on cleaning it up as much as 
possible, including shortening the acquire/release debug lines. But we'll 
probably have to get used to it, because I don't know of any other way to debug 
these deadlocks. Maybe pipe the log file through an inverted grep and then to 
less:
$ grep -v 'acquire\|release' $(ls -t ~/.local/share/pychess |head -n 1) |less

Original comment by mattgatto on 7 May 2014 at 12:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 48c684208305.

Original comment by gbtami on 7 May 2014 at 5:44