Bug 71177 - "In pixman_region32_init_rect: Invalid rectangle passed" when viewing a certain PDF
Summary: "In pixman_region32_init_rect: Invalid rectangle passed" when viewing a certa...
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: glib frontend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-03 02:39 UTC by Germán Poo-Caamaño
Modified: 2018-08-20 22:01 UTC (History)
9 users (show)

See Also:
i915 platform:
i915 features:


Attachments
small PDF sample that triggers the message (12.83 KB, application/pdf)
2014-03-23 09:44 UTC, Pablo Rodríguez
Details
Other reproducer (43.30 KB, application/pdf)
2014-10-15 23:00 UTC, Vincent Gerard
Details
triggers for 0.42 version (722.99 KB, application/pdf)
2016-05-24 09:36 UTC, adrin
Details
yet another reproducer for this bug (26.67 KB, application/pdf)
2016-10-20 10:54 UTC, Vlad Orlov
Details

Description Germán Poo-Caamaño 2013-11-03 02:39:10 UTC
From Evince: https://bugzilla.gnome.org/show_bug.cgi?id=706567

A summary of the comments:

----------------
When viewing the attached PDF and scrolling to the end, evince shows the
following warnings on the console (but continues to function properly without
apparent rendering issues):
{{{
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
}}}

A PDF test case (8.8MB) is in
http://media.zweitausendeins.de/download/?pdf/merkheft/271%2FMH271_interaktiv.pdf

-----------------
The ouput of gdb shows a corrupted rectangle:

$2 = {extents = {x1 = 501, y1 = 479, x2 = 483, y2 = 504}, data = 0x7bae00}
(gdb) print *region->data
$3 = {size = 8105376, numRects = 8106176}
(gdb) print region->data
$4 = (pixman_region32_data_t *) 0x7bae00
(gdb) print *(region->data)
$5 = {size = 8105376, numRects = 8106176}

-----------------
Finally Carlos said:

It's a poppler bug actually that is giving us incorrect rectangles as selection
region. That document is a challenge for poppler, it contains vertical text and
even inclined text. Poppler doesn't support it, it assumes that all characters
in a line are at the same yMin - yMax range. So, there are several approaches
to solve/workaround the issue. We can check rectangles are valid in evince and
ignore the invalid ones, maybe showing a warning, but I think it would be
better to do it in poppler, either poppler glib or directly in TextOutputDev.
Comment 1 Paul Wise 2013-12-31 02:54:40 UTC
I also noticed this error with a different PDF, evince prints the error 6 times:

https://bettercrypto.org/static/applied-crypto-hardening.pdf
Comment 2 Marek Kasik 2014-02-17 17:21:18 UTC
Hi,

I've been hit by this problem recently. I've prepared patch and attached it here: https://bugs.freedesktop.org/show_bug.cgi?id=16619.

Marek
Comment 3 Pablo Rodríguez 2014-03-23 09:44:44 UTC
Created attachment 96232 [details]
small PDF sample that triggers the message
Comment 4 Vincent Gerard 2014-10-15 22:59:13 UTC
Also have the same issue, I splitted the page on a PDF that generate an invalid rectangle in evince to attach a reproducer. (seems the PDF is simpler, no rotated text, but schemas are involved)

Data from poppler are:

(In evince)
Breakpoint 2, create_region_from_poppler_region (region=region@entry=0x78e840, scale=scale@entry=1) at ev-poppler.cc:2091
(gdb) p rectangle
$5 = (PopplerRectangle *) 0x78ea80
(gdb) p *rectangle
$6 = {x1 = 341, y1 = 236, x2 = 339, y2 = 244}

And this rectangle generate a negative width and led to Invalid rectangle passed.

Thanks,
Vincent.
Comment 5 Vincent Gerard 2014-10-15 23:00:33 UTC
Created attachment 107904 [details]
Other reproducer

Attached file mentionned in comment upward.
Comment 6 Sébastien Wilmet 2015-10-30 11:37:03 UTC
It looks like this bug is fixed with Poppler 0.34.0 and Evince 3.18.0.

Another reproducer was:
http://ctan.mirrorcatalogs.com/macros/latex/contrib/leaflet/leaflet-manual.pdf
Comment 7 Pablo Rodríguez 2015-10-30 22:54:07 UTC
Confirming the statement from Sébastien, the bug seems to be already fixed in poppler-0.30.

Since I hadn’t reported the bug originally and I’m not a developer, I’m not closing the bug. But I think it would be a good idea to do that.
Comment 8 adrin 2016-05-24 09:36:06 UTC
Created attachment 124017 [details]
triggers for 0.42 version

I have these pachages installed on ArchLinux:

extra/poppler 0.42.0-1 [installed]
extra/poppler-glib 0.42.0-1 [installed]
extra/poppler-qt5 0.42.0-1 [installed]
extra/evince 3.20.0-2 (gnome) [installed]

And the attached file, page 25, triggers this bug.
Comment 9 Vlad Orlov 2016-10-20 10:50:47 UTC
I still can reproduce this with poppler 0.44 in current Debian Testing.

Reproduced with attachment 96232 [details] and attachment 107904 [details].

Used lastest version of Atril (fork of Evince).
Comment 10 Vlad Orlov 2016-10-20 10:54:14 UTC
Created attachment 127420 [details]
yet another reproducer for this bug

Uploaded one more reproducer PDF for this.
Taken from https://bugzilla.redhat.com/1199329.
Comment 11 Pablo Rodríguez 2018-05-26 15:22:19 UTC
The error message doesn’t appear with evince-3.26 and poppler-0.57 when opening the three attachments or the url.

I guess this report may be closed (after confirmation).
Comment 12 Vlad Orlov 2018-05-26 19:14:13 UTC
I can still reproduce it with poppler 0.62 in Ubuntu 18.04.

3 of 4 attachments here trigger it.
Comment 13 Marek Kasik 2018-05-28 08:50:35 UTC
(In reply to Pablo Rodríguez from comment #11)
> The error message doesn’t appear with evince-3.26 and poppler-0.57 when
> opening the three attachments or the url.
> 
> I guess this report may be closed (after confirmation).

Hi, do you use upstream versions of poppler and evince? (we have the patch from https://bugs.freedesktop.org/show_bug.cgi?id=16619#c1 in Fedora)
Comment 14 Pablo Rodríguez 2018-05-29 19:15:49 UTC
(In reply to Marek Kasik from comment #13)
> (In reply to Pablo Rodríguez from comment #11)
> > The error message doesn’t appear with evince-3.26 and poppler-0.57 when
> > opening the three attachments or the url.
> > 
> > I guess this report may be closed (after confirmation).
> 
> Hi, do you use upstream versions of poppler and evince? (we have the patch
> from https://bugs.freedesktop.org/show_bug.cgi?id=16619#c1 in Fedora)

I’m using the versions shipped with Fedora.

This seems to explain everything.
Comment 15 GitLab Migration User 2018-08-20 22:01:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/164.


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.