![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2012
Device: SONY PRTS1
|
crash after several self.db.bulk_modify_tags
i am writing a plugin to modify tags; after calling
Code:
self.db.bulk_modify_tags(...) Code:
self.db.refresh() self.gui.library_view.model().refresh_ids(arBooks) # arBooks contains the ids of the modified books self.gui.tags_view.recount() self.gui.library_view.refresh_book_details() So far so good, after several bulk_modify_tags calibre completely crahes no stack trace is printed to stdout. I am starting clibre with Code:
calibre-debug -g Any help would be welcome. regards ramson Last edited by ramsonb; 02-21-2012 at 06:04 PM. |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2012
Device: SONY PRTS1
|
i have attached the plugin, please keep in mind that this is work in progress
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Generally, with this kind of thing, the likely cause is some PyQt object being garbage collected at the wrong time, while the underlying Qt object still is receiving signals or something like that. I doubt that bulk_modify_tags is the cause of the crash. You can test that by doing lots of bulk modification of tags in calibre via the bulk edit metadata dialog.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2012
Device: SONY PRTS1
|
thanks for the quick reply, i didn't say there was a bug in bulk_modify_tags, the code looks good and i have already used the internal tag browser with no problem.
I was unsure if Code:
self.db.refresh() self.gui.library_view.model().refresh_ids(arBooks) # arBooks contains the ids of the modified books self.gui.tags_view.recount() self.gui.library_view.refresh_book_details() Furthermore do you have any tips how to get some debug information in such a case. thanks in advance ramson |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you look at the edit_metadata() method in actions/edit_metadata.py you will see how the UI is refreshed after a metadata edit operation (bulk or single). Use the same code. Though I thought you said that the crash happened even when you removed the refresh code.
As for debugging these crashes, there's no easy way. If you run calibre on linux, you can compile python, pyqt, sip and qt with -ggdb and then get back traces with gdb, but the backtraces are not awfully helpful. The most effective technique is to look for PyQt objects going out of scope and getting garbage collected. Try to aggressively keep references to every pyqt object you create. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Startup crash | Phyrefly | Calibre | 2 | 06-17-2011 12:27 PM |
Crash on these epubs | lorenzoens | enTourage Archive | 0 | 05-08-2011 01:03 PM |
0.7.30 crash | nickredding | Calibre | 1 | 11-27-2010 01:40 PM |
PRS-600 Dictionary Crash. | FlatlineTech | Sony Reader | 8 | 04-21-2010 02:18 PM |
My first crash on the PRS700. | Wetdogeared | Sony Reader | 10 | 12-14-2008 06:23 AM |