reassign 271111 libart-lgpl
tags 271111 patch
thankyou
--

Ilya Konstantinov wrote:
> When running, gok prints out the following output and terminates:
> /dev/js0: No such file or directory
> 0 event types available
> login mode = false
> Word prediction dictionary contains a total of 3000 words
> gok: art_render_gradient.c:337: art_render_gradient_linear_render_8:
> Assertion (stops[ix-1].offset <= offset_fraction + 1e-6) ||
> ((stops[ix].offset > (1.0 - 1e-6)) && (offset_fraction < 1e-6 ))'
> failed.
> Aborted

I found the very same bug using Trinity Desktop in Ubuntu (but not in Debian).
When opening /usr/share/applications, konqueror aborts with this:
konqueror: art_render_gradient.c:337: art_render_gradient_linear_render_8: 
Assertion `(stops[ix-1].offset <= offset_fraction + 1e-6) || ((stops[ix].offset 
> (1.0 - 1e-6)) && (offset_fraction < 1e-6 ))' failed.

It seems to happen when reading softwarecenter.desktop and trying to open
/usr/share/icons/hicolor/16x16/apps/softwarecenter.svg.

Debugging info:

KDEDesktopMimeType::pixmap (this=0x7a9cc0, _url=..., _group=KIcon::Desktop, 
_force_size=16, _state=0, _path=0x0) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kio/kio/kmimetype.cpp:753
KIconLoader::loadIcon (this=0x4cede0, _name=..., group=KIcon::Desktop, size=16, 
state=0, path_store=0x0, canReturnNull=false) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/kiconloader.cpp:762
KSVGIconEngine::load (this=0x97b6f0, width=16, height=16, path=...) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconengine.cpp:658
KSVGIconEngineHelper::handleTags (this=0xb2c470, element=..., paint=true) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconengine.cpp:416
KSVGIconPainter::drawPath (this=0x898500, data=..., filled=true) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:2303
KSVGIconPainterHelper::drawBPath (this=0xa61700, bpath=0xd031a0) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:246
KSVGIconPainterHelper::drawPathInternal (this=0xa61700, vec=0xd03460, 
affine=0x7fffffff9c30) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:398
KSVGIconPainterHelper::applyGradient (this=0xa61700, svp=0xd046d0, fill=true) 
at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:666
KSVGIconPainterHelper::applyGradient (this=0xa61700, svp=0xd046d0, ref=...) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:565
KSVGIconPainterHelper::applyLinearGradient (this=0xa61700, svp=0xd046d0, 
ref=...) at 
/usr/local/src/bug-kicker-konqueror/kdelibs-trinity-3.5.13/kdecore/svgicons/ksvgiconpainter.cpp:481
art_render_invoke () from /usr/lib/libart_lgpl_2.so.2
art_svp_render_aa () from /usr/lib/libart_lgpl_2.so.2
art_render_invoke_callbacks () from /usr/lib/libart_lgpl_2.so.2
__GI___assert_fail (assertion=0x7ffff0477828 "(stops[ix-1].offset <= 
offset_fraction + 1e-6) || ((stops[ix].offset > (1.0 - 1e-6)) && 
(offset_fraction < 1e-6 ))", file=<optimized out>, line=337, 
function=<optimized out>) at assert.c:81

It's related to this bug: http://bugzilla.gnome.org/155472.
The patch suggested at this time (2004!) by Brian Tarricone was never applied
to libart but I think it should have been.
Please consider including it in Debian.

I'm not forwarding this bug to bugzilla.gnome.org.
They didn't applied this patch in 2004 and they closed all bugs relating to
libart-lgpl, in August 2011, because it's unmaintained.

Neither am I opening a bug in Ubuntu since I think it's not 'Ubuntu-specific'.
The bug doesn't happen in Debian but it is in Debian's libart_lgpl.

(I made another bug report at http://bugs.pearsoncomputing.net/554.)
(Patch attached)

-- 
Laurent Dard
Origin: other, http://bugzilla.gnome.org/155472#c1
Bug-Gnome: http://bugzilla.gnome.org/155472
Bug-Debian: http://bugs.debian.org/271111
Bug-Trinity:http://bugs.pearsoncomputing.net/554
Forwarded: http://bugzilla.gnome.org/155472#c1
Author: Brian J. Tarricone <bj...@cornell.edu>
Applied-Upstream: no
Description: Removes assert() statements that makes applications crash.
 Several applications (Xfce Desktop, Trinity Desktop, gok...) have been reported
 to crash when trying to render SVG files, because of asserts in the
 'art_render_gradient_linear_render_8' function, in file art_render_gradient.c.
 Now unmaintained by upstream (see http://bugzilla.gnome.org/155472#c4)
--- libart-lgpl.orig/art_render_gradient.c.orig	2004-10-15 00:41:51.444732640 -0700
+++ libart-lgpl/art_render_gradient.c	2004-10-15 00:45:47.125903656 -0700
@@ -30,7 +30,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#if 0
 #include <assert.h>
+#endif
 
 /* Hack to find out how to define alloca on different platforms.
  * Modified version of glib/galloca.h.
@@ -203,7 +205,9 @@
     }
 
   printf ("WARNING! bad ix %d in calc_color_at() [internal error]\n", ix);
+#if 0
   assert (0);
+#endif
 }
 
 static void
@@ -331,6 +335,7 @@
   printf ("Initial ix: %d\n", ix);
 #endif
   
+#if 0
   assert (ix > 0);
   assert (ix < n_stops);
   assert ((stops[ix-1].offset <= offset_fraction + EPSILON) ||
@@ -344,6 +349,17 @@
   assert ((offset_fraction != stops[ix].offset) ||
 	  (d_offset <= 0.0));
   */
+#else
+  if (!( (ix > 0) && (ix < n_stops)
+         && ((stops[ix-1].offset <= offset_fraction + EPSILON) ||
+             ((stops[ix].offset > (1.0 - EPSILON))
+              && (offset_fraction < EPSILON /* == 0.0*/)))
+         && (offset_fraction <= stops[ix].offset)))
+  {
+    printf ("art_render_gradient.c:%d: Old assert() failed!\n", __LINE__);
+    return;
+  }
+#endif
   
   while (width > 0)
     {

Reply via email to