#867949 ebook-viewer crashes with "Illegal instruction"

#867949#5
Date:
2017-07-10 16:18:31 UTC
From:
To:
Other relevant packages:

calibre-bin            2.75.1+dfsg-1
python2.7              2.7.13-2
libqt5webkit5          5.7.1+dfsg-1
python-pyqt5.qtwebkit  5.7+dfsg-5

For debugging I also installed (for i386):

calibre-bin-dbgsym         2.75.1+dfsg-1
python2.7-dbg              2.7.13-2
libqt5webkit5-dbg          5.7.1+dfsg-1
python-pyqt5.qtwebkit-dbg  5.7+dfsg-5

Kernel: Linux debian 4.9.0-3-686-pae #1 SMP Debian 4.9.30-2+deb9u2
(2017-06-26) i686 GNU/Linux


The ebook-viewer from the package calibre crashes with an "illegal
instruction", while reading ebooks of type *.epub. This happens, for
example, with the ebooks from Project Gutenberg at
https://www.gutenberg.org/wiki/Main_Page .

The crash does not happen immediately; the application starts normally
and I can open an ebook of type *.epub. I can also browse through the
pages. But when I start reading and stay at two subsequent page for some
time, then the ebook-viewer may suddenly quit with an illegal instruction.

It seems, that the ebook-viewer regularly recalculates the current
reading position and safes it to a file. The next time it will reopen
the file at the same position. But sometimes it seems to crash at this
point.

The ebook-viewer may also crash, when the application window is closed.
This crash may get unnoticed during normal usage. But in the debugger, I
still get the message: "Program terminated with signal SIGILL, Illegal
instruction."

I suspect, that the cause is again the recalculation of the reading
position, to save it to a file.


When the ebook-viewer is started in a terminal, I get the error "Illegal
instruction".

hb1@debian:~$ ebook-viewer
Illegal instruction
hb1@debian:~$


The logfiles /var/log/messages, /var/log/syslog und /var/log/kern.log
contain these messages:


I created two backtraces with gdb, using the packages
calibre-bin-dbgsym, python2.7-dbg, libqt5webkit5-dbg, and
python-pyqt5.qtwebkit-dbg.

Since /usr/bin/ebook-viewer is not a binary file, but a Python script, I
used the approach:

- start ebook-viewer in a terminal
- get the process id of /usr/bin/python2.7 /usr/bin/ebook-viewer
- start gdb
- attach gdb to the process id
- let the application continue
- load an ebook in the ebook-viewer
- read the ebook, until it crashes
- get a backtrace


Regards,
Hartmut Buhrmester

#867949#10
Date:
2019-02-10 03:57:22 UTC
From:
To:
Hi Hartmut,

Would you please confirm if this issue also affects calibre from
stretch-backports (3.31.0+dfsg-1~bpo9+1) or alternatively from sid
(3.39.1+dfsg-1).

I was not able to reproduce this ebook-viewer failure with 3.39.1+dfsg-1.

Thank you for the backtraces and high-quality bug report! :-D Based on
a quick scan of the backtrace I wonder if this might have been a
libqt5webkit5 or a jquery bug (from the ancient unmaintained bundled
copy of jquery 1.x).  If it's the latter, it's an upstream issue.  I
thought about unbundling it, and switching to Debian's libjs-jquery
3.x, but someone would have had to check if Calibre used obsolete
methods no longer supported in jquery 3.x...  Sadly I didn't have the
time/knowledge necessary to check this in time for Buster/Debian 10.


Cheers,
Nicholas

#867949#17
Date:
2019-09-21 17:54:36 UTC
From:
To:
Hi Hartmut,
[snip]
[snip]
following:

On Stretch/Debian 9: with 3.39.1+dfsg-3~bpo9+1
On Buster/Debian 10: with either 3.39.1+dfsg-3 or 3.48.0+dfsg-1~bpo10+1
On Bullseye/Debian 11: with 3.48.0+dfsg-1

I wasn't able to reproduce it with anything newer than 3.39.1+dfsg-1.

Regards,
Nicholas