Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-24-2022, 06:35 PM   #1
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 908
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
segfault using calibredb add

I am attempting to debug a segfault in a plugin when adding a book using calibre-debug. The output of calibre-debug -h gives an example of this, but when I tried it I got:

Code:
dhdurgee@z560:~/Downloads$ calibre-debug -r "Add Books" -- ./Created\ Equal.epub 
Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "site.py", line 45, in <module>
  File "site.py", line 41, in main
  File "calibre/debug.py", line 315, in main
  File "calibre/customize/__init__.py", line 324, in cli_main
NotImplementedError: The Add Books plugin has no command line interface
dhdurgee@z560:~/Downloads$
This is despite the -h option showing:

Code:
  -r RUN_PLUGIN, --run-plugin=RUN_PLUGIN
                        Run a plugin that provides a command line interface.
                        For example:
                        calibre-debug -r "Add Books" -- file1 --option1
                        Everything after the -- will be passed to the plugin
                        as arguments.
The command line approach which hits the segfault is:

Code:
calibredb add ./Created\ Equal.epub --with-library=~/Calibre\ Library
How do I do this?

Dave

Last edited by dhdurgee; 05-24-2022 at 06:51 PM. Reason: add command line approach
dhdurgee is offline   Reply With Quote
Old 05-24-2022, 09:28 PM   #2
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Moderator Notice
I'm moving this thread to the Calibre forum instead of the plugin specific sub-forum and renaming it appropriately.

From what you say, you aren't getting a seg fault from a plugin, you're getting one from running Calibre CLI calibredb add.

I'm not personally well versed with what may cause that. Are you using an OS distro bundled version of Calibre? Or the official release?

The error you see from calibre-debug -r is unrelated.

"Add Books" is a built-in action, which plugins share many similarities with, but aren't quite the same thing.

Not sure why Kovid gives an example in the calibre-debug -r help text of 'Add Books' except that it's a placeholder instead of using something like 'Plugin Name'. The 'Add Books' built-in action doesn't have a plugin style CLI
JimmXinu is offline   Reply With Quote
Advert
Old 05-24-2022, 09:53 PM   #3
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's not a segfault, thats an error saying that the Add Books plugin doesnt have a CLI. You are supposed to replace "Add Books" with the name fo the plugin you want to run.
kovidgoyal is offline   Reply With Quote
Old 05-24-2022, 10:07 PM   #4
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 908
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
The segfault is occurring in a plugin when I attempt to add the book either using the GUI or the command line option.

Code:
dhdurgee@z560:~/Downloads$ calibredb add ./Created\ Equal.epub --with-library=~/Calibre\ Library
DeDRM v10.0.2: Trying to decrypt Created Equal.epub
DeDRM v10.0.2: Verifying zip archive integrity
DeDRM v10.0.2: Created Equal.epub is a secure Adobe Adept ePub for UUID 500ec903-efb8-45ec-8cc0-8ff5db93808a
DeDRM v10.0.2: Trying Encryption key RTC
Segmentation fault (core dumped)
dhdurgee@z560:~/Downloads$
I hoped to be able to debug the error and at least determine which line of code and outside resource is hitting the problem in hopes of correcting it.

Dave
dhdurgee is offline   Reply With Quote
Old 05-24-2022, 10:26 PM   #5
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If this is a file type plugin like a drm removal plugin it is run automatically when adding, you cant run it manually using -r (-r is for plugins that explicitly provide an actual CLI of their own).

You wont get any debug information for a segfault unless you run the program under gdb or use something like echo bt | coredumpctl gdb

But even then since most binaries have debug information stripped on Linux, you wont get very useful backtraces.
kovidgoyal is offline   Reply With Quote
Advert
Old 05-25-2022, 02:59 PM   #6
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 908
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Problem is solved. I had an incorrect item in the configuration file and it appears that was the cause of the segfault. Removing the incorrect value corrected the problem.

So this was a case of a plugin not handing an incorrect value very well.

Dave
dhdurgee is offline   Reply With Quote
Old 05-25-2022, 10:18 PM   #7
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by dhdurgee View Post
Problem is solved. I had an incorrect item in the configuration file and it appears that was the cause of the segfault. Removing the incorrect value corrected the problem.

So this was a case of a plugin not handing an incorrect value very well.
Can you post some details? That would let the plugin writer fix the issue so it doesn't hit others.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Speedup calibredb add? asm0dey Library Management 0 05-21-2022 08:32 AM
calibredb add failes asm0dey Library Management 10 05-21-2022 06:25 AM
calibredb add questions jindroush Related Tools 7 01-31-2018 12:10 AM
calibredb add problem jmwatte Calibre 6 10-17-2014 02:30 AM
calibredb add -- how to add additional metadata? TuxGirl Calibre 16 12-29-2011 01:01 AM


All times are GMT -4. The time now is 08:54 AM.


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