Bug 318048 - okular hangs up for about 2 minutes while loading a new epub
Summary: okular hangs up for about 2 minutes while loading a new epub
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: EPub backend (show other bugs)
Version: 0.16.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-08 16:28 UTC by pritam ghanghas
Modified: 2013-06-23 16:43 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pritam ghanghas 2013-04-08 16:28:32 UTC
okular hangs up for about 2 minutes while loading a new epub. Infact the whole plasma workspace hangs up for those initial 1-2 minutes. I can't even move the mouse. After that it works fine.

Reproducible: Always

Steps to Reproduce:
1. Load any epub book. I have only tested with sufficiently large books 100+ pages
2. see that the reader hangs up for about 1-2mintues.
3.
Actual Results:  
reader hangs up for some time

Expected Results:  
the document should load in a reasonable time like 2-10seconds and ui should remain responsive.
Comment 1 Albert Astals Cid 2013-04-08 18:23:16 UTC
I can't see how it would result in a plasma freeze. We'll need one of those big files to see what's going on.
Comment 2 Christoph Feck 2013-04-16 03:32:39 UTC
If you can provide the information requested in comment #1, please add it.
Comment 3 Christoph Feck 2013-04-23 17:22:30 UTC
To further investigate this issue, KDE developers need the information requested in comment #1. If you can provide it, or need help with finding that information, please add a comment.
Comment 4 pritam ghanghas 2013-04-23 20:41:35 UTC
Any epub will do. You can try this one, its free
http://www.urbandharma.org/epub/mindfulness.epub
Comment 5 Yuri Chornoivan 2013-04-23 20:51:34 UTC
(In reply to comment #4)
> Any epub will do. You can try this one, its free
> http://www.urbandharma.org/epub/mindfulness.epub

H-m-m, works very fast and fine here (Okular 0.16.60, KDE 4.8.5, 32-bits, Core2 Duo E4700, 4GB of RAM, Okular rapidly opens the file).
Comment 6 Rex Dieter 2013-04-24 14:43:07 UTC
reported symptoms not reproducible here either (okular 0.16.2/kde-4.10.2, fedora 18, x86_64)
Comment 7 Albert Astals Cid 2013-04-24 18:43:34 UTC
Can't reproduce either.

Can you please do in a terminal
gdb okular
run
open the file you say takes a lot in okular
when you've waited say one minute and okular still has not loaded the file, switch to the terminal were you started okular, press Ctrl+c, then type bt and attach the result of bt here
Comment 8 pritam ghanghas 2013-04-25 05:53:11 UTC
I tried gdb, first time it was stuck opening, I couldn't go back to terminal to actually stop it midway, plasma becomes responsive only after the epub has opened. After several tries I think I was able to get it to stop in the busy phase, here is the backtrace. I will try installing some other desktop environment and try then if I can reproduce it. I dont have debug symbols installed though.

#0  0xb6fa4a85 in QImage::pixel(int, int) const () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#1  0xb2ed5c5c in Okular::Utils::imageBoundingBox(QImage const*) () from /usr/lib/libokularcore.so.2abi1
#2  0xb2ebb64c in Okular::Generator::generatePixmap(Okular::PixmapRequest*) ()
   from /usr/lib/libokularcore.so.2abi1
#3  0x00000000 in ?? ()


There was one more strange thing. Once I have opened a epub successfully, If i close and open the same epub again and again there is no wait/busy period, its almost immediate. Even when I close okular in between. Its something that happens first time I open that epub after a cold start. If I open diffrent epubs every time, I can see the problem.
Comment 9 Albert Astals Cid 2013-04-25 17:43:51 UTC
Sadly that backtrace doesn't really help much.

I guess there's not much more we can do unless you know how to compile/debug software  :/
Comment 10 pritam ghanghas 2013-06-12 21:30:22 UTC
I noticed something today that may help you reproduce the problem. This happens only when perfomance configuration is set to greedy. I set it to greedy because it handles pdfs very well in this configuration. But somehow in case of epubs it goes for a spin. Epub works fine if I reset it back to normal or aggressive.
Comment 11 Albert Astals Cid 2013-06-23 16:37:24 UTC
Greedy doesn't work well with non threaded generators
Comment 12 Albert Astals Cid 2013-06-23 16:43:48 UTC
Git commit 15eb104d75e3cd6cc22b958c994773af53f78ec0 by Albert Astals Cid.
Committed on 23/06/2013 at 16:42.
Pushed by aacid into branch 'KDE/4.10'.

Don't preload pages if the generator is not Threaded
FIXED-IN: 4.10.5

M  +8    -2    core/document.cpp

http://commits.kde.org/okular/15eb104d75e3cd6cc22b958c994773af53f78ec0