Xpdf renders really slow, non-responsive

Bug #12613 reported by Theo van Klaveren
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Poppler
Fix Released
Medium
xpdf (Debian)
Fix Released
Unknown
xpdf (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Xpdf renders the attached file really slow, taking about 1 minute per page,
being non-responsive in the meantime. Switching pages incurs the 1 minute delay
every time. Acrobat reader has no problems, rendering it in about 1 second on my
Athlon XP 2500+. Any other program that uses Xpdf's engine for rendering
(Gnome-pdf-viewer, Evince) also exhibits this bug. I have no problem with other
documents.

https://bugs.freedesktop.org/show_bug.cgi?id=2709: https://bugs.freedesktop.org/show_bug.cgi?id=2709

Revision history for this message
Theo van Klaveren (t-vanklaveren) wrote :

Created an attachment (id=1286)
Problematic PDF

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

I've opened a bug against evince but that seems to be a poppler issue according
to http://bugzilla.gnome.org/show_bug.cgi?id=169887.

you can find an example here:
https://bugzilla.ubuntu.com/attachment.cgi?id=1286

Acroread opens this file fine.

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

right, I've opened a bug upstream on poppler (the freedesktop fork of xpdf) for it:
https://bugs.freedesktop.org/show_bug.cgi?id=2709

Revision history for this message
Hamish Moffatt (hamish) wrote :

Why did you report this to an upstream fork, rather than to Derek Noonburn
<email address hidden>, the original author?

Alternatively report it to Debian. I can group it with existing reports of this
nature and forward the details upstream.

Hamish

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

(In reply to comment #3)
> Why did you report this to an upstream fork, rather than to Derek Noonburn
> <email address hidden>, the original author?

Because I don't know the bug tracker for xpdf and because we have planned to
switch the default pdf viewer to evince that uses poppler.

> Alternatively report it to Debian. I can group it with existing reports of this
> nature and forward the details upstream.

Seems to be the same as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231208,
any interest to open a new bug ?

Revision history for this message
Hamish Moffatt (hamish) wrote :

(In reply to comment #4)
> (In reply to comment #3)
> > Why did you report this to an upstream fork, rather than to Derek Noonburn
> > <email address hidden>, the original author?
>
> Because I don't know the bug tracker for xpdf and because we have planned to
> switch the default pdf viewer to evince that uses poppler.

There is no public bug tracker for Xpdf. Email <email address hidden> directly.

Even if you switch your default pdf viewer, you presumably wouldn't call the
package "xpdf".

> > Alternatively report it to Debian. I can group it with existing reports of this
> > nature and forward the details upstream.
>
> Seems to be the same as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231208,
> any interest to open a new bug ?

No need, existing bug looks OK. I'll add some extra information to Debian BTS.

Hamish

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

(In reply to comment #5)

> Even if you switch your default pdf viewer, you presumably wouldn't call the
> package "xpdf".

no, but we don't have a poppler component in bugzilla for the moment that's why
this bug is on xpdf.

> No need, existing bug looks OK. I'll add some extra information to Debian BTS.

thanks

Revision history for this message
In , Jeff Muizelaar (jeff-infidigm) wrote :

This looks like it is caused by poppler rerendering the pattern each time it
wants to draw it.

Revision history for this message
Dietmar Hofer (didi156) wrote :

Created an attachment (id=2168)
another problematic pdf

With this pdf I have the same problem described here. Starting from page 39 it
takes VERY long to render (but doesn't crash). It's PDF version 1.4 btw, maybe
that matters.

Revision history for this message
Berti (bertrand-haut-gmail) wrote :

Created an attachment (id=4552)
A third problematic pdf file

xpdf (all versions & all distributions I've tested) takes a really long time to
be able to display this single page document.

acroread has no problem.
kpdf is much more faster BUT a part of the image is missing (the barcode) BUT
this part was present in the printing.

Revision history for this message
Daniel Robitaille (robitaille) wrote :

Confirmed using both evince and xpdf in Dapper; it takes a minute or so to render which page.

Using kghostview, it rendered in a few seconds

Changed in xpdf:
status: Unconfirmed → Confirmed
Changed in poppler:
status: Unconfirmed → Confirmed
Revision history for this message
In , Horváth Árpád (horvath-arpad-roik) wrote :

An other example that "eat CPU":
http://arxiv.org/pdf/cond-mat/0412004v3
the PDF-version.

On Ubuntu 8.04
with evince 2.22.2 poppler 0.6.4

The problem can be in the 4th or 5th page. The first 3 page makes no problem.

(I found no example on the URL given in the description.)

Revision history for this message
In , Horváth Árpád (horvath-arpad-roik) wrote :

In addition: with Acrobat Reader there is no problem.

Changed in xpdf:
assignee: seb128 → desktop-bugs
status: Confirmed → Triaged
Revision history for this message
In , Miguel Diago (mdm) wrote :

Comment #2 PDF still freezes at page 6, using poppler 0.8.7 (cairo), evince 2.24.1

Revision history for this message
In , David Benjamin (davidben) wrote :

I've investigated things a little (and read the PDF spec to do so... a few hours ago, I had no idea how PDFs files were structured.). The page in question displays a bunch of plots with many many dots. sysprof says that most of the time is spent in cairo, stroking and filling some paths.

Part of the problem is that this PDF is just very poorly made.

pdf_inspector hangs while dumping a ton of data to the console:

m 3349.42 6798.69
c 3349.42 6802.36 3346.44 6805.34 3342.77 6805.34
c 3339.09 6805.34 3336.11 6802.36 3336.11 6798.69
c 3336.11 6795.02 3339.09 6792.04 3342.77 6792.04
c 3346.44 6792.04 3349.42 6795.02 3349.42 6798.69
f
m 3349.42 6798.69
c 3349.42 6802.36 3346.44 6805.34 3342.77 6805.34
c 3339.09 6805.34 3336.11 6802.36 3336.11 6798.69
c 3336.11 6795.02 3339.09 6792.04 3342.77 6792.04
c 3346.44 6792.04 3349.42 6795.02 3349.42 6798.69
S

(repeated a ton with different numbers)

That is, a moveTo, some curveTo, and then a stroke or a fill. The two paths are identical, which is a first sign of the PDF being weird. :-) You would think that could be simply a fill on a larger path.

I also looked around the PDF file itself to see if the paths were referenced from somewhere and poppler was copying them without making cairo cache something. This is not the case. The stream with the contents of that page (the /Page is 141 0 R with /Contents 142 0 R) contains (under a /FlateDecode) about 12,000 lines worth of

2200.18 6576.24 m
2200.18 6579.91 2197.2 6582.89 2193.52 6582.89 c
2189.85 6582.89 2186.87 6579.91 2186.87 6576.24 c
2186.87 6572.57 2189.85 6569.59 2193.52 6569.59 c
2197.2 6569.59 2200.18 6572.57 2200.18 6576.24 c
S
2197.68 6609.51 m
2197.68 6613.18 2194.7 6616.16 2191.03 6616.16 c
2187.36 6616.16 2184.38 6613.18 2184.38 6609.51 c
2184.38 6605.84 2187.36 6602.86 2191.03 6602.86 c
2194.7 6602.86 2197.68 6605.84 2197.68 6609.51 c
f

So, the PDF really just contains that many drawing commands, and cairo is a wonderful little speed demon.

That said, it may still be poppler's fault. I tried loading it with Okular (on Ubuntu Jaunty's system poppler; the dev one crashed under LD_LIBRARY_PATH... ABI change?) and it also hangs.

Also, evinces gives me the following errors:
Error: Unable to allocate memory for image.
Error: Unable to allocate memory for image.
Error: Unable to allocate memory for image.
Error: Unable to allocate memory for image.

By adding extra debug outputs, they're HUGE allocations. On the order of 1-2GB, with the last two overflowing a signed int. Somehow, I suspect this is not the right thing to do. :-)

Will investigate further...

Revision history for this message
In , David Benjamin (davidben) wrote :

The PDF seems to render properly on poppler master. Still slow, but acroread also renders it slowly.

Revision history for this message
In , Chris (csherrmann) wrote :

hello everyone,

I think the issue with this pdf might be related (it appears the first page is extremly slow to load and uses a lot of cpu)

http://mrman.de/CASE.pdf

i've been using slackware 13 and kubuntu 9.10 with both okular and xpdf... same problem

best regards

chris

Revision history for this message
Mark Summerfield (mark-qtrac) wrote :

I have a program that uses the libpoppler-qt4-dev package. In Ubuntu 9.10 the poppler version for that package is 0.12.0 and my program runs very fast. But now that I've upgraded to Ubuntu 10.04 the poppler version for the package is 0.12.4 and my program's speed has *dramatically declined*. I supect that this problem may be the same as the one discussed here.

I did a local build of poppler 0.14.0 and rebuilt my program and linked against 0.14.0 and the program ran at its proper speed. So there really does seem to be a problem with poppler 0.12.4.

Changed in xpdf (Ubuntu):
status: Triaged → Confirmed
Changed in poppler:
importance: Unknown → Medium
Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for posting this bug.

Does this occur in Lucid?

Changed in xpdf (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Tyler Gates (tgates81) wrote :

I can confirm it still happens in Lucid.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

In Maverick (granted I was VirtualBox'ing with Toshiba Satellite L305D-S5934) I checked 'third Problematic pdf file' and it took about 3 minutes with XPDF while less than 2 seconds with Evince. Confirming.

Changed in xpdf (Ubuntu):
status: Incomplete → Confirmed
Changed in xpdf (Ubuntu):
status: Confirmed → Triaged
importance: Medium → Low
Revision history for this message
Tyler Gates (tgates81) wrote :

After upgrading to Maverick xpdf packages on 10.04 Lucid (xpdf_3.02-9ubuntu1_all xpdf-reader_3.02-9ubuntu1_i386 xpdf-common_3.02-9ubuntu1_all) The issue is resolved.

Changed in poppler:
importance: Medium → Unknown
Changed in poppler:
importance: Unknown → Medium
Revision history for this message
In , thomasfr (thomas-freitag) wrote :

I cannot find the PDF from Sebastien anymore, but the PDF from comment 2 renders with the actual version in 25 sec, so less than 1 second / page, and also CASE.pdf renders in less than 1 second / page.
So this problem seems to be fixed now.

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

Marking fixed, if you still have a pdf file that has a huge cpu use please open a new bug and attach the pdf file there

Changed in poppler:
status: Confirmed → Fix Released
Changed in xpdf (Ubuntu):
status: Triaged → Incomplete
status: Incomplete → Confirmed
Changed in xpdf (Debian):
status: Confirmed → Fix Released
Revision history for this message
Florian Schlichting (fschlich) wrote :

this was fixed in Poppler in 2012, and hence can be marked as fixed here

Changed in xpdf (Ubuntu):
status: Confirmed → Fix Released
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.