crash adjusting slider when spinbutton has focus (GTK bug?)

Bug #168044 reported by Hans Nieser
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Critical
Buliabyak-users

Bug Description

Sometimes when I adjust both the blur spin button
(using my mouse's scrollwheel) and the slider (by
simply clicking and dragging), I get a crash. It
doesn't always happen but it seems that when performing
the following steps, it will eventually crash:

- Open attached file
- Select the blurred spiral
- Open the Fill and Stroke dialog
- Adjust blur by scrolling mousewheel on the spin button
- Click inside the spin button (on the actual value)
once using the left mouse button
- Move the blur slider
- If you repeat the above 2 steps, eventually it wll
crash for me.

It seems the current zoom and the blur value influence
the probability of this crash occuring. Using a zoom of
49% and a blur value of around 10 seems to be a good
setting (for the crash to occur)

I get the following on the console:

(inkscape:16006): Gtk-CRITICAL **: gtk_style_detach:
assertion `style->attach_count > 0' failed

(inkscape:16006): Gtk-WARNING **: GtkEntry - did not
receive focus-out-event. If you
connect a handler to this signal, it must return
FALSE so the entry gets the event as well

Gtk-ERROR **: file gtkentry.c: line 5266 (blink_cb):
assertion failed: (GTK_WIDGET_HAS_FOCUS (entry))
aborting...

Program received signal SIGTRAP, Trace/breakpoint trap.

And the backtrace:

#0 0xb73fb2fd in IA__g_logv (log_domain=<value
optimized out>, log_level=G_LOG_LEVEL_ERROR,
format=0xb7424c70 "file %s: line %d (%s): assertion
failed: (%s)",
    args1=0xbfb5cd0c "\021\205\214�\222\024") at
gmessages.c:493
#1 0xb73fb38a in IA__g_log (log_domain=0xb78b9ec1
"Gtk", log_level=G_LOG_LEVEL_ERROR, format=0xb7424c70
"file %s: line %d (%s): assertion failed: (%s)") at
gmessages.c:517
#2 0xb73fb402 in IA__g_assert_warning
(log_domain=0xb78b9ec1 "Gtk", file=0xb78c8511
"gtkentry.c", line=5266, pretty_function=0xb78c8f02
"blink_cb",
    expression=0xb78c84f4 "GTK_WIDGET_HAS_FOCUS
(entry)") at gmessages.c:552
#3 0xb76bc44f in blink_cb (data=0xa52b0d0) at
gtkentry.c:5266
#4 0xb73f39f9 in g_timeout_dispatch (source=0xb2c04c8,
callback=0x9c13c58, user_data=0xa52b0d0) at gmain.c:3422
#5 0xb73f3576 in IA__g_main_context_dispatch
(context=0x857b130) at gmain.c:2045
#6 0xb73f5f82 in g_main_context_iterate
(context=0x857b130, block=0, dispatch=1,
self=0x85d71a0) at gmain.c:2677
#7 0xb73f6376 in IA__g_main_context_iteration
(context=0x857b130, may_block=0) at gmain.c:2736
#8 0xb7743c24 in IA__gtk_main_iteration_do
(blocking=0) at gtkmain.c:1097
#9 0xb7d9a0de in Gtk::Main::iteration_impl () from
/usr/lib/libgtkmm-2.4.so.1
#10 0xb7d99fca in Gtk::Main::iteration () from
/usr/lib/libgtkmm-2.4.so.1
#11 0x08294935 in sp_canvas_paint_rect_internal
(canvas=0x85fb148, rect=<value optimized out>,
x_aborted_limit=0x0, y_aborted_limit=0x0) at
display/sp-canvas.cpp:1678
#12 0x08294cc0 in sp_canvas_paint_rect
(canvas=0x85fb148, xx0=-197, yy0=-608, xx1=544, yy1=96)
at display/sp-canvas.cpp:1812
#13 0x08294526 in do_update (canvas=0x85fb148) at
display/sp-canvas.cpp:1988
#14 0x08111892 in sp_document_maybe_done
(doc=0x8670fa0, key=0x8475e9d "fillstroke:blur",
event_type=151, event_description=@0xbfb5d188)
    at /usr/include/sigc++-2.0/sigc++/signal.h:544
#15 0x081e7cef in sp_fillstroke_blur_changed
(a=0x9ef6f80, dlg=0x8ac0738) at
dialogs/object-properties.cpp:421
#16 0xb747b4f8 in IA__g_cclosure_marshal_VOID__VOID
(closure=0xb05d108, return_value=0x0, n_param_values=1,
param_values=0xbfb5d450, invocation_hint=0xbfb5d2f8,
    marshal_data=0x81e7b40) at gmarshal.c:77
#17 0xb746d492 in IA__g_closure_invoke
(closure=0xb05d108, return_value=0x0, n_param_values=1,
param_values=0xbfb5d450, invocation_hint=0xbfb5d2f8) at
gclosure.c:490
#18 0xb747f3e6 in signal_emit_unlocked_R
(node=0x867f188, detail=0, instance=0x9ef6f80,
emission_return=0x0, instance_and_params=0xbfb5d450) at
gsignal.c:2440
#19 0xb7480469 in IA__g_signal_emit_valist
(instance=0x9ef6f80, signal_id=122, detail=0,
var_args=<value optimized out>) at gsignal.c:2199
#20 0xb7480720 in IA__g_signal_emit
(instance=0x9ef6f80, signal_id=122, detail=0) at
gsignal.c:2243
#21 0xb765396e in IA__gtk_adjustment_value_changed
(adjustment=0x9ef6f80) at gtkadjustment.c:363
#22 0xb7653c13 in IA__gtk_adjustment_set_value
(adjustment=0x9ef6f80, value=20.231999999999999) at
gtkadjustment.c:346
#23 0xb77bcbc8 in IA__gtk_spin_button_update
(spin_button=0xa52b0d0) at gtkspinbutton.c:2230
#24 0xb77be579 in gtk_spin_button_focus_out
(widget=0xa52b0d0, event=0x8ad66e8) at gtkspinbutton.c:946
#25 0xb7749f6d in _gtk_marshal_BOOLEAN__BOXED
(closure=0x858fca0, return_value=0xbfb5d82c,
n_param_values=2, param_values=0xbfb5d9a0,
invocation_hint=0xbfb5d848,
    marshal_data=0xb77be533) at gtkmarshalers.c:84
#26 0xb746b869 in g_type_class_meta_marshal
(closure=0x858fca0, return_value=0xbfb5d82c,
n_param_values=2, param_values=0xbfb5d9a0,
invocation_hint=0xbfb5d848, marshal_data=0xe4)
    at gclosure.c:567
#27 0xb746d492 in IA__g_closure_invoke
(closure=0x858fca0, return_value=0xbfb5d82c,
n_param_values=2, param_values=0xbfb5d9a0,
invocation_hint=0xbfb5d848) at gclosure.c:490
#28 0xb747f5dd in signal_emit_unlocked_R
(node=0x8601b00, detail=0, instance=0xa52b0d0,
emission_return=0xbfb5d98c,
instance_and_params=0xbfb5d9a0) at gsignal.c:2478
#29 0xb74804d9 in IA__g_signal_emit_valist
(instance=0xa52b0d0, signal_id=53, detail=0,
var_args=<value optimized out>) at gsignal.c:2209
#30 0xb7480720 in IA__g_signal_emit
(instance=0xa52b0d0, signal_id=53, detail=0) at
gsignal.c:2243
#31 0xb7876846 in gtk_widget_event_internal
(widget=0xa52b0d0, event=0x8ad66e8) at gtkwidget.c:3911
#32 0xb787be2a in IA__gtk_widget_event
(widget=0xa52b0d0, event=0x8ad66e8) at gtkwidget.c:3717
#33 0xb7885951 in do_focus_change (widget=0xa52b0d0,
in=0) at gtkwindow.c:4783
#34 0xb7886344 in gtk_window_real_set_focus
(window=0x8ac0738, focus=0xa11c8b0) at gtkwindow.c:4985
#35 0xb747b65c in IA__g_cclosure_marshal_VOID__OBJECT
(closure=0x8603c18, return_value=0x0, n_param_values=2,
param_values=0xbfb5dee0, invocation_hint=0xbfb5dd88,
    marshal_data=0xb78861c8) at gmarshal.c:636
#36 0xb746b869 in g_type_class_meta_marshal
(closure=0x8603c18, return_value=0x0, n_param_values=2,
param_values=0xbfb5dee0, invocation_hint=0xbfb5dd88,
marshal_data=0x1a0)
    at gclosure.c:567
#37 0xb746d492 in IA__g_closure_invoke
(closure=0x8603c18, return_value=0x0, n_param_values=2,
param_values=0xbfb5dee0, invocation_hint=0xbfb5dd88) at
gclosure.c:490
#38 0xb747f5dd in signal_emit_unlocked_R
(node=0x8680340, detail=0, instance=0x8ac0738,
emission_return=0x0, instance_and_params=0xbfb5dee0) at
gsignal.c:2478
#39 0xb7480469 in IA__g_signal_emit_valist
(instance=0x8ac0738, signal_id=104, detail=0,
var_args=<value optimized out>) at gsignal.c:2199
#40 0xb7480720 in IA__g_signal_emit
(instance=0x8ac0738, signal_id=104, detail=0) at
gsignal.c:2243
#41 0xb788d5bd in _gtk_window_internal_set_focus
(window=0x8ac0738, focus=0xa11c8b0) at gtkwindow.c:1274
#42 0xb78840d7 in gtk_widget_real_grab_focus
(focus_widget=0xa11c8b0) at gtkwidget.c:4297
#43 0xb747b4f8 in IA__g_cclosure_marshal_VOID__VOID
(closure=0x8590228, return_value=0x0, n_param_values=1,
param_values=0xbfb5e3b0, invocation_hint=0xbfb5e258,
    marshal_data=0xb7883f1e) at gmarshal.c:77
#44 0xb746b869 in g_type_class_meta_marshal
(closure=0x8590228, return_value=0x0, n_param_values=1,
param_values=0xbfb5e3b0, invocation_hint=0xbfb5e258,
marshal_data=0xa4)
    at gclosure.c:567
#45 0xb746d492 in IA__g_closure_invoke
(closure=0x8590228, return_value=0x0, n_param_values=1,
param_values=0xbfb5e3b0, invocation_hint=0xbfb5e258) at
gclosure.c:490
#46 0xb747f5dd in signal_emit_unlocked_R
(node=0x8590440, detail=0, instance=0xa11c8b0,
emission_return=0x0, instance_and_params=0xbfb5e3b0) at
gsignal.c:2478
#47 0xb7480469 in IA__g_signal_emit_valist
(instance=0xa11c8b0, signal_id=35, detail=0,
var_args=<value optimized out>) at gsignal.c:2199
#48 0xb7480720 in IA__g_signal_emit
(instance=0xa11c8b0, signal_id=35, detail=0) at
gsignal.c:2243
#49 0xb787b3ca in IA__gtk_widget_grab_focus
(widget=0xa11c8b0) at gtkwidget.c:4216
---Type <return> to continue, or q <return> to quit---
#50 0xb778f780 in gtk_range_button_press
(widget=0xa11c8b0, event=0x9bbd680) at gtkrange.c:1568
#51 0xb7749f6d in _gtk_marshal_BOOLEAN__BOXED
(closure=0x85904c8, return_value=0xbfb5e73c,
n_param_values=2, param_values=0xbfb5e8b0,
invocation_hint=0xbfb5e758,
    marshal_data=0xb778f72e) at gtkmarshalers.c:84
#52 0xb746b869 in g_type_class_meta_marshal
(closure=0x85904c8, return_value=0xbfb5e73c,
n_param_values=2, param_values=0xbfb5e8b0,
invocation_hint=0xbfb5e758, marshal_data=0xb0)
    at gclosure.c:567
#53 0xb746d492 in IA__g_closure_invoke
(closure=0x85904c8, return_value=0xbfb5e73c,
n_param_values=2, param_values=0xbfb5e8b0,
invocation_hint=0xbfb5e758) at gclosure.c:490
#54 0xb747f5dd in signal_emit_unlocked_R
(node=0x8600aa8, detail=0, instance=0xa11c8b0,
emission_return=0xbfb5e89c,
instance_and_params=0xbfb5e8b0) at gsignal.c:2478
#55 0xb74804d9 in IA__g_signal_emit_valist
(instance=0xa11c8b0, signal_id=39, detail=0,
var_args=<value optimized out>) at gsignal.c:2209
#56 0xb7480720 in IA__g_signal_emit
(instance=0xa11c8b0, signal_id=39, detail=0) at
gsignal.c:2243
#57 0xb7876846 in gtk_widget_event_internal
(widget=0xa11c8b0, event=0x9bbd680) at gtkwidget.c:3911
#58 0xb787be2a in IA__gtk_widget_event
(widget=0xa11c8b0, event=0x9bbd680) at gtkwidget.c:3717
#59 0xb7742715 in IA__gtk_propagate_event
(widget=0xa11c8b0, event=0x9bbd680) at gtkmain.c:2188
#60 0xb77439f6 in IA__gtk_main_do_event
(event=0x9bbd680) at gtkmain.c:1407
#61 0xb75b6612 in gdk_event_dispatch (source=0x857b0e8,
callback=0, user_data=0x0) at gdkevents-x11.c:2320
#62 0xb73f3576 in IA__g_main_context_dispatch
(context=0x857b130) at gmain.c:2045
#63 0xb73f5f82 in g_main_context_iterate
(context=0x857b130, block=1, dispatch=1,
self=0x85d71a0) at gmain.c:2677
#64 0xb73f629c in IA__g_main_loop_run (loop=0x89cc308)
at gmain.c:2881
#65 0xb7743e16 in IA__gtk_main () at gtkmain.c:1001
#66 0xb7d9a147 in Gtk::Main::run_impl () from
/usr/lib/libgtkmm-2.4.so.1
#67 0xb7d99f32 in Gtk::Main::run () from
/usr/lib/libgtkmm-2.4.so.1
#68 0x08076f48 in sp_main_gui (argc=2, argv=0xbfb5ee04)
at main.cpp:654
#69 0x0816b8d3 in
Inkscape::NSApplication::Application::run
(this=0xbfb5ed44) at application/application.cpp:117
#70 0x0807744b in main (argc=2, argv=0xbfb5ee04) at
main.cpp:489

Tags: ui
Revision history for this message
Hans Nieser (hnsr) wrote :
Revision history for this message
Hans Nieser (hnsr) wrote :

I forgot to mention that this is with the SVN version of
Inkscape of about two hours old (2006-10-19 23:00 CEST)

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

I'm afraid this is a GTK bug. We don't do anything
nonorthodox here. Just a slider and a spinbutton attached to
a common GtkAdjustment. We do not touch any signals except
value-changed on adjustment. Yet GTK tries for some reason
to blink the spinbutton cursor while the screen is updating,
and focus is not there already, so it crashes.

By the way it has nothing to do with blur as such. The same
thing happens with Opacity too, only rarer because opacity
screen redraws are usually faster. But if you change opacity
of a complex large object, you can get it to crash in the
same way.

Revision history for this message
Hans Nieser (hnsr) wrote :

Ah I see, I'll see if I can make myself fully understand
this bug and file it with GTK+ if they aren't aware of it
already.

On the up-side, now that I have some control over rendering
quality of blur, I can make it render faster so this isn't
very likely to happen anymore, combined with the fact that
i've thaught myself not to use the spinbutton+slider in this
way anymore this is pretty much a non-issue to me now :)

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

This is a really really bad bug. GTK is severely broken and
does all kinds of weird things when you run main loop
iterations in the middle of a screen redraw caused by an
event handler. Not only does it die when trying to blink (!)
but it also sends multiple value-changed events, loses
release events, etc. It's crazy. I fixed some of this
weirdness by disabling interruptibility, but this is no
solution, of course, just a crude workaround. For example it
still crashes (with the same "can't blink without focus"
brain damage) when entering a value to a selector toolbar
spinbutton, if the selected object is big and blurred (and
thus slow to redraw). So it looks like I need to disable
interruptibility for ALL spinbuttons in our UI which would
make it kinda meaningless.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

I reported this to GTK bugzilla and they fixed the blinking crash in GTK
CVS. The problem of extra value-changed events remains, it is also
submitted to GTK but no solution yet. Anyway, this one can be closed
because at least it should not crash anymore with the next version of GTK.

Revision history for this message
Hans Nieser (hnsr) wrote :

Originator: YES

Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.