crash when operating on large eps data

Bug #826465 reported by CeDeROM
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Inkscape crash when replicating attached EPS above 5 times (to create production mask). The issue repeats always with noticable memory consumption, but increasing swap space does not help. I am using port version of inkscape-0.48.0_3 on FreeBSD 8.2-RELEASE. Please advise as this blocks my work :-) Below is the gdb output. Because gdb tells something is wrong with the stack I also mark this as potential security issue.

Best regards,
Tomek Cedro

%gdb inkscape
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"..."/usr/home/cederom/tmp/inkscape": not in executable format: File truncated

(gdb) run
Starting program:
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) q
%rm inkscape
%gdb inkscape | tee inkscape-tee-gdb.log
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/inkscape
(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)...(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)...(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)...(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)...(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)...(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)...(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)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[New LWP 100150]
(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)...(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)...(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)...(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)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[New Thread 2ae01140 (LWP 100150)]
(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)...[New Thread 30a88300 (LWP 100231)]
[New Thread 30a88080 (LWP 100232)]
[New Thread 30a87540 (LWP 100233)]
[New Thread 30a87180 (LWP 100234)]
[New Thread 30a872c0 (LWP 100235)]
[Thread 30a88080 (LWP 100232) exited]
[Thread 30a872c0 (LWP 100235) exited]
[Thread 30a87180 (LWP 100234) exited]
[Thread 30a88300 (LWP 100231) exited]
[Thread 30a87540 (LWP 100233) exited]
[New Thread 30a88080 (LWP 100231)]
[New Thread 30a872c0 (LWP 100232)]
[New Thread 30a87180 (LWP 100233)]
[New Thread 30a88300 (LWP 100234)]
[New Thread 30a87540 (LWP 100235)]
[New Thread 4d19c0c0 (LWP 100236)]
[New Thread 4d19bf80 (LWP 100237)]
[New Thread 4d19bd00 (LWP 100238)]
[New Thread 4d19ba80 (LWP 100239)]
[New Thread 4d19be40 (LWP 100240)]
[Thread 30a872c0 (LWP 100232) exited]
[Thread 30a88080 (LWP 100231) exited]
[Thread 30a87540 (LWP 100235) exited]
[Thread 4d19bd00 (LWP 100238) exited]
[Thread 30a87180 (LWP 100233) exited]
[Thread 4d19bf80 (LWP 100237) exited]
[Thread 4d19c0c0 (LWP 100236) exited]
[Thread 30a88300 (LWP 100234) exited]
[Thread 4d19be40 (LWP 100240) exited]
[Thread 4d19ba80 (LWP 100239) exited]
terminate called after throwing an instance of 'std::bad_alloc'
  what(): std::bad_alloc

Program received signal SIGABRT, Aborted.
[Switching to Thread 2ae01140 (LWP 100150)]
0x2a63366b in thr_kill () from /lib/libc.so.7
(gdb) bt
#0 0x2a63366b in thr_kill () from /lib/libc.so.7
#1 0x2a5d9916 in pthread_kill () from /lib/libthr.so.3
#2 0x2a5d7393 in raise () from /lib/libthr.so.3
#3 0x2a6d66ca in abort () from /lib/libc.so.7
#4 0x2a536a10 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#5 0x2a53b21a in std::set_unexpected () from /usr/lib/libstdc++.so.6
#6 0x2a53b262 in std::terminate () from /usr/lib/libstdc++.so.6
#7 0x2a53b15a in __cxa_throw () from /usr/lib/libstdc++.so.6
#8 0x2a58fcfe in operator new () from /usr/lib/libstdc++.so.6
#9 0x080d4a20 in std::vector<char const*, std::allocator<char const*> >::_M_insert_aux ()
#10 0x08132bf0 in std::_List_base<std::string, std::allocator<std::string> >::_M_clear ()
#11 0x08104260 in std::vector<char, std::allocator<char> >::operator= ()
#12 0x08106a20 in std::vector<char, std::allocator<char> >::operator= ()
#13 0x08104260 in std::vector<char, std::allocator<char> >::operator= ()
#14 0x08106a20 in std::vector<char, std::allocator<char> >::operator= ()
#15 0x08104260 in std::vector<char, std::allocator<char> >::operator= ()
#16 0x080d26fb in std::vector<char const*, std::allocator<char const*> >::_M_insert_aux ()
#17 0x0860a79e in std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique ()
#18 0x08602aee in std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_insert_unique ()
#19 0x080960e1 in std::list<sigc::slot_base, std::allocator<sigc::slot_base> >::erase ()
#20 0x0827e713 in Glib::PropertyProxy<bool>::set_value ()
#21 0x29a10db3 in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.0
#22 0x29a2791b in g_signal_handlers_block_matched () from /usr/local/lib/libgobject-2.0.so.0
#23 0x29a290b1 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#24 0x294291d1 in gtk_signal_emit () from /usr/local/lib/libgtk-x11-2.0.so.0
#25 0x0862c926 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#26 0x0862cbb7 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#27 0x0827e97c in Glib::PropertyProxy<bool>::set_value ()
#28 0x29a0f677 in g_value_set_static_boxed () from /usr/local/lib/libgobject-2.0.so.0
#29 0x29a10db3 in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.0
#30 0x29a27cd9 in g_signal_handlers_block_matched () from /usr/local/lib/libgobject-2.0.so.0
#31 0x29a290b1 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#32 0x294291d1 in gtk_signal_emit () from /usr/local/lib/libgtk-x11-2.0.so.0
#33 0x081e5340 in std::vector<double, std::allocator<double> >::operator= ()
#34 0x081e7ee2 in std::vector<double, std::allocator<double> >::operator= ()
#35 0x2929c094 in gtk_marshal_BOOLEAN__VOID () from /usr/local/lib/libgtk-x11-2.0.so.0
#36 0x29a0f677 in g_value_set_static_boxed () from /usr/local/lib/libgobject-2.0.so.0
#37 0x29a10db3 in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.0
#38 0x29a27cd9 in g_signal_handlers_block_matched () from /usr/local/lib/libgobject-2.0.so.0
#39 0x29a290b1 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#40 0x29a29665 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.0
#41 0x293c3126 in gtk_widget_style_attach () from /usr/local/lib/libgtk-x11-2.0.so.0
#42 0x29294bfe in gtk_propagate_event () from /usr/local/lib/libgtk-x11-2.0.so.0
#43 0x29296082 in gtk_main_do_event () from /usr/local/lib/libgtk-x11-2.0.so.0
#44 0x2957c49a in gdk_add_client_message_filter () from /usr/local/lib/libgdk-x11-2.0.so.0
#45 0x29a91969 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.0
#46 0x29a94ee6 in g_main_context_prepare () from /usr/local/lib/libglib-2.0.so.0
#47 0x29a95227 in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.0
#48 0x29296504 in gtk_main () from /usr/local/lib/libgtk-x11-2.0.so.0
#49 0x28b59937 in Gtk::Main::run_impl () from /usr/local/lib/libgtkmm-2.4.so.1
#50 0x28b59722 in Gtk::Main::run () from /usr/local/lib/libgtkmm-2.4.so.1
#51 0x0808c674 in ?? ()
#52 0x08182831 in sigc::visit_each<sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, sigc::trackable> ()
#53 0x08089f3d in ?? ()
#54 0x08089197 in ?? ()
#55 0x00000001 in ?? ()
#56 0xbfbfeb70 in ?? ()
#57 0xbfbfeb78 in ?? ()
#58 0xbfbfeb50 in ?? ()
#59 0xbfbfeb6c in ?? ()
#60 0x00000000 in ?? ()
#61 0xbfbfeb68 in ?? ()
#62 0x08089108 in ?? ()
Previous frame inner to this frame (corrupt stack?)
(gdb)

Revision history for this message
CeDeROM (cederom) wrote :
security vulnerability: yes → no
visibility: private → public
su_v (suv-lp)
tags: added: crash performance
Revision history for this message
su_v (suv-lp) wrote :

The EPS files imports with an (sorry for the wording) with an enormous bloat due to the dense hatching with individual horizontal lines so dense that it looks like a solid filling at zoom level 1:1).

Importing 5 such EPS files (just a single import of the file you attached, saved as SVG, has a file size of 15.9 MB and contains 55'517 paths) is very likely to exceed Inkscape's capacity or exhaust available memory and crash in the end with a memory error.

Duplicating or even cloning the group multiple times (i.e. a single EPS file imported into an empty Inkscape document instead of repeated imports, and then cloned (Alt+D) and laid out as needed for the "production mask") will not greatly improve the situation AFAICT (if you actually only need several copies of the same design on one sheet without editing each imported design individually):

With a single imported file and 5 clones of the top-level group (~333'100 paths to render, even though file size will no grow significantly beyond the 15.9MB since clones are single objects linking to the original without replicating its SVG structure in the file), Inkscape 0.48.2 on Mac OS X 10.5.8 (i396) with 2GB RAM consumes so much of the available memory that the whole system slows down close to a stand still, and even very basic operations in Inkscape can take minutes before the screen updates. I didn't see Inkscape crash due to memory-related issues (though I did force quit it since I needed to continue working with other applications).

With current trunk (new cairo renderer and rendering cache) performance has improved, but with 8 clones of a single imported EPS file, the memory consumption of Inkscape is getting as huge, and operations in Inkscape (in outline view mode) are still very slow (tested with revision 10588, because later revisions will not handle such a large amount of stroked paths well at the moment).

Additionally, since you seem to use an older version of Inkscape (0.48.0) on linux, it is possible that you are affected by
Bug #168914 in Inkscape: “Inkscape requires large-config support in libgc”
<https://bugs.launchpad.net/inkscape/+bug/168914>

> Please advise as this blocks my work (…)

Possibly you need to consider using a real CAD application (which Inkscape does not aim nor claim to be), or - with regard to generating the original EPS file - you could test whether not using such dense hatching with closely spaced horizontal lines (using solid filled areas instead) will improve the handling in Inkscape (unless ofc those lines are an integral part of the design and not intended to imitate a solid fill).

Revision history for this message
CeDeROM (cederom) wrote :

Hello :-) Thank you for your reply Suv :-) I have managed to resolve that problem with hatch/fill width increased setting in my Eagle CAD to produce smaller/simpler vector images. My FreeBSD box did not slow down but the application crashed. I was hoping to be able to edit even such complex images, maybe slowly but sometimes it is necessary :-) Best regards from Poland :-) Tomek.

Revision history for this message
Beluga (buovjaga) wrote :

I can't open it.

Traceback (most recent call last):
  File "ps2pdf-ext.py", line 25, in <module>
    from run_command import run
  File "/usr/share/inkscape/extensions/run_command.py", line 66
    except Exception, inst:
                    ^
SyntaxError: invalid syntax

Revision history for this message
jazzynico (jazzynico) wrote :

The file opens correctly on Windows XP, Inkscape 0.92.x rev. 15043 (Python 2.7).
@beluga - possibly a Python version issue (changes in the exception syntax in Python3?).

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.