Bug 54950 - Poppler hangs when printing a PDF
Summary: Poppler hangs when printing a PDF
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.12.6
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-15 06:14 UTC by Germán Poo-Caamaño
Modified: 2013-01-08 15:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
PDF test case (350.99 KB, application/pdf)
2012-09-15 06:14 UTC, Germán Poo-Caamaño
Details
backtrace (10.31 KB, text/plain)
2012-09-15 06:15 UTC, Germán Poo-Caamaño
Details
backtrace full (cairo master cf07bd866dc3fd ) (19.54 KB, text/plain)
2012-11-03 18:32 UTC, Germán Poo-Caamaño
Details
cairo test code (4.21 KB, patch)
2012-11-04 00:13 UTC, Adrian Johnson
Details | Splinter Review

Description Germán Poo-Caamaño 2012-09-15 06:14:08 UTC
Created attachment 67194 [details]
PDF test case

This bug was reported in Ubuntu Launchpad against Evince, then to GNOME Bugzilla, but it seems the problem is in poppler.

Steps to reproduce it:
- Open the file with poppler-glib-demo (I tried with master b72c02d1)
- Render the first page
- Print to a file (PDF).
Comment 1 Germán Poo-Caamaño 2012-09-15 06:15:54 UTC
Created attachment 67195 [details]
backtrace

This is the backtrace I got after trying to print.
Comment 2 Adrian Johnson 2012-11-03 00:54:24 UTC
Works for me with poppler master and cairo 1.12.6 using the command:

pdftocairo -pdf bug54950.pdf out.pdf

According to your stack trace you are using cairo 1.10.2. Looks like a bug that has been fixed in cairo. Please re-open if you can reproduce the bug with cairo master.
Comment 3 Germán Poo-Caamaño 2012-11-03 18:31:10 UTC
(In reply to comment #2)
> Works for me with poppler master and cairo 1.12.6 using the command:
> 
> pdftocairo -pdf bug54950.pdf out.pdf

This command also works with previous versions of cairo.

> According to your stack trace you are using cairo 1.10.2. Looks like a bug
> that has been fixed in cairo. Please re-open if you can reproduce the bug
> with cairo master.

I can reproduce it with cairo master from Nov 3 (cf07bd866dc).
Comment 4 Germán Poo-Caamaño 2012-11-03 18:32:59 UTC
Created attachment 69496 [details]
backtrace full (cairo master cf07bd866dc3fd )

Updated backtrace with cairo master cf07bd866dc3fd
Comment 5 Adrian Johnson 2012-11-04 00:07:24 UTC
Looks a cairo deadlock bug when destroying fonts.
Comment 6 Adrian Johnson 2012-11-04 00:13:14 UTC
Created attachment 69507 [details] [review]
cairo test code

Attached is a minimal cairo program to reproduce the bug. It needs to be run with the PDF file attached to this bug.

The macros at the top allow any combination of PNG PS, or PDF output. It works fine for any single output or for PS and PDF output. But when PNG and at least one of PS/PDF is included it hangs during the PS/PDF output somewhere in scaled_font_destroy.

I'm not sure why this particular PDF file triggers the bug but it does contain over 100 fonts which may have something to do with it.
Comment 7 Chris Wilson 2013-01-08 15:06:36 UTC
commit 4d4bf8fddff49d349e03282ffa827f6f4659e3fe
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jan 8 14:56:07 2013 +0000

    scaled-font: Free the cached glyphs from the font before taking the global lock
    
    In the case of a recording surface we may recurse into the global glyph
    cache so we need to be careful and stage the ordering of how we free the
    glyphs. So first we finish any information and surfaces from the scaled
    font glyph cache (and so triggering recursion into other scaled fonts)
    and then take the global cache and remove our pages.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54950
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.