Bug 396137 - Okular hangs when scrolling fast on both pdf and djvu documents
Summary: Okular hangs when scrolling fast on both pdf and djvu documents
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.4.2
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 403643 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-03 20:27 UTC by Max Sydorenko
Modified: 2020-02-23 05:21 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sydorenko 2018-07-03 20:27:51 UTC
Fast scrolling through large pdf or djvu document sometimes causes okular to fail to display content of the pages from some point. It just sits consuming 100% CPU time, pages content never displayed (empty white pages are displayed with okular logo in the left upper corner). Meanwhile interface remains responsive and pages, rendered before the hang occured, are still displayed when you scroll back. Okular does not actually crash, it just hangs, endlessly running at 100% load.
Most often can be reproduced when holding PgDn(PgUp) continuosly for some time so okular is forced to go very fast, skipping pages. Sometimes it occurs when you type in some page number from the middle of the document and go directly. 
This bug is much easier to reproduce when processor is heavily loaded in background (i.e. building stuff). In that case it could be reproduced almost every time with any large document. When system is idling it still happens sometimes but you have to try for a while.
Comment 1 Albert Astals Cid 2018-07-03 22:34:15 UTC
Please attach one of the documents you're using to reproduce this.

Also it would be great if you could do this, while you have caused okular to be looping at 100% CPU open a terminal and type

gdb attach `pidof okular`

if it complains it can't you will need to run that as root (i.e use sudo or su to become root)

Once you're inside the gdb command line do type
bt
continue
press Ctrl+C
bt
continue
press Ctrl+C
.... do this a few times ....

And paste here the output of the bt commands, this may help finding out where it is hanging.
Comment 2 Max Sydorenko 2018-07-04 08:27:50 UTC
I can not attach directly document I used to reproduce this bug because of size limitations, but it is freely available for download: 
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/5-chipset-3400-chipset-datasheet.pdf

Backtrace results (unfortunately most of the debug info and symbols are stripped, but may be it is possible to figure out something from that. I will be able to build debug version of Okular later)

Attaching to process 26698
[New LWP 26699]
[New LWP 26700]
[New LWP 26703]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007f254c6fa420 in ?? () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x00007f254c6fa420 in ?? () from /usr/lib/libglib-2.0.so.0
#1  0x00007f254c6fc983 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#2  0x00007f254c6fd44e in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#5  0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#6  0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#7  0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#8  0x000056368e0da685 in ?? ()
#9  0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#10 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f25526250ca in QObjectPrivate::setParent_helper(QObject*) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007f25526250ca in QObjectPrivate::setParent_helper(QObject*) () from /usr/lib/libQt5Core.so.5
#1  0x00007f25526259cb in QObject::~QObject() () from /usr/lib/libQt5Core.so.5
#2  0x00007f255262ae41 in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f255262acd0 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f255261f38b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#5  0x00007f255388ea74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#6  0x00007f2553896341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#7  0x00007f25525f4cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#8  0x00007f255264740a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#9  0x00007f2552647cca in ?? () from /usr/lib/libQt5Core.so.5
#10 0x00007f254c6fd368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#11 0x00007f254c6fd5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#12 0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#13 0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#14 0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#15 0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#16 0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#17 0x000056368e0da685 in ?? ()
#18 0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#19 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f25524b3388 in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007f25524b3388 in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) () from /usr/lib/libQt5Core.so.5
#1  0x00007f255262b2f3 in ?? () from /usr/lib/libQt5Core.so.5
#2  0x00007f255262b474 in QTimer::singleShotImpl(int, Qt::TimerType, QObject const*, QtPrivate::QSlotObjectBase*) () from /usr/lib/libQt5Core.so.5
#3  0x00007f25384359a4 in Okular::Generator::generatePixmap(Okular::PixmapRequest*) () from /usr/lib/libOkular5Core.so.9
#4  0x00007f255262acc7 in ?? () from /usr/lib/libQt5Core.so.5
#5  0x00007f255261f38b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#6  0x00007f255388ea74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#7  0x00007f2553896341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#8  0x00007f25525f4cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#9  0x00007f255264740a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#10 0x00007f2552647cca in ?? () from /usr/lib/libQt5Core.so.5
#11 0x00007f254c6fd368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#12 0x00007f254c6fd5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#14 0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#15 0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#16 0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#17 0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#18 0x000056368e0da685 in ?? ()
#19 0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#20 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f254c6fa3bf in ?? () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x00007f254c6fa3bf in ?? () from /usr/lib/libglib-2.0.so.0
#1  0x00007f254c6fc983 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#2  0x00007f254c6fd44e in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#5  0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#6  0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#7  0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#8  0x000056368e0da685 in ?? ()
#9  0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#10 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C  
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f2552646bef in QTimerInfoList::timerInsert(QTimerInfo*) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007f2552646bef in QTimerInfoList::timerInsert(QTimerInfo*) () from /usr/lib/libQt5Core.so.5
#1  0x00007f25525f25e4 in QAbstractEventDispatcher::registerTimer(int, Qt::TimerType, QObject*) () from /usr/lib/libQt5Core.so.5
#2  0x00007f255261fee1 in QObject::startTimer(int, Qt::TimerType) () from /usr/lib/libQt5Core.so.5
#3  0x00007f255262b31b in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007f255262b474 in QTimer::singleShotImpl(int, Qt::TimerType, QObject const*, QtPrivate::QSlotObjectBase*) () from /usr/lib/libQt5Core.so.5
#5  0x00007f25384359a4 in Okular::Generator::generatePixmap(Okular::PixmapRequest*) () from /usr/lib/libOkular5Core.so.9
#6  0x00007f255262acc7 in ?? () from /usr/lib/libQt5Core.so.5
#7  0x00007f255261f38b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#8  0x00007f255388ea74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#9  0x00007f2553896341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007f25525f4cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#11 0x00007f255264740a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#12 0x00007f2552647cca in ?? () from /usr/lib/libQt5Core.so.5
#13 0x00007f254c6fd368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#14 0x00007f254c6fd5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#15 0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#16 0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#17 0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#18 0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#19 0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#20 0x000056368e0da685 in ?? ()
#21 0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#22 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f25538e0880 in ?? () from /usr/lib/libQt5Widgets.so.5
(gdb) bt
#0  0x00007f25538e0880 in ?? () from /usr/lib/libQt5Widgets.so.5
#1  0x00007f2553897af6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#2  0x00007f25525f4cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#3  0x00007f255264740a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#4  0x00007f2552647cca in ?? () from /usr/lib/libQt5Core.so.5
#5  0x00007f254c6fd368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#6  0x00007f254c6fd5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#7  0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#8  0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#9  0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#10 0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#11 0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#12 0x000056368e0da685 in ?? ()
#13 0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#14 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007f2552646bef in QTimerInfoList::timerInsert(QTimerInfo*) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007f2552646bef in QTimerInfoList::timerInsert(QTimerInfo*) () from /usr/lib/libQt5Core.so.5
#1  0x00007f255264713c in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#2  0x00007f2552647cca in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007f254c6fd368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4  0x00007f254c6fd5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#5  0x00007f254c6fd63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#6  0x00007f2552648039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#7  0x00007f2546a49722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#8  0x00007f25525f394c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#9  0x00007f25525fbc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#10 0x000056368e0da685 in ?? ()
#11 0x00007f2551c6106b in __libc_start_main () from /usr/lib/libc.so.6
#12 0x000056368e0dbd4a in _start ()
(gdb) continue
Continuing.
Comment 3 Max Sydorenko 2018-07-04 09:18:25 UTC
More bt with debug symbols this time:

Attaching to process 8777
[New LWP 8778]
[New LWP 8779]
[New LWP 8781]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007ff1b89d70ba in ?? () from /usr/lib/libKF5XmlGui.so.5
(gdb) bt
#0  0x00007ff1b89d70ba in ?? () from /usr/lib/libKF5XmlGui.so.5
#1  0x00007ff1b5e6689b in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#2  0x00007ff1b7100ab2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#3  0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#4  0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#5  0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#7  0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#8  0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#11 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#12 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#13 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#14 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1b559dea9 in poll () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ff1b559dea9 in poll () from /usr/lib/libc.so.6
#1  0x00007ff1aff6f523 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#5  0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#7  0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff19c100413 in Okular::PixmapRequest::isTile (this=this@entry=0x559a30d53d10) at /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp:649
649     /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp: Немає такого файла або каталогу.
(gdb) bt
#0  0x00007ff19c100413 in Okular::PixmapRequest::isTile (this=this@entry=0x559a30d53d10) at /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp:649
#1  0x00007ff19c102159 in Okular::Generator::generatePixmap (this=0x559a3072a580, request=0x559a30d53d10) at /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp:269
#2  0x00007ff1b5e9ccc7 in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007ff1b5e9138b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1b7100a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#5  0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#6  0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#7  0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#8  0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#9  0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#10 0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#11 0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#12 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#13 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#14 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#15 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#16 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1b5598fe5 in _xstat () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ff1b5598fe5 in _xstat () from /usr/lib/libc.so.6
#1  0x00007ff1b55660c1 in __tzfile_read () from /usr/lib/libc.so.6
#2  0x00007ff1b5565c51 in tzset_internal () from /usr/lib/libc.so.6
#3  0x00007ff1b5565d9d in tzset () from /usr/lib/libc.so.6
#4  0x00007ff1b5cf2135 in ?? () from /usr/lib/libQt5Core.so.5
#5  0x00007ff1b5cf4a1a in QDateTime::setMSecsSinceEpoch(long long) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b5cf633d in QDateTime::fromMSecsSinceEpoch(long long, Qt::TimeSpec, int) () from /usr/lib/libQt5Core.so.5
#7  0x00007ff1b5cf671e in QDateTime::currentDateTime() () from /usr/lib/libQt5Core.so.5
#8  0x00007ff1b5cf67c2 in QTime::currentTime() () from /usr/lib/libQt5Core.so.5
#9  0x00007ff19c0e353e in Okular::DocumentPrivate::getFreeMemory (freeSwap=freeSwap@entry=0x0, this=0x0) at /home/sydorenko/abs/okular-git/src/okular/core/document.cpp:436
#10 0x00007ff19c0e370e in Okular::DocumentPrivate::calculateMemoryToFree (this=this@entry=0x559a2ffc2a00) at /home/sydorenko/abs/okular-git/src/okular/core/document.cpp:235
#11 0x00007ff19c0e3c8c in Okular::DocumentPrivate::sendGeneratorPixmapRequest (this=0x559a2ffc2a00) at /home/sydorenko/abs/okular-git/src/okular/core/document.cpp:1285
#12 0x00007ff1b5e90afc in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#13 0x00007ff1b5e9cd0c in ?? () from /usr/lib/libQt5Core.so.5
#14 0x00007ff1b5e9138b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#15 0x00007ff1b7100a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#17 0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#18 0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#19 0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#20 0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#21 0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#22 0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#23 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#24 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#25 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#26 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#27 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1b55335c9 in malloc () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ff1b55335c9 in malloc () from /usr/lib/libc.so.6
#1  0x00007ff1b58fc159 in operator new (sz=112) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/new_op.cc:50
#2  0x00007ff1b5e97d83 in QObject::QObject(QObject*) () from /usr/lib/libQt5Core.so.5
#3  0x00007ff1b5e9d2d3 in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1b5e9d474 in QTimer::singleShotImpl(int, Qt::TimerType, QObject const*, QtPrivate::QSlotObjectBase*) () from /usr/lib/libQt5Core.so.5
#5  0x00007ff19c102593 in QTimer::singleShot<int, Okular::Generator::generatePixmap(Okular::PixmapRequest*)::<lambda()> > (interval=0, timerType=Qt::PreciseTimer, slot=..., context=0x559a3072a580)
    at /usr/include/c++/8.1.1/bits/move.h:99
#6  QTimer::singleShot<int, Okular::Generator::generatePixmap(Okular::PixmapRequest*)::<lambda()> > (slot=..., context=0x559a3072a580, interval=0) at /usr/include/qt/QtCore/qtimer.h:140
#7  Okular::Generator::generatePixmap (this=0x559a3072a580, request=0x559a30d53d10) at /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp:278
#8  0x00007ff1b5e9ccc7 in ?? () from /usr/lib/libQt5Core.so.5
#9  0x00007ff1b5e9138b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#10 0x00007ff1b7100a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#11 0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#12 0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#13 0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#14 0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#15 0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#16 0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#17 0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#18 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#19 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#20 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#22 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ffe19da9911 in clock_gettime ()
(gdb) bt
#0  0x00007ffe19da9911 in clock_gettime ()
#1  0x00007ff1b55b5fb6 in clock_gettime () from /usr/lib/libc.so.6
#2  0x00007ff1b5eb9962 in ?? () from /usr/lib/libQt5Core.so.5
#3  0x00007ff1b5eb814a in QTimerInfoList::updateCurrentTime() () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1b5eb8c9b in QTimerInfoList::registerTimer(int, int, Qt::TimerType, QObject*) () from /usr/lib/libQt5Core.so.5
#5  0x00007ff1b5e645e4 in QAbstractEventDispatcher::registerTimer(int, Qt::TimerType, QObject*) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b5e91ee1 in QObject::startTimer(int, Qt::TimerType) () from /usr/lib/libQt5Core.so.5
#7  0x00007ff1b5e9d615 in QTimer::singleShot(int, Qt::TimerType, QObject const*, char const*) () from /usr/lib/libQt5Core.so.5
#8  0x00007ff19c0e4416 in Okular::DocumentPrivate::sendGeneratorPixmapRequest (this=0x559a2ffc2a00) at /home/sydorenko/abs/okular-git/src/okular/core/document.cpp:1472
#9  0x00007ff1b5e90afc in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#10 0x00007ff1b5e9cd0c in ?? () from /usr/lib/libQt5Core.so.5
#11 0x00007ff1b5e9138b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#12 0x00007ff1b7100a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#13 0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#15 0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#16 0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#17 0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#22 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#23 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#24 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C      
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1b5e668c7 in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007ff1b5e668c7 in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#1  0x00007ff1b7100ab2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#2  0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#3  0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#5  0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#7  0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#8  0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#9  0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#10 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#11 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#12 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#13 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff19c0b19d0 in operator new(unsigned long)@plt () from /usr/lib/libOkular5Core.so.9
(gdb) bt
#0  0x00007ff19c0b19d0 in operator new(unsigned long)@plt () from /usr/lib/libOkular5Core.so.9
#1  0x00007ff19c10256a in QTimer::singleShot<int, Okular::Generator::generatePixmap(Okular::PixmapRequest*)::<lambda()> > (interval=0, timerType=Qt::PreciseTimer, slot=..., context=0x559a3072a580)
    at /usr/include/qt/QtCore/qtimer.h:209
#2  QTimer::singleShot<int, Okular::Generator::generatePixmap(Okular::PixmapRequest*)::<lambda()> > (slot=..., context=0x559a3072a580, interval=0) at /usr/include/qt/QtCore/qtimer.h:140
#3  Okular::Generator::generatePixmap (this=0x559a3072a580, request=0x559a30d53d10) at /home/sydorenko/abs/okular-git/src/okular/core/generator.cpp:278
#4  0x00007ff1b5e9ccc7 in ?? () from /usr/lib/libQt5Core.so.5
#5  0x00007ff1b5e9138b in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b7100a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#7  0x00007ff1b7108341 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#8  0x00007ff1b5e66cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#9  0x00007ff1b5eb940a in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#10 0x00007ff1b5eb9cca in ?? () from /usr/lib/libQt5Core.so.5
#11 0x00007ff1aff6f368 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#12 0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#14 0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#15 0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#16 0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#17 0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#18 0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1aff40f39 in g_ptr_array_remove_range () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x00007ff1aff40f39 in g_ptr_array_remove_range () from /usr/lib/libglib-2.0.so.0
#1  0x00007ff1aff410b8 in g_ptr_array_set_size () from /usr/lib/libglib-2.0.so.0
#2  0x00007ff1aff6f320 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#3  0x00007ff1aff6f5b1 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#5  0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#7  0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#8  0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#9  0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) continue
Continuing.
^C
Thread 1 "okular" received signal SIGINT, Interrupt.
0x00007ff1aff6eda3 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x00007ff1aff6eda3 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#1  0x00007ff1aff6f4c6 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ff1aff6f63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007ff1b5eba039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#4  0x00007ff1aa2bb722 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#5  0x00007ff1b5e6594c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6  0x00007ff1b5e6dc46 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#7  0x0000559a2e66372d in main (argc=<optimized out>, argv=<optimized out>) at /home/sydorenko/abs/okular-git/src/okular/shell/main.cpp:85
(gdb) q
Comment 4 Christoph Feck 2018-07-31 01:25:55 UTC
Thanks for the update; changing status.
Comment 5 Oliver Sander 2019-09-04 13:10:47 UTC
This happens to me quite frequently with all sorts of pdf documents.  My Okular version is compiled directly from the sources.  Backtraces look very similar to what has already been posted here. Any ideas about what I could do to debug this?
Comment 6 Albert Astals Cid 2019-09-05 19:37:48 UTC
Well, by reading the backtraces it seems you ended up in the

    if ( request->asynchronous() && hasFeature( Threaded ) )
    {
        if ( d->textPageGenerationThread()->isFinished() && !canGenerateTextPage() )
        {
            // It can happen that the text generation has already finished but
            // mTextPageReady is still false because textpageGenerationFinished
            // didn't have time to run, if so queue ourselves
            QTimer::singleShot(0, this, [this, request] { generatePixmap(request); });



situation but it never gets out of it.

Figure out why that happens
Comment 7 Oliver Sander 2019-09-06 07:04:30 UTC
Okay, thanks.  I've added a bit of screen output around these lines to see whether your conjecture is true.  Unfortunately I cannot deliberately trigger the bug -- we'll have to wait until it comes out of hiding again.
Comment 8 Oliver Sander 2019-09-18 11:36:13 UTC
The problem just happened to me again, and from my extra debugging output I can now confirm that Albert's conjecture in Comment 6 is correct.  No idea as to *why* that happens, though.
Comment 9 Albert Astals Cid 2020-01-26 21:48:04 UTC
*** Bug 403643 has been marked as a duplicate of this bug. ***
Comment 10 postix 2020-01-26 21:59:54 UTC
(In reply to Albert Astals Cid from comment #9)
> *** Bug 403643 has been marked as a duplicate of this bug. ***
Comment 11 Tobias Deiminger 2020-01-30 08:59:29 UTC
Git commit 593803b0a1d98eba64aac38316aa521130b4ae78 by Tobias Deiminger.
Committed on 30/01/2020 at 08:15.
Pushed by aacid into branch 'release/19.12'.

Fix render stop and high load due to timing issue

Text generation is connected to pixmap generation thread started signal.
However the signal may have been emitted faster than the connect could took place,
and because started is fired only once, the connected lambda never got executed.

generatePixmap tried to sync up with that never happening text generation anyway
by means of scheduling itself. This lead to a infinite loop via a no more sleeping QEventLoop.

Fixed by moving the connect in front of starting the thread.
Related: bug 396087, bug 403643

M  +2    -2    core/generator.cpp

https://invent.kde.org/kde/okular/commit/593803b0a1d98eba64aac38316aa521130b4ae78
Comment 12 antonini44354 2020-02-23 05:21:29 UTC
I think I discovered a cause for this, whuch is related to cgroups and limiting Okular RAM. 

My version of Okular is 1.7.2. My PC has 4 GB of RAM. I was often running into slowdowns because of thrashing very often. So I set up a few cgroups in order to actually take control of RAM. I put in cgroups preety much every program that used more than 100 MB. Okular often went over that much RAM because I viewed several PDF tabs. I set up cgroups according to https://askubuntu.com/questions/836469/install-cgconfig-in-ubuntu-16-04. 

I was tinkering with the cgroups and I settled for this cgroup config on Okular like this in /etc/cgconfig:

group main/documents {
    memory {
        memory.limit_in_bytes = 72000000;
        memory.soft_limit_in_bytes = 4000000;
    }
}

How did I find it out? Yesterday, I set up a Kubuntu VM. I was also testing Okular (Kubuntu came with Okular 1.7.3, I'm aware this bug wasn't patched on it) to try to make the bug happen. I copied to the VM a large PDF with hundreds of pages. I scrolled it for several minutes, page view set to fit width. I did it franticallu almost, but nothing happened. Surprisingly, Okular didn't slow down,  nor did this bug triggered.

Today I disabled the cgroup on Okular. I opened the same PDF, and I could not possibly trigger the bug either. I also noticed Okular beheves preety smoothly. When the cgroup was enabled, PDFs rendered noticeably slowly. Obviously!

I just found Okular memory  settings. I set it to run using as little as needed. 

Thanks Tobias Deiminger for patching out the bug in newer versions. 

I hope that this helps with anything.