Bug 406738 - Okular crashes when I try to open a specific epub file
Summary: Okular crashes when I try to open a specific epub file
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: EPub backend (show other bugs)
Version: 1.7.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 407836 407961 408000 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-21 17:51 UTC by Patrick Silva
Modified: 2019-05-27 22:13 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
epub file that makes okular to crash (1.99 MB, application/epub+zip)
2019-04-21 18:55 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-04-21 17:51:51 UTC
Operating System: Arch Linux 
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.2

Application: Okular (okular), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f939816c800 (LWP 7007))]

Thread 4 (Thread 0x7f9386836700 (LWP 7010)):
#0  0x00007f939b558bac in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007f9386c92254 in  () at /usr/lib/dri/i965_dri.so
#2  0x00007f9386c91f78 in  () at /usr/lib/dri/i965_dri.so
#3  0x00007f939b552a92 in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007f939c203cd3 in clone () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7f93950cd700 (LWP 7009)):
#0  0x00007f9398e5c414 in g_mutex_unlock () at /usr/lib/libglib-2.0.so.0
#1  0x00007f9398eacd3a in g_main_context_check () at /usr/lib/libglib-2.0.so.0
#2  0x00007f9398eae636 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007f9398eae77e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#4  0x00007f939c732cb4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7f9388000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x00007f939c6dba8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f93950ccd70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#6  0x00007f939c51f569 in QThread::exec() (this=this@entry=0x7f939ca22080 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#7  0x00007f939c9a6ba6 in QDBusConnectionManager::run() (this=0x7f939ca22080 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#8  0x00007f939c52096c in QThreadPrivate::start(void*) (arg=0x7f939ca22080 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:361
#9  0x00007f939b552a92 in start_thread () at /usr/lib/libpthread.so.0
#10 0x00007f939c203cd3 in clone () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7f939714e700 (LWP 7008)):
#0  0x00007f939c1f90d1 in poll () at /usr/lib/libc.so.6
#1  0x00007f939b7d7630 in  () at /usr/lib/libxcb.so.1
#2  0x00007f939b7d92db in xcb_wait_for_event () at /usr/lib/libxcb.so.1
#3  0x00007f9397d21989 in QXcbEventQueue::run() (this=0x5597904b5790) at qxcbeventqueue.cpp:228
#4  0x00007f939c52096c in QThreadPrivate::start(void*) (arg=0x5597904b5790) at thread/qthread_unix.cpp:361
#5  0x00007f939b552a92 in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007f939c203cd3 in clone () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7f939816c800 (LWP 7007)):
[KCrash Handler]
#6  0x00007f939465172f in std::__atomic_base<int>::load(std::memory_order) const (__m=std::memory_order_relaxed, this=0x41f289d0468d4412) at /usr/include/c++/8.3.0/bits/atomic_base.h:390
#7  0x00007f939465172f in QAtomicOps<int>::load<int>(std::atomic<int> const&) (_q_value=...) at /usr/include/qt/QtCore/qatomic_cxx11.h:227
#8  0x00007f939465172f in QBasicAtomicInteger<int>::load() const (this=0x41f289d0468d4412) at /usr/include/qt/QtCore/qbasicatomic.h:103
#9  0x00007f939465172f in QtPrivate::RefCount::isShared() const (this=0x41f289d0468d4412) at /usr/include/qt/QtCore/qrefcount.h:101
#10 0x00007f939465172f in QLinkedList<Okular::ObjectRect*>::detach() (this=0x7f939c761768 <QJsonPrivate::Parser::parseString(bool*)+1880>) at /usr/include/qt/QtCore/qlinkedlist.h:106
#11 0x00007f939465172f in QLinkedList<Okular::ObjectRect*>::append(Okular::ObjectRect* const&) (this=this@entry=0x7f939c761768 <QJsonPrivate::Parser::parseString(bool*)+1880>, t=@0x7ffe90feb5c0: 0x55979130e910) at /usr/include/qt/QtCore/qlinkedlist.h:394
#12 0x00007f9394657c2a in Okular::TextDocumentGenerator::loadDocumentWithPassword(QString const&, QVector<Okular::Page*>&, QString const&) (this=<optimized out>, fileName=..., pagesVector=..., password=...) at /usr/include/qt/QtCore/qrect.h:528
#13 0x00007f939463139c in Okular::DocumentPrivate::openDocumentInternal(KPluginMetaData const&, bool, QString const&, QByteArray const&, QString const&) (this=0x5597905a7450, offer=..., isstdin=isstdin@entry=false, docFile=..., filedata=..., password=...) at /usr/src/debug/okular-19.04.0/core/document.cpp:875
#14 0x00007f9394631a22 in Okular::Document::openDocument(QString const&, QUrl const&, QMimeType const&, QString const&) (this=this@entry=0x55979054b2a0, docFile=..., url=..., _mime=..., password=...) at /usr/src/debug/okular-19.04.0/core/document.cpp:2443
#15 0x00007f93947b4815 in Okular::Part::doOpenFile(QMimeType const&, QString const&, bool*) (this=this@entry=0x559790533820, mimeA=..., fileNameToOpenA=..., isCompressedFile=isCompressedFile@entry=0x7ffe90feba37) at /usr/src/debug/okular-19.04.0/part.cpp:1415
#16 0x00007f93947b4c02 in Okular::Part::openFile() (this=0x559790533820) at /usr/src/debug/okular-19.04.0/part.cpp:1549
#17 0x00007f939ddbbb83 in  () at /usr/lib/libKF5Parts.so.5
#18 0x00007f939ddbcb7f in KParts::ReadOnlyPart::openUrl(QUrl const&) () at /usr/lib/libKF5Parts.so.5
#19 0x00007f93947a6c6a in Okular::Part::openUrl(QUrl const&, bool) (this=0x559790533820, _url=..., swapInsteadOfOpening=<optimized out>) at /usr/src/debug/okular-19.04.0/part.cpp:1755
#20 0x000055978f54b96b in Shell::openUrl(QUrl const&, QString const&) (this=0x55979057ad20, url=..., serializedOptions=...) at /usr/src/debug/okular-19.04.0/shell/shell.cpp:280
#21 0x000055978f54d2ed in Shell::fileOpen() (this=0x55979057ad20) at /usr/include/qt/QtCore/qarraydata.h:257
#22 0x000055978f5451f6 in Shell::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _id=<optimized out>, _a=0x7ffe90fec060, _c=QMetaObject::InvokeMetaMethod) at /usr/src/debug/build/shell/okular_autogen/EWIEGA46WW/moc_shell.cpp:183
#23 0x000055978f54530a in Shell::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/build/shell/okular_autogen/EWIEGA46WW/moc_shell.cpp:171
#24 0x00007f939c70782c in QMetaObject::activate(QObject*, int, int, void**) (sender=0x5597908f5d60, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3793
#25 0x00007f939d13a633 in QAction::triggered(bool) (this=this@entry=0x5597908f5d60, _t1=<optimized out>) at .moc/moc_qaction.cpp:380
#26 0x00007f939d13cd1a in QAction::activate(QAction::ActionEvent) (this=0x5597908f5d60, event=<optimized out>) at kernel/qaction.cpp:1166
#27 0x00007f939d2b79cd in QMenuPrivate::activateCausedStack(QVector<QPointer<QWidget> > const&, QAction*, QAction::ActionEvent, bool) (this=this@entry=0x559790ab1900, causedStack=..., action=action@entry=0x5597908f5d60, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1354
#28 0x00007f939d2bf1b2 in QMenuPrivate::activateAction(QAction*, QAction::ActionEvent, bool) (this=this@entry=0x559790ab1900, action=action@entry=0x5597908f5d60, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1431
#29 0x00007f939d2c01dc in QMenu::mouseReleaseEvent(QMouseEvent*) (this=<optimized out>, e=0x7ffe90fec720) at widgets/qmenu.cpp:2924
#30 0x00007f939d181c28 in QWidget::event(QEvent*) (this=this@entry=0x559790ad5940, event=event@entry=0x7ffe90fec720) at kernel/qwidget.cpp:8955
#31 0x00007f939d2c288c in QMenu::event(QEvent*) (this=0x559790ad5940, e=0x7ffe90fec720) at widgets/qmenu.cpp:3046
#32 0x00007f939d140e24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x55979048fec0, receiver=receiver@entry=0x559790ad5940, e=e@entry=0x7ffe90fec720) at kernel/qapplication.cpp:3736
#33 0x00007f939d148839 in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x559790ad5940, e=0x7ffe90fec720) at kernel/qapplication.cpp:3197
#34 0x00007f939c6dcdf9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x559790ad5940, event=0x7ffe90fec720) at ../../include/QtCore/5.12.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:322
#35 0x00007f939d147b18 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) (receiver=0x559790ad5940, event=event@entry=0x7ffe90fec720, alienWidget=0x0, nativeWidget=0x559790ad5940, buttonDown=buttonDown@entry=0x7f939d655330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2683
#36 0x00007f939d19d8ab in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=0x55979068c430, event=0x7ffe90fecba0) at /usr/include/c++/8.2.1/bits/atomic_base.h:390
#37 0x00007f939d1a0047 in QWidgetWindow::event(QEvent*) (event=0x7ffe90fecba0, this=0x55979068c430) at kernel/qwidgetwindow.cpp:281
#38 0x00007f939d1a0047 in QWidgetWindow::event(QEvent*) (this=0x55979068c430, event=0x7ffe90fecba0) at kernel/qwidgetwindow.cpp:224
#39 0x00007f939d140e24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x55979048fec0, receiver=receiver@entry=0x55979068c430, e=e@entry=0x7ffe90fecba0) at kernel/qapplication.cpp:3736
#40 0x00007f939d1485f1 in QApplication::notify(QObject*, QEvent*) (this=0x7ffe90fed040, receiver=0x55979068c430, e=0x7ffe90fecba0) at kernel/qapplication.cpp:3483
#41 0x00007f939c6dcdf9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55979068c430, event=0x7ffe90fecba0) at ../../include/QtCore/5.12.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:322
#42 0x00007f939cb45aae in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0x559790b46ed0) at kernel/qguiapplication.cpp:2102
#43 0x00007f939cb46f16 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (e=e@entry=0x559790b46ed0) at kernel/qguiapplication.cpp:1837
#44 0x00007f939cb2075c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1071
#45 0x00007f9397d229ac in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#46 0x00007f9398eac7bf in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#47 0x00007f9398eae739 in  () at /usr/lib/libglib-2.0.so.0
#48 0x00007f9398eae77e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#49 0x00007f939c732c99 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5597904f8540, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#50 0x00007f939c6dba8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffe90fecf60, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#51 0x00007f939c6e3de6 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#52 0x000055978f54377d in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/okular-19.04.0/shell/main.cpp:87
[Inferior 1 (process 7007) detached]
Comment 1 Albert Astals Cid 2019-04-21 18:52:13 UTC
Can we have the file?
Comment 2 Patrick Silva 2019-04-21 18:55:42 UTC
Created attachment 119547 [details]
epub file that makes okular to crash
Comment 3 Albert Astals Cid 2019-04-21 22:20:45 UTC
yep
Comment 4 Albert Astals Cid 2019-04-21 22:43:52 UTC
For future people investigating, there's something weird going on in the
if(dom.setContent(htmlContent)) {
branch of Epub::Converter::convert
if you comment that whole branch out it works out fine :/
Comment 5 kde 2019-04-29 16:39:51 UTC
It's crashing for me too since the latest TW upgrade
Operating System: openSUSE Tumbleweed 20190426
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.3
Kernel Version: 5.0.9-1-default
OS Type: 64-bit
Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor
Memory: 31,4 GiB

What's interesting is that the files in question used to just throw an error before, now they cause Okular to crash (still valid epubs of course).
Comment 6 Albert Astals Cid 2019-05-22 22:24:05 UTC
*** Bug 407836 has been marked as a duplicate of this bug. ***
Comment 7 Albert Astals Cid 2019-05-22 22:25:19 UTC
Git commit 9f98c010691ed73d11c83a1694823aba60b12e32 by Albert Astals Cid, on behalf of Stefan Brüns.
Committed on 22/05/2019 at 22:24.
Pushed by aacid into branch 'Applications/19.04'.

[EPubGenerator] Avoid crashes due to bogus wrapping of content in table

Summary:
QTextDocument chokes badly when a some documents are wrapped inside
a table, returning e.g. a pagecount of -41292 afterwards.

On the downside, this removes any padding from the page. On the upside,
it removes any padding from the page.
Related: bug 407140, bug 406116

Reviewers: #okular

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20949

M  +1    -7    generators/epub/converter.cpp

https://commits.kde.org/okular/9f98c010691ed73d11c83a1694823aba60b12e32
Comment 8 Albert Astals Cid 2019-05-27 22:12:00 UTC
*** Bug 407961 has been marked as a duplicate of this bug. ***
Comment 9 Albert Astals Cid 2019-05-27 22:13:42 UTC
*** Bug 408000 has been marked as a duplicate of this bug. ***