Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 02-23-2011, 06:18 AM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
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.
  1. Load my Create Kindle Collections plugin.
  2. Add its action to BOTH the device connected toolbar and the device not connected toolbar.
  3. Connect a Kindle (probably any device for this test)
  4. Start calibre - and BEFORE the device has a chance to fully connect quickly select the Customize plugin menu entry (or Preview) in the drop down.
  5. You should get an error that the Kindle is not detected.
  6. Wait until things settle down and the device is fully connected
  7. Now click OK on the previous error dialog - Calibre crashes
However, if you click OK just after you get the 'not connected' error dialog and before the device is fully connected, Calibre keeps running ok.
meme is offline   Reply With Quote
Old 02-23-2011, 09:15 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-23-2011, 10:23 AM   #3
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
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
meme is offline   Reply With Quote
Old 02-23-2011, 10:26 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
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.
kovidgoyal is offline   Reply With Quote
Old 02-27-2011, 12:24 PM   #5
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
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...)
meme is offline   Reply With Quote
Advert
Old 02-27-2011, 12:37 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:04 AM.


MobileRead.com is a privately owned, operated and funded community.