02-23-2011, 06:18 AM | #1 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Segmentation fault after existing dialog
I get a segmentation fault in two cases.
The first is if I start Calibre if Calibre is already running (on Ubuntu 10.10) - with no message that it's already running. This isn't really an issue, but just pointing it out. The real issue is if I use my plugin in a certain situation - on both Ubuntu and Windows Vista. Users shouldn't run across this, but I do while testing and its possible that they could come across it if they setup the toolbar icons wrong.
|
02-23-2011, 09:15 AM | #2 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can work around this by simply preventing your plugin from being added to the non device toolbar. Use
dont_add_to = frozenset(['toolbar', 'context-menu']) in your plugin. |
02-23-2011, 10:23 AM | #3 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Ok, that works. It stops the plugin's action from showing up on the list for user's to pick when the dropdown is non-device, but if its already on the toolbar, it stays there. This is good enough. Curious as to why it crashes, but with the workaround its a non-issue. Thanks.
trivial FYI - while testing add/removing the plugin, I noticed if you remove a plugin that does not exist there is a missing space in the output: $ calibre-customize -r 'No such plugin' No custom pluginnamed No such plugin |
02-23-2011, 10:26 AM | #4 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Fixed. The crash will be because of PyQt object persistence issues. The toolbar is rebuilt on device connect, the old objects are deleted. Presumably something in the parent chain of the dialog you are using is being deleted.
|
02-27-2011, 12:24 PM | #5 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
This also happens now if I wait for the device to be connected, then I run my plugin and leave it up showing a dialog. If I then disconnect the device (pull the usb cable out), Calibre is ok until I click OK on my dialog - at which time it crashes. I guess its the same parent issue. Is there a way to trap for it, or maybe adjust the plugin to not cause it? (Of course, users should use Device eject to remove the device - which requires closing the dialog first, but just in case...)
|
02-27-2011, 12:37 PM | #6 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I don't know, this will require debugging to find the underlying issue. If you're willing to do the debugging yourself the relevant code is in gui2.layout and gui2.device. If not, open a ticket and I will look at it when I have the time.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation Fault on calibre-server | brs480 | Calibre | 2 | 02-08-2011 11:02 PM |
Segmentation Fault | bowsprit | Calibre | 4 | 12-28-2010 04:13 AM |
Segmentation fault trying to run Calibre on CentOS 5.5 | midders | Calibre | 1 | 07-26-2010 11:32 AM |
Segmentation Fault after Qt upgrade | reader42 | Calibre | 8 | 03-21-2010 06:58 PM |
Segmentation fault | weedfreak | Calibre | 10 | 10-01-2009 02:47 PM |