Inkscape: A Vector Drawing Tool

Crash when importing certain PDFs

Reported by Michael Wiktowy on 2008-05-12
12
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
Unassigned
inkscape (Ubuntu)
Medium
Unassigned

Bug Description

Attempting to import a page of the following PDF crashes Inkscape:
http://www.cra-arc.gc.ca/E/pbg/tf/5000-s1/5000-s1-07e.pdf

It happens every time on either page.

Some of the other PDFs found on the Canadian Revenue Agency's website import perfectly. I have not tried all of them but one example that works fine is:
http://www.cra-arc.gc.ca/E/pbg/tf/5006-r/5006-r-07e.pdf
I am not certain what makes them different.

Here is the gdb bt of the crash (and some of the relevant preceeding stdout):

terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::append

Program received signal SIGABRT, Aborted.
[Switching to Thread -1208723680 (LWP 6210)]
0x00110402 in __kernel_vsyscall ()
(gdb) bt
#0 0x00110402 in __kernel_vsyscall ()
#1 0x00711690 in raise () from /lib/libc.so.6
#2 0x00712f91 in abort () from /lib/libc.so.6
#3 0x02d0bba0 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#4 0x02d09685 in ?? () from /usr/lib/libstdc++.so.6
#5 0x02d096c2 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0x02d097fa in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x02ca018f in std::__throw_length_error () from /usr/lib/libstdc++.so.6
#8 0x02ce6c43 in std::string::append () from /usr/lib/libstdc++.so.6
#9 0x00d7549a in Glib::ustring::append () from /usr/lib/libglibmm-2.4.so.1
#10 0x085b2c9d in ?? ()
#11 0x085b3552 in ?? ()
#12 0x085b832c in ?? ()
#13 0x085b8721 in ?? ()
#14 0x08597f3f in ?? ()
#15 0x08572c71 in ?? ()
#16 0x08571ba5 in ?? ()
#17 0x0808cac1 in ?? ()
#18 0x0808d3f5 in ?? ()
#19 0x083eda00 in ?? ()
#20 0x009e8409 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0
#21 0x009daf83 in g_closure_invoke () from /lib/libgobject-2.0.so.0
#22 0x009eb48d in ?? () from /lib/libgobject-2.0.so.0
#23 0x009ec997 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
#24 0x009ecb59 in g_signal_emit () from /lib/libgobject-2.0.so.0
#25 0x06fcddd9 in gtk_widget_activate () from /usr/lib/libgtk-x11-2.0.so.0
#26 0x06e5b782 in gtk_menu_shell_activate_item () from /usr/lib/libgtk-x11-2.0.so.0
#27 0x06e5a261 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#28 0x092ad7b8 in ?? ()
#29 0x09906c20 in ?? ()
#30 0x00000001 in ?? ()
#31 0x009f7891 in g_type_check_instance_cast () from /lib/libgobject-2.0.so.0
#32 0x06e4d6f0 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#33 0x092ad7b8 in ?? ()
#34 0x09aabaa0 in ?? ()
#35 0xbfe1b2f8 in ?? ()
#36 0x00a11674 in ?? () from /lib/libgobject-2.0.so.0
#37 0xbfe1b590 in ?? ()
#38 0x08d2f1c0 in ?? ()
#39 0xbfe1b2f8 in ?? ()
#40 0x009d82f1 in g_value_get_boxed () from /lib/libgobject-2.0.so.0
#41 0x06e42068 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#42 0x092ad7b8 in ?? ()
#43 0x09aabaa0 in ?? ()
#44 0x08ce3940 in ?? ()
#45 0x00a11674 in ?? () from /lib/libgobject-2.0.so.0
#46 0x06e4d568 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#47 0x08d2f1c0 in ?? ()
#48 0x092ad7b8 in ?? ()
#49 0x08ce3940 in ?? ()
#50 0xbfe1b57c in ?? ()
#51 0x08d2e328 in ?? ()
#52 0xbfe1b368 in ?? ()
#53 0x00000001 in ?? ()
#54 0x00a11674 in ?? () from /lib/libgobject-2.0.so.0
#55 0xbfe1b57c in ?? ()
#56 0xbfe1b368 in ?? ()
#57 0x009d9779 in ?? () from /lib/libgobject-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

Some additional information:
Platform: Fedora 8 - Gnome desktop
uname -a: Linux localhost.localdomain 2.6.24.5-85.fc8 #1 SMP Sat Apr 19 12:39:34 EDT 2008 i686 athlon i386 GNU/Linux
SW Version: Inkscape 0.46, built Apr 5 2008

Just tested the Win32 version of Inkscape 0.46 and it imports the problematic PDF with no problems.

Phil Mitchell (cranberry) wrote :

I have a very similar report -- crashing on one specific PDF (attached). I get the "PDF Import Settings" dialogue, but when I click okay it aborts. gdb output is below.

uname -a: Linux morchella 2.6.24-18-generic #1 SMP Wed May 28 20:27:26 UTC 2008 i686 GNU/Linux
Inkscape 0.46
Ubuntu 8.04 (Hardy)

gdb output:
...
terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::append

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb6228720 (LWP 7000)]
0xb7ef4410 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7ef4410 in __kernel_vsyscall ()
#1 0xb6799085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb679aa01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb69c1480 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#4 0xb69bed05 in ?? () from /usr/lib/libstdc++.so.6
#5 0xb69bed42 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb69bee6a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0xb69551bf in std::__throw_length_error () from /usr/lib/libstdc++.so.6
#8 0xb699b23d in std::string::append () from /usr/lib/libstdc++.so.6
#9 0xb7ab04ca in Glib::ustring::append () from /usr/lib/libglibmm-2.4.so.1
#10 0x085afc88 in ?? ()
#11 0x085b0792 in ?? ()
#12 0x085b5007 in ?? ()
#13 0x085b53db in ?? ()
#14 0x085bb056 in ?? ()
#15 0x085bb459 in ?? ()
#16 0x085bb79b in ?? ()
#17 0x085b5007 in ?? ()
#18 0x085b53db in ?? ()
#19 0x08591312 in ?? ()
#20 0x0856baa1 in ?? ()
#21 0x0856a9e5 in ?? ()
#22 0x0808fe8e in ?? ()
#23 0x0808795e in ?? ()
#24 0x081d5feb in ?? ()
#25 0x080874ef in ?? ()
#26 0xb6784450 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#27 0x08086a71 in ?? ()

Alvin Penner (apenner) wrote :

running Win32 nightly build from June 13, I get the same crash message :
C:\Python25\APP>inkcl.py
return code: 3
terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::append

Changed in inkscape:
status: New → Confirmed
Alvin Penner (apenner) wrote :

sorry, I should have specified, the file preview works perfectly, the crash occurs after the preview is accepted.

Elktro (roskaapostissa) wrote :

I have the same problem with this pdf:

http://www.jyu.fi/static/fysiikka/saariselka07/pdf/Marsh.pdf

If I try to select page 15 to be opened or imported I get this error:
username@server:~$ inkscape Desktop/Marsh.pdf
terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::append

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
Aborted

I managed to import the page by converting the pdf page to ps (pdftops) and back to pdf (ps2pdf).

uname -a: Linux ******* 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux
inkscape 0.46
Ubuntu 8.04

pbhj (pbhj) wrote :
Download full text (4.3 KiB)

Using the 5000-s1...pdf file I get a crash too after the preview of the page shows and you click OK, gdb gives:

(no debugging symbols found)
(no debugging symbols found)
[New Thread 0xb62cf720 (LWP 8930)]
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::append

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb62cf720 (LWP 8930)]
0xb7fa5410 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fa5410 in __kernel_vsyscall ()
#1 0xb6840085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb6841a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb6a68480 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#4 0xb6a65d05 in ?? () from /usr/lib/libstdc++.so.6
#5 0xb6a65d42 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb6a65e6a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0xb69fc1bf in std::__throw_length_error () from /usr/lib/libstdc++.so.6
#8 0xb6a4223d in std::string::append () from /usr/lib/libstdc++.so.6
#9 0xb7b574ca in Glib::ustring::append () from /usr/lib/libglibmm-2.4.so.1
#10 0x085afc88 in ?? ()
#11 0x085b0792 in ?? ()
#12 0x085b5007 in ?? ()
#13 0x085b53db in ?? ()
#14 0x08591312 in ?? ()
#15 0x0856baa1 in ?? ()
#16 0x0856a9e5 in ?? ()
#17 0x08090f71 in ?? ()
#18 0x080918eb in ?? ()
#19 0x083eedbd in ?? ()
#20 0xb74bfaff in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
#21 0xb74b2759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#22 0xb74c6f8b in ?? () from /usr/lib/libgobject-2.0.so.0
#23 0xb74c8c1f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#24 0xb74c8f69 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#25 0xb78b4278 in gtk_widget_activate () from /usr/lib/libgtk-x11-2.0.so.0
#26 0xb779dbc2 in gtk_menu_shell_activate_item () from /usr/lib/libgtk-x11-2.0.so.0
#27 0xb779f708 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#28 0xb7796914 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#29 0xb77908d4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#30 0xb74b1079 in ?? () from /usr/lib/libgobject-2.0.so.0
#31 0xb74b2759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#32 0xb74c711a in ?? () from /usr/lib/li...

Read more...

I did this (I think you can use pdf2pdf to do this too):

"pstoedit -f gs:pdfwrite ~/Desktop/5000-s1-07e.pdf ~/Desktop/5000r.pdf"

and the resulting 5000r.pdf (10KB smaller!) imported without problems - there is something about japanese characters mentioned in the terminal however.

ScislaC (scislac) wrote :

This appears to be library related issue as Inkscape 0.46 on Ubuntu Intrepid does not exhibit the problem. Unfortunately I do not have a Hardy install available for further testing. However, I am attaching a patch submitted to us by Adrian Knoth. If someone could build the Inkscape 0.46 tarball, apply the patch, and test on Hardy with the above example files it would be greatly appreciated.

bbyak (buliabyak) wrote :

the patch by Adrian Knoth is now in SVN

Changed in inkscape:
status: Confirmed → Fix Released
Phil Mitchell (cranberry) wrote :

I just built Inkscape 0.46 w/ AK's patch on Hardy and now Inkscape does not import any PDFs. It doesn't crash, but I just get a message "Failed to load the requested file <filename>". It does this even on PDFs that a clean 0.46 handles fine.

FYI, this is the first time I've built Inkscape, so it's possible that I screwed something up -- however, Inkscape does appear to be working, I can draw in it, etc.

mahfiaz (mahfiaz) wrote :

Phil Mitchell, could you try the development version out?
Just follow the guide in wiki http://www.inkscape.org/wiki/index.php/CompilingUbuntu

Phil Mitchell (cranberry) wrote :

Sorry for the slow response on this ...

I just built Inkscape 0.46-devel and got the same result: Inkscape does not import any PDFs. It doesn't crash, but I just get a message "Failed to load the requested file <filename>". It does this even on PDFs that a clean 0.46 handles fine.

I did notice error output on the command line which I had overlooked before:

<filename.pdf>:1: parser error : Start tag expected, '<' not found

Brian Murray (brian-murray) wrote :

I was unable to recreate this using the PDF attached with Inkscape version 0.46-5ubuntu1 on the Jackalope.

Changed in inkscape (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers