evince hangs eating CPU when rendering a pdf page

Bug #38674 reported by Kevin Fischer
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppler
Fix Released
Medium
poppler (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

If you go to http://www.mises.org/etexts/cwik-dissertation.pdf and download the pdf, you can check if the problem exists for you too.

This pdf works under Win XP and Adobe Acrobat. I'm not sure what is causing the failure with gpdf but it fails with evince as well. gpdf's problem is particularly bad as it hangs.

To replicate:
1. Open pdf
2. Scroll down to page 13-14 (the sideways page is the one that does it)

Revision history for this message
Sitsofe Wheeler (sitsofe) wrote :

I believe gpdf has been depercated in favour of evince but looking at page 13 on my machine causes evince to go into a CPU hogging loop:

Steps to reproduce:
1. Download http://www.mises.org/etexts/cwik-dissertation.pdf
2. Open the downloaded file in evince .
3. Type 13 in the page box at the top of the window and press return.

Expected results:
Page 13 to be displayed after a few seconds.

Actual results:
Evince goes to page 13 but continues to display it Loading... message while chewing up all the CPU it can get for minutes on end.

Additional information:
acroread displays the page incrementally and after 5 seconds the entire page is finished.

Revision history for this message
Sitsofe Wheeler (sitsofe) wrote :

I forgot to mention my tests were on:
evince 0.5.2-0ubuntu1
libpoppler1 0.5.1-0ubuntu5
libpoppler1-glib 0.5.1-0ubuntu5
poppler-utils 0.5.1-0ubuntu5

Revision history for this message
Corey Burger (corey.burger) wrote :

Sorry, I cannot replicate on Dapper with the same versions of Evince. Can you get a backtrace on evince?

Changed in evince:
status: Unconfirmed → Needs Info
Revision history for this message
Sitsofe Wheeler (sitsofe) wrote :
Download full text (3.6 KiB)

Here's a backtrace but evine doesn't appear to be "stuck" in one function and consequently continuing and then getting another backtrace yields something different.

Thread 2 (Thread -1230013520 (LWP 8751)):
#0 0xb79978b9 in Parser::getObj () from /usr/lib/libpoppler.so.1
#1 0xb79a31a2 in XRef::fetch () from /usr/lib/libpoppler.so.1
#2 0xb79935d8 in Object::fetch () from /usr/lib/libpoppler.so.1
#3 0xb7945de5 in Dict::lookup () from /usr/lib/libpoppler.so.1
#4 0xb7950117 in GfxResources::lookupGState () from /usr/lib/libpoppler.so.1
#5 0xb79501c2 in Gfx::opSetExtGState () from /usr/lib/libpoppler.so.1
#6 0xb794e7a4 in Gfx::execOp () from /usr/lib/libpoppler.so.1
#7 0xb794ea57 in Gfx::go () from /usr/lib/libpoppler.so.1
#8 0xb794f675 in Gfx::display () from /usr/lib/libpoppler.so.1
#9 0xb7953136 in Gfx::doForm1 () from /usr/lib/libpoppler.so.1
#10 0xb7954922 in Gfx::doTilingPatternFill () from /usr/lib/libpoppler.so.1
#11 0xb795902f in Gfx::doPatternFill () from /usr/lib/libpoppler.so.1
#12 0xb79593ec in Gfx::opFill () from /usr/lib/libpoppler.so.1
#13 0xb794e7a4 in Gfx::execOp () from /usr/lib/libpoppler.so.1
#14 0xb794ea57 in Gfx::go () from /usr/lib/libpoppler.so.1
#15 0xb794f675 in Gfx::display () from /usr/lib/libpoppler.so.1
#16 0xb7996e10 in Page::displaySlice () from /usr/lib/libpoppler.so.1
#17 0xb7a3190a in poppler_page_render_to_pixbuf () from /usr/lib/libpoppler-glib.so.1
#18 0x0809119c in pdf_document_get_type ()
#19 0x0808f494 in ev_document_render_pixbuf ()
#20 0x0806490f in ev_job_render_run ()
---Type <return> to continue, or q <return> to quit---
#21 0x0806338b in ev_document_types_add_filters ()
#22 0x08063490 in ev_document_types_add_filters ()
#23 0xb6e5d472 in g_static_private_free () from /usr/lib/libglib-2.0.so.0
#24 0xb7a3c341 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#25 0xb77c54ee in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread -1228515648 (LWP 8749)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb77bb8c4 in poll () from /lib/tls/i686/cmov/libc.so.6
#2 0xb6e446e8 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#3 0xb6e44bb8 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#4 0xb735d3c6 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5 0x0807faab in main ()
#0 0xffffe410 in __kernel_vsyscall ()

Valgrind did report the following though:
==8940==
==8940== Thread 2:
==8940== Conditional jump or move depends on uninitialised value(s)
==8940== at 0x469BDFD: Splash::strokeNarrow(SplashXPath*) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x469C775: Splash::stroke(SplashPath*) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x45FD073: SplashOutputDev::stroke(GfxState*) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x461354D: Gfx::opStroke(Object*, int) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x46117A3: Gfx::execOp(Object*, Object*, int) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x4611A56: Gfx::go(int) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x4612674: Gfx::display(Object*, int) (in /usr/lib/libpoppler.so.1.0.0)
==8940== by 0x4659E0F: Page::displaySlice(OutputDev*, double, d...

Read more...

Changed in evince:
status: Needs Info → Unconfirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

It might be interesting to get a backtrace of evince with a debug build of poppler. Can you do that? http://wiki.ubuntu.com/DebuggingProgramCrash has information on that.

Changed in evince:
assignee: nobody → desktop-bugs
status: Unconfirmed → Needs Info
Revision history for this message
Sitsofe Wheeler (sitsofe) wrote : I can't give you a debug backtrace Daniel,

Daniel,

I'm sorry but I can't give you a debug symbol backtrace unless someone provides me with the appropriate dbg packages. My dapper system as it stands simply doesn't have the room for a toolchain (it's a test setup on a small 4Gbyte disk that is practically full already) so I can't build them for myself. (If only Ubuntu had dbg packages for everything like Fedora does...) Sorry...

Kevin:
Any chance that you could rebuild the packages with the appropriate debug symbols and reproduce the crash?

Revision history for this message
Kevin Fischer (fisch) wrote : Re: pdf file causes gpdf to crash

Alas, I have no idea how to do that. Perhaps if you walk me through it?

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've forwarded the issue upstream: https://bugs.freedesktop.org/show_bug.cgi?id=6680

Changed in evince:
status: Needs Info → Confirmed
Revision history for this message
Sitsofe Wheeler (sitsofe) wrote :

(still here in edgy:
evince 0.6.1-0ubuntu1
libpoppler1 0.5.4-0ubuntu4
libpoppler1-gl 0.5.4-0ubuntu4
poppler-utils 0.5.4-0ubuntu4
)

Changed in gpdf:
status: Unconfirmed → Rejected
Revision history for this message
Sitsofe Wheeler (sitsofe) wrote :

Still here:

Version Information:
Ubuntu Feisty (Herd 5)
evince 0.7.2-0ubuntu2
libpoppler1 0.5.4-0ubuntu5
libpoppler1-glib
poppler-utils

Revision history for this message
In , Sven Arvidsson (sa) wrote :

[ From http://bugs.debian.org/443547 ]

The attached PDF is extremely slow to render in Evince, using Poppler 0.6.2 (cairo backend), it seems to be equally slow in Xpdf.

"cairo context error: NULL pointer" is printed on the terminal.

Revision history for this message
In , Sven Arvidsson (sa) wrote :

Created an attachment (id=12938)
slow document

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

This is because the document has a Pattern which makes it slow down a lot, i though we had already a "Patterns are slow" bug, but as i can't find it i'll reuse this one.

See http://bugs.kde.org/show_bug.cgi?id=99486 for more info.

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

And now spell it right :D

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 13639 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

To check if a document that takes very long to render or not is hit by this bug just put a return on the beginning of Gfx::doPatternFill and Gfx::doPatternStroke if it automatically goes fast again, you've hit a duplicate of the magnificient and sucking "Patterns are extremely slow to render" bug

Revision history for this message
In , Brad Hards (bradh) wrote :

*** Bug 3086 has been marked as a duplicate of this bug. ***

Changed in poppler:
status: Confirmed → Triaged
Revision history for this message
Jakob Unterwurzacher (jakobunt) wrote :

Still here:

Ubuntu Gutsy
evince 2.20.1-0ubuntu1
libpoppler-glib2 0.6-0ubuntu2.1

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 16094 has been marked as a duplicate of this bug. ***

Revision history for this message
Igor Zubarev (igor.zubarev) wrote :

Confirm. Evince bacame a memory hog. It eats all possible memory and hangs.
Evince 2.22.2
poppler 0.6.4 (cairo)

Revision history for this message
Igor Zubarev (igor.zubarev) wrote :

CORRECTION. Evince hangs opening all files in MAXIMIZED window mode.

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 19575 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 19758 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 20891 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 21660 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 6680 has been marked as a duplicate of this bug. ***

Changed in poppler:
status: Confirmed → Invalid
Revision history for this message
LKRaider (paul-eipper) wrote :

how did it go from confirmed to invalid with no explanation?

Changed in poppler:
status: Invalid → Confirmed
Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 22997 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Carlos Garcia Campos (carlosgc) wrote :

Created an attachment (id=28591)
Implement tiling patterns in cairo backend

These patches fix the bug for the cairo backend.

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

I'd say the change to Gfx.cc is ok, though i don't see the need for m1x and m1y

Revision history for this message
In , Carlos Garcia Campos (carlosgc) wrote :

(In reply to comment #15)
> I'd say the change to Gfx.cc is ok, though i don't see the need for m1x and m1y
>

m1x and m1y are needed to restore m1[4] and m1[5] in case of falling back to Gfx code when out->tilingPatternFill() returns false.

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

But the first thing done in the "fallback" code is assigning m1[4] and m1[5], so it doesn't matter, right?

Revision history for this message
In , Carlos Garcia Campos (carlosgc) wrote :

You are right, I've removed them and pushed the commits.

Revision history for this message
In , Carlos Garcia Campos (carlosgc) wrote :

Moving to splash component since it's fixed in cairo backend now.

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 23652 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 24389 has been marked as a duplicate of this bug. ***

Revision history for this message
deivid (deivid-rodriguez) wrote :

Happening to me on a djvu file. Going up to 85% cpu usage and taking more than 20 seconds to render it.
evince 2.26.2

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 25591 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 3233 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Psychonaut (psychonaut) wrote :

I have a document which is also slow to render (using Okular). What's the best way of determining whether it's because of this pattern bug, or because of something else? Is there some command-line tool which will tell me whether a given PDF has a pattern?

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

See comment #5

Or you want a user level tool?

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 28954 has been marked as a duplicate of this bug. ***

Changed in poppler:
importance: Unknown → Medium
Changed in poppler:
importance: Medium → Unknown
Changed in poppler:
importance: Unknown → Medium
Changed in poppler:
status: Confirmed → Fix Released
Revision history for this message
penalvch (penalvch) wrote :

Kevin Fisher, the document is not available via the URL in the Bug Description. Hence, could you please provide an example document that demonstrates this problem?

no longer affects: gpdf (Ubuntu)
Changed in poppler (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
importance: Medium → Low
status: Triaged → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.