Bug#728354: inkscape: segfault on importing from Open Clip Art Library

2013-10-31 Thread Alex Valavanis
forwarded 728354 https://bugs.launchpad.net/inkscape/+bug/1246763
thanks

On 31 October 2013 03:33, Vasil Velichkov vvvelich...@gmail.com wrote:
 Package: inkscape
 Version: 0.48.3.1-1.3
 Followup-For: Bug #728354

 Dear Maintainer,

 I was able to fix the problem.
 Patch attached.

 Cheers

 P.S. The branch master.wip is missing

 $ cat debian/gbp.conf
  debian-branch = master.wip

 $ git branch -r
   origin/HEAD - origin/master
   origin/master
   origin/pristine-tar
   origin/upstream


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#728354: inkscape: segfault on importing from Open Clip Art Library

2013-10-30 Thread Vasil Velichkov
Package: inkscape
Version: 0.48.3.1-1.3
Severity: important

Dear Maintainer,

Here are the steps that I used to reproduce the bug on my machine.

* Click menu “File” -- “Import from Open Clip Art” 
* Type Tubo de Ensaio
* Click Search
* Select the fist or second item in the list

X dialog appears: “Inkscape encountered an internal error and will close
now

The console output:

 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.
 Segmentation fault (core dumped)

I have recompiled the package from source in order to get usable backtrace

 DEB_BUILD_OPTIONS=nostrip noopt fakeroot apt-get -b source inkscape

And here is the backtrace:

$ gdb inkscape core 
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/bin/inkscape...done.
[New LWP 16264]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
Core was generated by `inkscape'.
Program terminated with signal 11, Segmentation fault.
#0  __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp.S:260
260 ../sysdeps/x86_64/multiarch/strcmp.S: No such file or directory.
(gdb) bt
#0  __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp.S:260
#1  0x014269d2 in cr_rgb_set_from_name (a_this=0x7fff53355ad0, 
a_color_name=0x7db9a20 none) at libcroco/cr-rgb.c:422
#2  0x7fad31950aff in rsvg_css_parse_color (str=optimized out, 
inherit=0x7db97e4) at rsvg-css.c:380
#3  0x7fad319683a0 in rsvg_parse_style_pair (important=0, value=0x7db9a20 
none, name=0x7db9980 stop-color, state=0x7db9640, ctx=0x6213450)
at rsvg-styles.c:756
#4  rsvg_parse_style_pair (ctx=0x6213450, state=0x7db9640, name=0x7db9980 
stop-color, value=0x7db9a20 none, important=0) at rsvg-styles.c:463
#5  0x7fad31969780 in rsvg_parse_style (ctx=0x6213450, state=0x7db9640, 
str=optimized out) at rsvg-styles.c:972
#6  0x7fad31952734 in rsvg_stop_set_atts (self=0x7db95e0, ctx=0x6213450, 
atts=0x6b948c0) at rsvg-paint-server.c:206
#7  0x7fad3196c052 in rsvg_node_set_atts (atts=0x6b948c0, ctx=0x6213450, 
node=0x7db95e0) at rsvg-base.c:1952
#8  rsvg_standard_element_start (ctx=0x6213450, name=optimized out, 
atts=0x6b948c0) at rsvg-base.c:283
#9  0x7fad3196f548 in rsvg_start_element (data=0x6213450, name=optimized 
out, atts=optimized out) at rsvg-base.c:647
#10 0x7fad46eec668 in xmlParseStartTag__internal_alias 
(ctxt=ctxt@entry=0x7d6e450) at ../../parser.c:8411
#11 0x7fad46ef4ff0 in xmlParseTryOrFinish (ctxt=ctxt@entry=0x7d6e450, 
terminate=terminate@entry=0) at ../../parser.c:11120
#12 0x7fad46ef5d61 in xmlParseChunk__internal_alias (ctxt=0x7d6e450, 
chunk=0x7fff53356160 ?xml version=\1.0\ encoding=\UTF-8\ 
standalone=\no\?\n!-- Created with Inkscape (http://www.inkscape.org/) 
--\nsvg xmlns:dc=\http://purl.org/dc/elements/1.1/\; 
xmlns:cc=\http://web.resource.org/cc/\;..., size=28252, terminate=0) at 
../../parser.c:11897
#13 0x7fad3196ecef in rsvg_handle_write_impl (error=0x7fff533671f8, 
count=28252, 
buf=0x7fff53356160 ?xml version=\1.0\ encoding=\UTF-8\ 
standalone=\no\?\n!-- Created with Inkscape (http://www.inkscape.org/) 
--\nsvg xmlns:dc=\http://purl.org/dc/elements/1.1/\; 
xmlns:cc=\http://web.resource.org/cc/\;..., handle=0x6213450) at 
rsvg-base.c:1121
#14 rsvg_handle_write (handle=0x6213450, 
buf=0x7fff53356160 ?xml version=\1.0\ encoding=\UTF-8\ 
standalone=\no\?\n!-- Created with Inkscape (http://www.inkscape.org/) 
--\nsvg xmlns:dc=\http://purl.org/dc/elements/1.1/\; 
xmlns:cc=\http://web.resource.org/cc/\;..., count=28252, 
error=0x7fff533671f8) at rsvg-base.c:1680
#15 0x7fad31b7dd51 in gdk_pixbuf__svg_image_load_increment (data=0x7ce5820, 
buf=0x7fff53356160 ?xml version=\1.0\ encoding=\UTF-8\ 
standalone=\no\?\n!-- Created with Inkscape (http://www.inkscape.org/) 
--\nsvg xmlns:dc=\http://purl.org/dc/elements/1.1/\; 
xmlns:cc=\http://web.resource.org/cc/\;..., size=28252, error=0x7fff533671f8) 
at io-svg.c:135
#16 0x7fad43df2394 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#17 0x7fad43df25ac in gdk_pixbuf_new_from_file () from 
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#18 0x7fad46332a21 in Gdk::Pixbuf::create_from_file(std::string const) () 
from /usr/lib/libgdkmm-2.4.so.1
#19 0x0104f18b in Inkscape::UI::Dialog::SVGPreview::showImage 

Bug#728354: inkscape: segfault on importing from Open Clip Art Library

2013-10-30 Thread Vasil Velichkov
Package: inkscape
Version: 0.48.3.1-1.3
Followup-For: Bug #728354

Dear Maintainer,

I was able to fix the problem.
Patch attached.

Cheers

P.S. The branch master.wip is missing

$ cat debian/gbp.conf
 debian-branch = master.wip

$ git branch -r
  origin/HEAD - origin/master
  origin/master
  origin/pristine-tar
  origin/upstream
From 32d391e4fac4a65bbb8377d844f014ffa0c6ed95 Mon Sep 17 00:00:00 2001
From: Vasil Velichkov vvvelich...@gmail.com
Date: Thu, 31 Oct 2013 05:03:11 +0200
Subject: [PATCH] Properly check gv_standard_colors array bounds

This fixes a segmentation fault.

Closes: #728354
---
 src/libcroco/cr-rgb.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c
index 893c208..b7f89a5 100644
--- a/src/libcroco/cr-rgb.c
+++ b/src/libcroco/cr-rgb.c
@@ -418,14 +418,14 @@ cr_rgb_set_from_name (CRRgb * a_this, const guchar * a_color_name)
 
 g_return_val_if_fail (a_this  a_color_name, CR_BAD_PARAM_ERROR);
 
-for (i = 0; i  sizeof (gv_standard_colors); i++) {
+for (i = 0; i  (sizeof (gv_standard_colors) / sizeof (gv_standard_colors[0])); i++) {
 if (!strcmp ((char *)a_color_name, gv_standard_colors[i].name)) {
 cr_rgb_set_from_rgb (a_this, gv_standard_colors[i]);
 break;
 }
 }
 
-if (i  sizeof (gv_standard_colors))
+if (i  (sizeof (gv_standard_colors) / sizeof (gv_standard_colors[0])))
 status = CR_OK;
 else
status = CR_UNKNOWN_TYPE_ERROR;
-- 
1.7.10.4