Bug 33364 - Complex patterns in PDF displayed as white area, high CPU usage and crash (evince w/ cairo backend only)
Summary: Complex patterns in PDF displayed as white area, high CPU usage and crash (ev...
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
: 26533 28357 31235 55463 60901 69545 69546 80267 83936 86884 (view as bug list)
Depends on:
Blocks: 69545
  Show dependency treegraph
 
Reported: 2011-01-22 08:03 UTC by Mahendra Tallur
Modified: 2015-12-23 04:22 UTC (History)
9 users (show)

See Also:
i915 platform:
i915 features:


Attachments
PDF file which renders incorrectly with libpoppler and causing evince to crash (6.16 KB, application/force-download)
2011-01-22 08:04 UTC, Mahendra Tallur
Details
Use matrix to determine pattern size (2.57 KB, patch)
2014-05-20 11:07 UTC, Jason Crain
Details | Splinter Review
Use matrix to determine pattern size (3.32 KB, patch)
2014-08-01 06:29 UTC, Jason Crain
Details | Splinter Review

Description Mahendra Tallur 2011-01-22 08:03:27 UTC
Hi ! First thanks to everyone involved !

Please have a look at this .PDF file produced in Inkscape. It is rendered properly in Acrobat Reader, but under evince (libpoppler based) :

- the single object contained on the document, which uses a complex pattern, is invisible. When zooming is you can see some stripes or random patterns

- the pdf takes about 3 seconds to display (instant in Acrobat)

- after zooming / moving within the document, evince crashes and seems to eat a lot of memory

Thanks for reading this, cheers !
(Using Ubuntu 10.10, AMD64, libpoppler-glib5 0.14.3-0ubuntu1.1)
Comment 1 Mahendra Tallur 2011-01-22 08:04:11 UTC
Created attachment 42307 [details]
PDF file which renders incorrectly with libpoppler and causing evince to crash
Comment 2 Albert Astals Cid 2011-01-22 09:45:35 UTC
Splash backend seems to work fine.
Comment 3 Mahendra Tallur 2011-02-03 07:22:34 UTC
(In reply to comment #2)
> Splash backend seems to work fine.

Thanks for checking ! I had no issue either with libpoppler 0.14.5 and Okular (KDE 4.6 under Archlinux). So this seems to be specific to the backend used by evince. (but I thought Okular also made use of the Cairo backend ?)
Comment 4 Albert Astals Cid 2011-02-03 10:57:24 UTC
No Okular does not use the cairo backend. Your sources are wrong.
Comment 5 Jason Crain 2014-05-20 11:07:35 UTC
Created attachment 99401 [details] [review]
Use matrix to determine pattern size

I don't see a crash, but evince does show just a blank page.  There might be a bug in cairo or pixman because it doesn't seem to like the tiling pattern matrix.  It doesn't draw anything if the matrix offset / scaling > 32768.

It should still be fixed in poppler though, because it doesn't make sense to create a 9720x9720 pattern to fill a 750x500 area.  Attached patch calculates the dimensions of the pattern after transformation and creates a pattern of the appropriate size.
Comment 6 Jason Crain 2014-07-24 06:06:31 UTC
*** Bug 80267 has been marked as a duplicate of this bug. ***
Comment 7 Carlos Garcia Campos 2014-07-24 09:47:00 UTC
(In reply to comment #5)
> Created attachment 99401 [details] [review] [review]
> Use matrix to determine pattern size
> 
> I don't see a crash, but evince does show just a blank page.  There might be
> a bug in cairo or pixman because it doesn't seem to like the tiling pattern
> matrix.  It doesn't draw anything if the matrix offset / scaling > 32768.
> 
> It should still be fixed in poppler though, because it doesn't make sense to
> create a 9720x9720 pattern to fill a 750x500 area.  Attached patch
> calculates the dimensions of the pattern after transformation and creates a
> pattern of the appropriate size.

Thanks for the patch, it looks good to me, but I've passed my tests with it and I'm getting some differences in several documents. The thing is that in some cases it improves the output but in some others it regresses. As usual I don't know which of my files are private or not, so I'll send them to you in a private email.
Comment 8 Jason Crain 2014-08-01 06:29:41 UTC
Created attachment 103788 [details] [review]
Use matrix to determine pattern size

> - n3580.pdf: I get differences in a lot of pages, but looks like the
>   same thing in all of them. First ones is page 3. It renders the
>   patterns differently, not sure if it's better or worse, TBH. I would
>   not consider this a regression in any case.
> - folleto_attached.pdf: The brick pattern looks a bit worse I would
>   say, but the diff is too small to be sure.

The difference I see is that the diagonal lines in n3580.pdf and brick pattern in folleto_attached.pdf are drawn at a higher resolution.  You can see it through pdftocairo at 300 ppi.

> - redp4150.pdf: Pages 1 and 6, some lines are blurry.

Looks like I need to save/restore the value of adjusted_stroke_width while drawing the pattern.  It gets clobbered when the pattern sets the line width.
Comment 9 Jason Crain 2014-09-02 00:05:46 UTC
*bump*
Comment 10 Adrian Johnson 2014-11-01 05:28:31 UTC
*** Bug 83936 has been marked as a duplicate of this bug. ***
Comment 11 Adrian Johnson 2014-11-01 05:40:45 UTC
*** Bug 60901 has been marked as a duplicate of this bug. ***
Comment 12 Adrian Johnson 2014-11-01 05:51:40 UTC
*** Bug 69546 has been marked as a duplicate of this bug. ***
Comment 13 Adrian Johnson 2014-11-01 05:57:05 UTC
*** Bug 26533 has been marked as a duplicate of this bug. ***
Comment 14 Carlos Garcia Campos 2014-11-01 09:06:31 UTC
Sorry for the delay, pushed to git master now. Thanks!
Comment 15 Adrian Johnson 2014-11-01 09:19:45 UTC
*** Bug 69545 has been marked as a duplicate of this bug. ***
Comment 16 Jason Crain 2014-12-16 00:13:57 UTC
*** Bug 86884 has been marked as a duplicate of this bug. ***
Comment 17 Jason Crain 2015-12-23 03:14:02 UTC
*** Bug 55463 has been marked as a duplicate of this bug. ***
Comment 18 Jason Crain 2015-12-23 03:28:37 UTC
*** Bug 28357 has been marked as a duplicate of this bug. ***
Comment 19 Jason Crain 2015-12-23 04:22:52 UTC
*** Bug 31235 has been marked as a duplicate of this bug. ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.