Cairo crash on save as PDF with huge export area (drawing extent)

Bug #1474884 reported by Ryo Furue
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

Open the attached SVG (created by Inkscape) and save it as a PDF file. A popup window appears with the message "Inkscape encountered an internal error and will close now." and if you click on "Close", Inkscape closes.

The "output page size" is set to "Use exported object's size" when saving. If it's set to "Use document's page size", there is no error.

Hope this helps.

Ryo

=====
Inkscape 0.91 on Mac OS X 10.10.4

Assertion failed: (_cairo_int_status_is_error (status)), function _cairo_recording_surface_replay_internal, file cairo-recording-surface.c, line 1882.

Program received signal SIGABRT, Aborted.
0x0000000106e07ce2 in __pthread_kill ()
(gdb) bt
#0 0x0000000106e07ce2 in __pthread_kill ()
#1 0x0000000106cc67d2 in pthread_kill ()
#2 0x0000000106cb7a7a in abort ()
#3 0x0000000106cea5de in __assert_rtn ()
#4 0x0000000106146803 in _cairo_recording_surface_replay_internal ()
#5 0x000000010614686a in _cairo_recording_surface_replay_and_create_regions ()
#6 0x0000000106130dcf in _paint_page ()
#7 0x0000000106130c0d in _cairo_paginated_surface_show_page ()
#8 0x0000000106155379 in cairo_surface_show_page ()
#9 0x000000010611e2c4 in _cairo_gstate_show_page ()
#10 0x00000001061137fc in cairo_show_page ()
#11 0x0000000100441284 in Inkscape::Extension::Internal::CairoRenderContext::finish (this=0x11a1ddcf0) at ../../src/extension/internal/cairo-render-context.cpp:887
#12 0x000000010044be0c in pdf_render_document_to_file (doc=0x112294ea0, filename=0x11a235cf0 "> /Volumes/cyan/devel/inkscape/bug/1474884-try151aaafinafigs4b-cropped-letteringreplaced-r14245-drawing-area.pdf", level=1, texttopath=false, omittext=false, filtertobitmap=true, resolution=96, exportId=0x0, exportDrawing=true, exportCanvas=false, bleedmargin_px=0) at ../../src/extension/internal/cairo-renderer-pdf-out.cpp:107

Revision history for this message
Ryo Furue (furue) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version to the bug description, thank you.

Changed in inkscape:
status: New → Incomplete
tags: added: crash exporting pdf
Revision history for this message
su_v (suv-lp) wrote :

On 2015-07-15 16:51 (+0200), Ryo Furue wrote:
> The "output page size" is set to "Use exported object's size" when
> saving. If it's set to "Use document's page size", there is no> error.>

Which object from the drawing (per ID, see entry box below) are you trying to export?

Revision history for this message
su_v (suv-lp) wrote :

> Which object from the drawing (per ID, see entry box below)
> are you trying to export?

Nevermind, without specific ID it exports drawing area (this option was labeled 'Export area is drawing' in earlier versions).

Revision history for this message
Ryo Furue (furue) wrote :

> Please add information about OS/platform
> and Inkscape version to the bug description,

Oops, sorry. It's Inkscape 0.91 on Mac OS X 10.10.4 .

Ryo

Revision history for this message
su_v (suv-lp) wrote :

If exporting drawing area, I would recommend to delete that insanely huge path (discussed in related bug #1474710) first - the dimensions (area) of that path exceed by far what is supports as max PDF page size.

Inkscape (or cairo) should not crash though but probably abort earlier if the user (unintentionally) attempts to export an area of roughly 5'645 x 5'645 m (meter) to PDF.

Revision history for this message
Ryo Furue (furue) wrote :

Here are the options when "Save As" PDF:

Restrict to PDF version: PDF 1.5
x Convert texts to paths
[PDF+LaTeX option not checked]
x Rasterize filter effects
Resolution for rasterization (dpi): 90
Output page size: Use exported object's size
Bleed margin (mm): 0.0
Limit export to the object with ID: [this box is empty]

Except for the "Use exported object's size", all are default values, I think.

Ryo

Revision history for this message
su_v (suv-lp) wrote :

Attaching modified version of the SVG file with the mentioned huge path deleted - this version exports the drawing (exported object's size) area just fine to PDF - tested and confirmed with Inkscape 0.48.5 r10040, 0.91 r13725 and 0.91+devel r14245 on OS X 10.7.5.

description: updated
Revision history for this message
su_v (suv-lp) wrote :

Cairo crash on export of huge drawing area reproduced with Inkscape 0.91 r13725 and 0.91+devel r14245 on OS X 10.7.5; happens both with cairo 1.14.2 (current stable) and 1.14.3 (git master).

Full backtrace attached (no debug symbols for cairo installed though).

Changed in inkscape:
importance: Undecided → Medium
status: Incomplete → Confirmed
tags: added: cairo
Revision history for this message
Ryo Furue (furue) wrote :

> If exporting drawing area, I would recommend to delete
> that insanely huge path (discussed in related bug #1474710) first

Yes, I suspected this issue is tightly related to the other one. But, I don't know how to delete the offending object. I just randomly clicked on empty space to find an invisible object that may be the cause, but I wasn't able to find it.

How did you do that?

> Inkscape (or cairo) should not crash though but probably
> abort earlier if the user (unintentionally) attempts to export
> an area of roughly 5'645 x 5'645 m (meter) to PDF.

I hope that kind of fix will be incorporated in the future version of Inkscape. An error message such as "The export area is too large: 5645 m x 5465 m." would be nice.

Ryo

Revision history for this message
su_v (suv-lp) wrote :

On 2015-07-15 17:50 (+0200), Ryo Furue wrote:
>> If exporting drawing area, I would recommend to delete
>> that insanely huge path (discussed in related bug #1474710) first
>
> Yes, I suspected this issue is tightly related to the other one. But, I
> don't know how to delete the offending object. I just randomly clicked
> on empty space to find an invisible object that may be the cause, but I
> wasn't able to find it.
>
> How did you do that?

0) Open 'try151aaafinafigs4b-cropped-letteringreplaced.svg' (the example file attached in comment #1).

1) Zoom to drawing (to verify the current drawing extents): use keyboard shortcut '4' (or menu 'View > Zoom > Drawing')

This gives you already a hint that there's something unexpected in the drawing (see current zoom level in the bottom right corner).

2) use 'TAB' to cycle (in stack order) through the objects in the current layer or group, keeping an eye on the message in the status bar, and the 'W', 'H' spinboxes on the select tool controls bar right above the canvas.

You found the offending object (a path with 4 nodes) once you notice that the selection handles are not visible (the path extends beyond what can be seen on the visible canvas area at zoom level 1%; at least on a 13inch screen), and the spinboxes in the controls bar are all max'd out at '1000000.000' px.

Note: before that path (in stack order), there's an empty group, as indicated by the message in the status bar, which - because an empty group has no extents by itself - also does not show any visible selection handles. Ignore this (or delete it too, doesn't matter), and proceed to the next object in stack order with 'TAB'.

3) Once you found the offending path (i.e. it is selected), use 'Edit > Delete' or hit 'Backspace' to delete it.

4) Now verify again the drawing extent by zooming to drawing (keyboard shortcut '4') -> it should zoom you in to the visible portion of the drawing immediately. Export of the drawing area should be no issue anymore.

>> Inkscape (or cairo) should not crash though but probably
>> abort earlier if the user (unintentionally) attempts to export
>> an area of roughly 5'645 x 5'645 m (meter) to PDF.
>
> I hope that kind of fix will be incorporated in the future version of
> Inkscape. An error message such as "The export area is too large: 5645
> m x 5465 m." would be nice.

We do track a related issue already in
* Bug #597552 “Warn users about the PDF size limit and consequences”
  https://bugs.launchpad.net/inkscape/+bug/597552

Revision history for this message
Ryo Furue (furue) wrote :

> 2) use 'TAB' to cycle (in stack order) through the objects
> in the current layer or group,
> keeping an eye on the message in the status bar,
> and the 'W', 'H' spinboxes on the select tool controls
> bar right above the canvas.

Thank you for your detailed instruction. That's brilliant. I've confirmed that after removing the offending object, saving the file, and reopening it gives you a "normal" drawing.

Thanks again.

Ryo

su_v (suv-lp)
summary: - crash on save as PDF
+ Cairo crash on save as PDF with huge export area (drawing extent)
description: updated
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.