crash on batch export to pdf/eps

Bug #815926 reported by Andrzej on 2011-07-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Jon A. Cruz

Bug Description

Inkscape r10503 (devel branch) on Ubuntu 11.04 (32bit).

Exporting a pdf from a "save as..." menu works as normal. Doing the same from the following command line:

bin/inkscape inkscape.svg -z -C --export-pdf=inkscape.pdf --export-latex

fails with:

Program received signal SIGSEGV, Segmentation fault.
SPDesktop::doc2dt (this=0x0) at desktop.cpp:1814
1814 return _doc2dt;
(gdb) bt
#0 SPDesktop::doc2dt (this=0x0) at desktop.cpp:1814
#1 0x080f9063 in SPItem::i2dt_affine (this=0x9719338) at sp-item.cpp:1474
#2 0x080f9562 in SPItem::invoke_bbox_full (this=0x9719338, bbox=..., transform=..., flags=0, clear=1) at sp-item.cpp:793
#3 0x080f9ae2 in SPItem::getBounds (this=0x9719338, transform=..., type=SPItem::APPROXIMATE_BBOX) at sp-item.cpp:711
#4 0x0812639d in SPShape::sp_shape_show (item=0x9719338, arena=0x9016fc0) at sp-shape.cpp:862
#5 0x080fa004 in SPItem::invoke_show (this=0x9719338, arena=0x9016fc0, key=0, flags=1) at sp-item.cpp:1046
#6 0x080fc748 in CGroup::_showChildren (this=0x9738b90, arena=0x9016fc0, ai=0x900fc60, key=0, flags=1) at sp-item-group.cpp:769
#7 0x080fe883 in CGroup::show (this=0x9738b90, arena=0x9016fc0, key=0, flags=1) at sp-item-group.cpp:756
#8 0x080fa004 in SPItem::invoke_show (this=0x9724c78, arena=0x9016fc0, key=0, flags=1) at sp-item.cpp:1046
#9 0x080fc748 in CGroup::_showChildren (this=0x9738678, arena=0x9016fc0, ai=0x900fd80, key=0, flags=1) at sp-item-group.cpp:769
#10 0x080fe883 in CGroup::show (this=0x9738678, arena=0x9016fc0, key=0, flags=1) at sp-item-group.cpp:756
#11 0x080fa004 in SPItem::invoke_show (this=0x9724b58, arena=0x9016fc0, key=0, flags=1) at sp-item.cpp:1046
#12 0x080fc748 in CGroup::_showChildren (this=0x9714a20, arena=0x9016fc0, ai=0x900fea0, key=0, flags=1) at sp-item-group.cpp:769
#13 0x080fe883 in CGroup::show (this=0x9714a20, arena=0x9016fc0, key=0, flags=1) at sp-item-group.cpp:756
#14 0x0812021d in sp_root_show (item=0x9715098, arena=0x9016fc0, key=0, flags=1) at sp-root.cpp:619
#15 0x080fa004 in SPItem::invoke_show (this=0x9715098, arena=0x9016fc0, key=0, flags=1) at sp-item.cpp:1046
#16 0x08207aca in pdf_render_document_to_file (this=0x8ae3ed8, mod=0x8acbfb8, doc=0x900ef60, filename=0x8acaa60 "inkscape.pdf") at extension/internal/cairo-renderer-pdf-out.cpp:88
#17 Inkscape::Extension::Internal::CairoRendererPdfOutput::save (this=0x8ae3ed8, mod=0x8acbfb8, doc=0x900ef60, filename=0x8acaa60 "inkscape.pdf") at extension/internal/cairo-renderer-pdf-out.cpp:212
#18 0x081f3717 in Inkscape::Extension::Output::save (this=0x8acbfb8, doc=0x900ef60, filename=0x8acaa60 "inkscape.pdf") at extension/output.cpp:218
#19 0x08082a49 in do_export_ps_pdf (doc=0x900ef60, uri=0x8acaa60 "inkscape.pdf", mime=<value optimized out>) at main.cpp:1566
#20 0x08083eb8 in sp_process_file_list (fl=0x8ab3338) at main.cpp:1046
#21 0x080844d2 in sp_main_console (argc=6, argv=0xbffff2c4) at main.cpp:1168
#22 0x08084922 in main (argc=6, argv=0xbffff2c4) at main.cpp:711

Configuration:

        Source code location: .
        Destination path prefix: /home/***/repos/inkscape
        Compiler: g++
        CPPFLAGS: -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2
        CXXFLAGS: -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -Wno-unused-parameter -g -O2 -fopenmp
        CFLAGS: -Wno-pointer-sign -g -O2
        LDFLAGS: -Wl,-z,relro

        Use gnome-vfs: yes
        Use openoffice files: yes
        Use relocation support: no
        Internal Python: skipped
        Internal Perl: skipped
        Enable LittleCms: yes
        Enable DBUS: no
        Enable Poppler-Cairo: yes
        ImageMagick Magick++: yes
        Libwpg: yes
        Doing Local Install: yes
        GTK+ backend target: x11

Alvin Penner (apenner) wrote :

- not reproduced on Windows XP, Inkscape rev 10450. I get a .pdf file and a file with the extension .pdf_tex
- could you attach the svg file, or does this happen with all svg files?

Andrzej (ndrwrdck) wrote :

It happens with all svg files I tried.

In the description above I used the inkscape.svg file distributed with Inkscape sources.

Alvin Penner (apenner) wrote :

does it still happen if you use the somewhat simpler command:

C:\Program Files\Inkscape>inkscape file.svg --export-pdf=file.pdf

Alvin Penner (apenner) wrote :

there appears to be something unique about the file inkscape.svg. Using bzr rev 10505, if I try to open this file from a command prompt then I get a large number of warnings of the type:

C:\InkscapeBZR\inkscape>inkscape share\icons\inkscape.svg

** (inkscape.exe:3880): CRITICAL **: Geom::Affine SPItem::i2dt_affine() const: assertion `desktop != NULL' failed

** (inkscape.exe:3880): CRITICAL **: Geom::Affine SPItem::i2dt_affine() const: assertion `desktop != NULL' failed

however, the file still opens, and if I request the pdf export it appears to work normally.

Andrzej (ndrwrdck) wrote :

Alvin, I did some more checking and it looks like the issue might be related to the method of installation I used ("Doing Local Install: yes"). My ./configure command line was:

./configure --prefix=/root_directory_of_inkscape_sources --enable-localinstall

I've pulled a new version of Inkscape (r10505), installed it with default options into /opt/inkscape and the crashes are gone.

I get the same assertion errors as you when opening inkscape.svg (either in batch or gui mode) so it might be still worth looking what is going on in there.

su_v (suv-lp) wrote :

Note that r10505 committed a "Temporary fix for crash when launching via command-line.":
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/10505>

tags: added: cli crash
Changed in inkscape:
importance: Undecided → High
su_v (suv-lp) wrote :

Related reports from the irc channel, last night:

|20:42| < JonCruz> BOOOOOOOOOM!!!!!!
|20:42| < JonCruz> Program received signal EXC_BAD_ACCESS, Could not access memory.
|20:42| < JonCruz> Reason: KERN_PROTECTION_FAILURE at address: 0x000001a4
|20:42| < JonCruz> 0x001d8b26 in Geom::Affine::operator[] (this=0x1a4, i=0) at affine.h:105
|20:43| < JonCruz> su-v: anyone see issues with Geom::Affine?
|20:43| < su-v> JonCruz: steps to reproduce? which revision?
|20:44| < JonCruz> su-v: latest trunk. Just tried to open a file from the command line. Not sure of more details than that
|20:44| < su-v> JonCruz: haven't had much time to test the latest commits (just got home)
|20:44| < su-v> ah, I think I got that one with an earlier revision - but it seemed related to a specific file (need to search the terminal log)
|20:45| < su-v> I didn't have the time to follow-up on that crash at the time

|21:40| < JonCruz> su-v: fixed for now. The main requirement was to launch from command line with the .svg file on the command line as a parameter

and later:
|07:26| < ChrisMorgan> Hmm. Just updated my Inkscape trunk build, now it seems that it crashes on opening from the command line (but not from the GUI) most things (tried four SVG files and a JPEG, one SVG file didn't crash, the rest all did).
|07:28| < ChrisMorgan> Top of the stack trace is #0 SPDesktop::doc2dt (this=0x0) at desktop.cpp:1814
|07:31| < ChrisMorgan> Actually the fail rate seems to be lower than I thought after trying some more.
|07:32| < ChrisMorgan> But here are a couple of backtraces: http://pastebin.com/2HgqS1mU http://pastebin.com/1FjHnF0U
|07:32| < ChrisMorgan> Hope someone can do something with that. I'm going now.

su_v (suv-lp) wrote :

@JonCruz - assigning this to you because it seems related to the issue addressed in your latest commit in r10505.

Changed in inkscape:
assignee: nobody → Jon A. Cruz (jon-joncruz)
status: New → Confirmed
su_v (suv-lp) wrote :

With r10503, the crash seems to be triggered by having a filter effect used in the SVG (not yet tested with r10505 or later).

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

With Inkscape 0.48+devel r10506 on Mac OS X 10.5.8 (i386), the file previously crashing Inkscape when opened from the command line, opens without crash, with this warning on the console:

** (inkscape:86920): CRITICAL **: Geom::Affine SPItem::i2dt_affine() const: assertion `desktop != NULL' failed

(as was described by Alvin in comment #4: the crash itself no longer occurs after r10505)

su_v (suv-lp) wrote :

Crash fixed in r10505, the (intentional) warning will be addressed separately.

Changed in inkscape:
status: Confirmed → Fix Committed
Jon A. Cruz (jon-joncruz) wrote :

The crash fix addressed code using a pointer without checking it. There are some other architectural changes needed elsewhere, so the issue was changed to a warning for now. If it stays too long we can add a new bug to explicitly address that warning.

Changed in inkscape:
status: Fix Committed → In Progress
status: In Progress → Fix Committed
milestone: none → 0.48
milestone: 0.48 → 0.49
su_v (suv-lp) wrote :

Oops - my mistake: changing status to 'Fix Released' in accordance to [1] - the reported issue never occurred in a released version, only in current trunk. Please revert the bug status to 'Fix Committed' if you don't agree.

[1] <http://wiki.inkscape.org/wiki/index.php/Bug_management>

The console warning should be tracked in a separate report.

Changed in inkscape:
milestone: 0.49 → none
status: Fix Committed → Fix Released
Changed in inkscape:
status: Fix Released → Fix Committed
milestone: none → 0.49
su_v (suv-lp) wrote :

Changing status to 'Fix Released' in accordance to [1] - the reported issue never occurred in a released version, only in current trunk. Please revert the bug status to 'Fix Committed' if you don't agree (or reopen a discussion about this aspect of bug management in the wiki/mailing list).

[1] <http://wiki.inkscape.org/wiki/index.php/Bug_management>

Changed in inkscape:
milestone: 0.49 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers