Segmentation fault (display/grayscale.cpp problem)

Bug #723446 reported by dopelover on 2011-02-22
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Unassigned

Bug Description

Inkscape crashes while starting.

This is GDB output:
Program received signal SIGSEGV, Segmentation fault.
0x081c22fb in Grayscale::activeDesktopIsGrayscale ()
    at display/grayscale.cpp:76
76 return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORRENDERMODE_GRAYSCALE);

This issue concerns Inkscape 0.48 rev. 10068 on Ubuntu 10.10.

su_v (suv-lp) wrote :

Could you add the backtrace from gdb after the segfault?

So far, there have been no other reports about crashes related to the recently added feature in r10065.
See also:
<http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/35984>

tags: added: crash
Changed in inkscape:
importance: Undecided → High
dopelover (dopelover) wrote :
Download full text (3.7 KiB)

This is the backtrace you asked for.

----------------------------------

(gdb) bt
#0 0x081c22fb in Grayscale::activeDesktopIsGrayscale ()
    at display/grayscale.cpp:76
#1 0x080edeec in sp_lg_fill (painter=0xc947ef0, pb=0xbfffe0e4)
    at sp-gradient.cpp:1732
#2 0x0819d3d0 in nr_arena_render_paintserver_fill (pb=0xbfffead8,
    area=0xbfffe478, painter=0xc947ef0, opacity=1, mask=0xbfffe26c)
    at display/nr-arena.cpp:154
#3 0x081a7ce4 in nr_arena_shape_render (ct=0x0, item=0xc393920,
    area=0xbfffe478, pb=0xbfffead8, flags=1) at display/nr-arena-shape.cpp:918
#4 0x081a0fab in nr_arena_item_invoke_render (ct=0x0, item=0xc393920,
    area=0xbfffe618, pb=0xbfffead8, flags=<value optimized out>)
    at display/nr-arena-item.cpp:589
#5 0x081a1d5d in nr_arena_group_render (ct=0x0, item=0xc38fa00,
    area=0xbfffe618, pb=0xbfffead8, flags=1) at display/nr-arena-group.cpp:228
#6 0x081a0fab in nr_arena_item_invoke_render (ct=0x0, item=0xc38fa00,
    area=0xbfffe7b8, pb=0xbfffead8, flags=<value optimized out>)
    at display/nr-arena-item.cpp:589
#7 0x081a1d5d in nr_arena_group_render (ct=0x0, item=0xa8a1b00,
    area=0xbfffe7b8, pb=0xbfffead8, flags=1) at display/nr-arena-group.cpp:228
#8 0x081a0fab in nr_arena_item_invoke_render (ct=0x0, item=0xa8a1b00,
    area=0xbfffe958, pb=0xbfffead8, flags=<value optimized out>)
    at display/nr-arena-item.cpp:589
#9 0x081a1d5d in nr_arena_group_render (ct=0x0, item=0xa863f00,
---Type <return> to continue, or q <return> to quit---
    area=0xbfffe958, pb=0xbfffead8, flags=1) at display/nr-arena-group.cpp:228
#10 0x081a0fab in nr_arena_item_invoke_render (ct=0x0, item=0xa863f00,
    area=0xbfffeb04, pb=0xbfffead8, flags=<value optimized out>)
    at display/nr-arena-item.cpp:589
#11 0x0833d3e4 in sp_icon_doc_icon (doc=0x9062f00, root=0xa863f00,
    name=0x9c8d85c "color_management", psize=12) at widgets/icon.cpp:1188
#12 0x0833d867 in IconImpl::load_svg_pixels (names=..., psize=12)
    at widgets/icon.cpp:1295
#13 0x08340bf7 in IconImpl::prerenderIcon (name=0x9cadf38 "color-management",
    lsize=9, psize=12) at widgets/icon.cpp:1419
#14 0x0834a5e7 in IconImpl::newFull (lsize=Inkscape::ICON_SIZE_DECORATION,
    name=0x9cadf38 "color-management") at widgets/icon.cpp:777
#15 0x0860f408 in sp_button_set_action (button=0x8a9e148, action=0x9069f50)
    at widgets/button.cpp:250
#16 0x0860f608 in sp_button_new (size=Inkscape::ICON_SIZE_DECORATION,
    type=SP_BUTTON_TYPE_TOGGLE, action=0x9069f50, doubleclick_action=0x0,
    tooltips=0x8a98e90) at widgets/button.cpp:201
#17 0x0860f6a8 in sp_button_new_from_data (
    size=Inkscape::ICON_SIZE_DECORATION, type=SP_BUTTON_TYPE_TOGGLE, view=0x0,
    name=0x87ae44f "color-management",
    tip=0x9cae3c0 "Włącza/wyłącza zarządzanie kolorem monitora dla okna tego dokumentu", tooltips=0x8a98e90) at widgets/button.cpp:324
#18 0x08334bd9 in SPDesktopWidget::init (dtw=0x984b028)
---Type <return> to continue, or q <return> to quit---
    at widgets/desktop-widget.cpp:415
#19 0x01a195df in g_type_create_instance () from /usr/lib/libgobject-2.0.so.0
#20 0x019fd885 in ?? () from /usr/lib/libgobject-2.0.so.0
#21 0x019fbe27 in g_object_newv () from /usr/lib...

Read more...

dopelover (dopelover) wrote :

I discovered that this issue is related to my particular inkscape configuration. Removing inkscape confiuration directory solves the problem. There is my config attached to this message in the case when somebody would like to investigate this issue.

su_v (suv-lp) wrote :

Crash reproduced with Inkscape 0.48+devel r10078 on OS X 10.5.8 (i386)

With this change in the preferences file:
    <group
       id="iconrender"
- named_nodelay="1" />
+ named_nodelay="0" />

Inkscape launches again, but I have not been able to reproduce this by changing this setting in a default preferences file, nor to figure out which combination of settings (in addition to 'Pre-render named icons') actually triggers the crash.

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp) wrote :

@Johan - any idea what is happening here?

Jakub Steiner (jimmac-redhat) wrote :

While the names_nodelay workaround works for the GUI, running inkscape from the commandline, even with preferences.xml nuked will still result in this crash:

Starting program: /opt/artlibre/bin/inkscape inkscape -e fancy_closebox.png fancy_closebox.svg
[Thread debugging using libthread_db enabled]

** (inkscape:9691): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape:9691): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape:9691): WARNING **: Specified document inkscape cannot be opened (does not exist or not a valid SVG file)
Background RRGGBBAA: 00000000
Area 0:0:30:30 exported to 30 x 30 pixels (90 dpi)
Bitmap saved as: fancy_closebox.png

Program received signal SIGSEGV, Segmentation fault.
0x000000000078c2b9 in Grayscale::activeDesktopIsGrayscale ()
    at display/grayscale.cpp:76
76 return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORRENDERMODE_GRAYSCALE);

Jakub Steiner (jimmac-redhat) wrote :

ok, passed the arguments wrong, but the crash remains the same --

(gdb) run -e /home/jimmac/src/cvs/gnome/gnome3-web/css/fancy_closebox.png /home/jimmac/src/cvs/gnome/gnome3-web/css/fancy_closebox.svg
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /opt/artlibre/bin/inkscape -e /home/jimmac/src/cvs/gnome/gnome3-web/css/fancy_closebox.png /home/jimmac/src/cvs/gnome/gnome3-web/css/fancy_closebox.svg
[Thread debugging using libthread_db enabled]
Background RRGGBBAA: 00000000
Area 0:0:30:30 exported to 30 x 30 pixels (90 dpi)
Bitmap saved as: /home/jimmac/src/cvs/gnome/gnome3-web/css/fancy_closebox.png

Program received signal SIGSEGV, Segmentation fault.
0x000000000078c2b9 in Grayscale::activeDesktopIsGrayscale ()
    at display/grayscale.cpp:76
76 return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORRENDERMODE_GRAYSCALE);
(gdb)

Jakub Steiner (jimmac-redhat) wrote :

full BT:

(gdb) bt
#0 0x000000000078c2b9 in Grayscale::activeDesktopIsGrayscale ()
    at display/grayscale.cpp:76
#1 0x00000000006b94d7 in sp_rg_fill (painter=0x28d5510, pb=0x7fffffffd4f0)
    at sp-gradient.cpp:2016
#2 0x000000000076ac87 in nr_arena_render_paintserver_fill (pb=0x7fffffffd8b0,
    area=0x7fffffffd8e0, painter=0x28d5510, opacity=1, mask=0x7fffffffd680)
    at display/nr-arena.cpp:154
#3 0x00000000007754e1 in nr_arena_shape_render (ct=0x0, item=0x18e7960, area=
    0x7fffffffd8e0, pb=0x7fffffffd8b0, flags=1) at display/nr-arena-shape.cpp:918
#4 0x000000000076c846 in nr_arena_item_invoke_render (ct=0x0, item=0x18e7960,
    area=<value optimized out>, pb=0x7fffffffde90, flags=1)
    at display/nr-arena-item.cpp:589
#5 0x000000000076e74d in nr_arena_group_render (ct=0x0,
    item=<value optimized out>, area=0x7fffffffda80, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-group.cpp:228
#6 0x000000000076c846 in nr_arena_item_invoke_render (ct=0x0, item=0x18e6bd0,
    area=<value optimized out>, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-item.cpp:589
#7 0x000000000076e74d in nr_arena_group_render (ct=0x0,
    item=<value optimized out>, area=0x7fffffffdc20, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-group.cpp:228
#8 0x000000000076c846 in nr_arena_item_invoke_render (ct=0x0, item=0x18e6d20,
    area=<value optimized out>, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-item.cpp:589
#9 0x000000000076e74d in nr_arena_group_render (ct=0x0,
    item=<value optimized out>, area=0x7fffffffddc0, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-group.cpp:228
#10 0x000000000076c846 in nr_arena_item_invoke_render (ct=0x0, item=0x18e6e70,
    area=<value optimized out>, pb=0x7fffffffde90, flags=0)
    at display/nr-arena-item.cpp:589
#11 0x0000000000829076 in sp_export_get_rows (rows=0x29308f0,
    row=<value optimized out>, num_rows=30, data=0x7fffffffe050)
    at helper/png-write.cpp:351
#12 0x00000000008295d4 in sp_png_write_rgba_striped (doc=0x18def00, filename=
    0x7fffffffdfb8 "\300Ѝ\002", width=30, height=30, xdpi=90, ydpi=90, data=
    0x7fffffffe050, get_rows=
    0x828e60 <sp_export_get_rows(guchar const**, int, int, void*)>)
    at helper/png-write.cpp:276
#13 0x0000000000829a53 in sp_export_png_file (doc=0x18def00, filename=
    0x28d2590 "fancy_closebox.png", area=<value optimized out>, width=30, height=
    30, xdpi=90, ydpi=90, bgcolor=<value optimized out>, status=0, data=0x0,
    force_overwrite=true, items_only=0x0) at helper/png-write.cpp:482
#14 0x000000000065233c in sp_do_export_png (doc=0x18def00) at main.cpp:1472
#15 0x000000000065421e in sp_process_file_list (fl=0x149ce80 = {...})
    at main.cpp:1036
#16 0x00000000006548d9 in sp_main_console (argc=4, argv=0x7fffffffe3b8)
    at main.cpp:1176
#17 0x0000003336c1ee5d in __libc_start_main () from /lib64/libc.so.6
#18 0x00000000006518f9 in _start ()

su_v (suv-lp) wrote :

A way to reproduce the crash when launching Inkscape with GUI:

1) quit inkscape and reset the preferences (rename ~/.config/inkscape/preferences.xml)
2) launch inkscape, activate 'Preferences > Misc > Pre-Render named icons'
3) quit inkscape
4) delete inkscape's icon cache (rm -r ~/.cache/inkscape/icons)
5) launch inkscape

-> crash

LeWitt:~ suv$ ls -1R .cache/inkscape/icons/
12x12/
cache.info

.cache/inkscape/icons//12x12:
color-management.png
LeWitt:~ suv$

su_v (suv-lp) wrote :

@JonCruz - subscribing you too to this report: it seems that
- icon cache
- pre-render named icons
- grayscale display mode
don't work well together under certain circumstances and can cause Inkscape to crash when launched.

Changed in inkscape:
status: Confirmed → Triaged
Johan Engelen (johanengelen) wrote :

My fault. It should be fixed in rev. 10082

su_v (suv-lp) wrote :

Crash with the user profile from comment #3 and the steps detailed in comment #9 n longer reproduced with Inkscape 0.48+devel r10082 on OS X 10.5.8 (i386).

Can't verify if it also fixes the issue when using inkscape to export to PNG without GUI, since I haven't been able to reproduce the crash.

su_v (suv-lp) wrote :

typo:
- n longer reproduced with Inkscape 0.48+devel r10082
+ no longer reproduced with Inkscape 0.48+devel r10082

su_v (suv-lp) wrote :

@Jimmac - do you still get the same segmentation fault when using Inkscape to export to PNG on the command line with >= r10082?

Changed in inkscape:
status: Triaged → Incomplete
su_v (suv-lp) wrote :

~suv wrote on 2011-03-09:
> @Jimmac - do you still get the same segmentation fault when using
> Inkscape to export to PNG on the command line with >= r10082?

No further feedback - closing as 'Fix Released'. Please reopen or file a new report if related crashes still occur with ≥ r10082.

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

Other bug subscribers