color gesture problems, alpha values below 0 and above 1, hue "was" values like 1.12e-08 and -9.31e-10

Bug #1281859 reported by Cojnel on 2014-02-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Low
jazzynico

Bug Description

linux mint 16 32bit
default preferences

Update:
tried it in the stable version and found a crash.

v0.48.4 r9939:

draw a rect,
then start color gesturing,
when a modifier key is pressed or released,
or if the mouse button is released,
then the terminal outputs:
(inkscape:4485): Gdk-CRITICAL **: IA__gdk_cursor_unref: assertion 'cursor->ref_count > 0' failed

While color gesturing, if the cursor is moved back and forth over the bottom left fill style indicator and one presses the modifier keys to change the cursor, then inkscape crashes,
sometimes the terminal stops at this message:

*** Error in `/home/username/Applications/inkscape-0.48.4/bin/inkscape': corrupted double-linked list: 0x0c3d5f90 ***

and ctrl+c has to be pressed to return to the (gdb) prompt.

Othertimes it crashes with:
Program received signal SIGSEGV, Segmentation fault.
0xb6cef5e4 in XFreeCursor () from /usr/lib/i386-linux-gnu/libX11.so.6

and returns to the (gdb) prompt automatically,
here's the backtrace:
#0 0xb6cef5e4 in XFreeCursor () from /usr/lib/i386-linux-gnu/libX11.so.6
#1 0xb7671dca in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#2 0xb7641bfa in gdk_cursor_unref ()
   from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#3 0xb768eb7c in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#4 0xb7666687 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#5 0xb76688aa in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#6 0xb766ba92 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#7 0xb76800bf in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#8 0xb768014d in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#9 0xb70f083e in g_main_context_dispatch ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#10 0xb70f0be8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#11 0xb70f104b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#12 0xb78053e0 in gtk_main () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#13 0xb7e39aa4 in Gtk::Main::run_impl() ()
   from /usr/lib/i386-linux-gnu/libgtkmm-2.4.so.1
#14 0xb7e3a1df in Gtk::Main::run() ()
   from /usr/lib/i386-linux-gnu/libgtkmm-2.4.so.1
#15 0x08230507 in sp_main_gui (argc=1, argv=0xbffff1c4) at main.cpp:978
#16 0x08300d6d in Inkscape::NSApplication::Application::run (
    this=this@entry=0xbffff0fc) at application/application.cpp:114
#17 0x0820dde2 in main (argc=1, argv=0xbffff1c4) at main.cpp:714
,

r13033:

Color gestures:
with the alt modifier key held down,
the alpha values can be set down to -0.5 and up to 1.5,
when the alpha value is changed on a gradient stop,
and the value is outside 0 and 1,
then the terminal outputs a critical message (see below).

With no modifier key held down:
The hues status bar "was" section shows
values like, 1.12e-08 and -9.31e-10,
when the cursor is in the bottom right
half of the screen.

Reproduced by:
1. draw a rect
2. draw a gradient on the rectangle
3. with one of the gradients stops selected
4. hold down the left mouse button on the
  fill style indicator in the bottom left
  corner and drag the mouse cursor onto
  the canvas
5. hold down the alt key and move the mouse
  slightly to update the status bar message,
  the alpha/opacity starts with a value of 1.0
6. move the cursor towards the top left,
  the alpha value goes up to 1.5,
  and the terminal outputs:

** (inkscape:6661): CRITICAL **: guint32 SPColor::toRGBA32(gdouble) const: assertion 'alpha <= 1.0' failed

Expected result:
The alpha should be limited to 1.0 as it's
highest value, and 0 as it's lowest value.

Actual result:
The alpha values go up to 1.5 and down to -0.5,
and outputs the error message,
when applied to a gradient stop.

Additional notes:
When the alpha for the gradient stop is
below 0 or above 1, then any transformation
done to the rect will output more of those messages.

The range of the color gestures alpha is
0.5 below or above the starting value.

The alpha of a gradient stop gets reset to 1
when the alt modifier is released and the
mouse is moved, to see that it's value can
go down to -0.5,
open the xml editor and select a gradient stop,
it's under
<svg:svg...>
 <svg:defs...>
  <svg:linearGradient...>
   <svg:stop...>
then select the style attribute,

follow steps 1 to 5 above, but move to the
bottom right corner, keep holding down the
alt modifier key and release the mouse button,
now repeat the process above with the alt key
pressed, eventually the stop-opacity reaches -0.5.

The alpha can also be changed outside
the 0 to 1 range on other objects aswell
(shape, text, path), but no error messages
are produced, and the opacity doesn't return
to 1 after releasing the alt key,
so it's easier to reproduce the outlier values.

On the fill and stroke page of the inkscape manual:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html

In the Color Gestures section, it states that:
"The Alt modifier disables changes to the color
so that the cursor can be repositioned."

Since the alt modifier key changes the
alpha instead of disabling changes,
then the manual should probably be updated.

su_v (suv-lp) wrote :

On 2014-02-19 02:38 +0100, Cojnel wrote:
> Since the alt modifier key changes the alpha instead of disabling
> changes, then the manual should probably be updated.

Tav's manual documents the current stable version - adjusting the Alpha valua via mouse gesture or scrolling + 'Alt' modifier however is a new feature in trunk (r12822, bug #171890). This is not the time yet to partially rewrite the manual based on changed features in trunk ;-)

tags: removed: documentation
Cojnel (cojnel) wrote :

Your right, i got ahead of myself,
(note to self): don't post to launchpad at 3am :)

Cojnel (cojnel) on 2014-02-19
description: updated
jazzynico (jazzynico) wrote :

*** 0.48.x ***

> (inkscape:4485): Gdk-CRITICAL **: IA__gdk_cursor_unref: assertion 'cursor->ref_count > 0' failed

Fixed in the trunk, revision 11429 (see Bug #943200 "Gdk-CRITICAL warnings when using color gestures").

> While color gesturing, if the cursor is moved back and forth over the bottom left fill style indicator and one presses the modifier keys to change the cursor, then inkscape crashes,

Not reproduced on Windows XP, Inkscape 0.48.4 and trunk revision 13064.

*** trunk ***

> with the alt modifier key held down, the alpha values can be set down to -0.5 and up to 1.5,

and

> The alpha values go up to 1.5 and down to -0.5, and outputs the error message, when applied to a gradient stop.

Reproduced with r13064.

Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.91
status: New → Triaged
jazzynico (jazzynico) wrote :

The attached patch should fix the issue by keeping the alpha value between 0 and 1.

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
status: Triaged → In Progress
jazzynico (jazzynico) wrote :

Fixed in the trunk, revision 13074.

Feel free to open a different report if Inkscape (trunk version) crashes again.

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

Other bug subscribers