Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-23-2011, 07: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, 10: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: 26,435
Karma: 5383257
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 online now   Reply With Quote
 
Advertisement
Old 02-23-2011, 11: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, 11: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: 26,435
Karma: 5383257
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 online now   Reply With Quote
Old 02-27-2011, 01: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
Old 02-27-2011, 01: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: 26,435
Karma: 5383257
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 online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation Fault on calibre-server brs480 Calibre 2 02-09-2011 12:02 AM
Segmentation Fault bowsprit Calibre 4 12-28-2010 05:13 AM
Segmentation fault trying to run Calibre on CentOS 5.5 midders Calibre 1 07-26-2010 12:32 PM
Segmentation Fault after Qt upgrade reader42 Calibre 8 03-21-2010 07:58 PM
Segmentation fault weedfreak Calibre 10 10-01-2009 03:47 PM


All times are GMT -4. The time now is 12:25 AM.


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