After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 163583 - Sound Preferences hangs with keynav when gnopernicus is running.
Sound Preferences hangs with keynav when gnopernicus is running.
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
unspecified
Other Linux
: High major
: ---
Assigned To: bill.haneman
bill.haneman
AP1
Depends on:
Blocks:
 
 
Reported: 2005-01-10 16:43 UTC by John Crawley
Modified: 2005-04-28 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch which causes cells to persist once referenced, while alive (2.65 KB, patch)
2005-04-22 16:45 UTC, bill.haneman
none Details | Review
improved patch which retains weak-ref lifecycle, but is reentrancy-safe (6.86 KB, patch)
2005-04-25 10:14 UTC, bill.haneman
none Details | Review
improved patch which solves more (all?) of the problem (18.44 KB, patch)
2005-04-28 11:19 UTC, bill.haneman
none Details | Review
patch as committed, stopgap measure (26.94 KB, patch)
2005-04-28 14:05 UTC, bill.haneman
committed Details | Review

Description John Crawley 2005-01-10 16:43:22 UTC
Using gnopernicus 0.9.17 and gnome-2.6

 - Start gnopernicus (nothing needs to be enabled).
 - From the Launch menu, go to Preferences->Desktop Preferences->Sound
 - The Sound Preferences window will appear.

 - Make sure that the two checkboxes on the 'General' tab are checked
 - Navigate to the 'Sound Events' tab.
 - With focus on the tab label, press and hold the <down> arrow.

 - Notice that focus changes to the Sounds table and that the focus is
   moving through the table lines.

At this point in time the Sound Preferences window hangs, focus is lost
and nothing on the Sound Preferences window can be used. Sometimes instead,
the window just disappears completely. This does not happen when gnopernicus
is not running.
Comment 1 bill.haneman 2005-01-11 10:41:10 UTC
Does this happen if braille and brlmonitor are not used?
Comment 2 John Crawley 2005-01-11 10:46:39 UTC
Yes.
Comment 3 bill.haneman 2005-01-11 11:16:42 UTC
Here's a sample backtrace:

Starting program: /usr/bin/gnome-sound-properties
[Thread debugging using libthread_db enabled]
[New Thread 1088775680 (LWP 5801)]
GTK Accessibility Module initialized
Bonobo accessibility support initialized

Program received signal SIGSEGV, Segmentation fault.

Thread 1088775680 (LWP 5801)

  • #0 gtk_tree_path_copy
    at gtktreemodel.c line 590
  • #1 gtk_tree_row_reference_get_path
    at gtktreemodel.c line 1885
  • #2 traverse_cells
    at gailtreeview.c line 3575
  • #3 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #4 g_closure_invoke
    at gclosure.c line 437
  • #5 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #6 g_signal_emit_valist
    at gsignal.c line 2195
  • #7 g_signal_emit
    at gsignal.c line 2239
  • #8 gtk_adjustment_value_changed
    at gtkadjustment.c line 343
  • #9 gtk_adjustment_set_value
    at gtkadjustment.c line 326
  • #10 gtk_tree_view_scroll_to_point
    at gtktreeview.c line 9659
  • #11 gtk_tree_view_scroll_to_cell
    at gtktreeview.c line 9778
  • #12 gtk_tree_view_clamp_node_visible
    at gtktreeview.c line 7454
  • #13 gtk_tree_view_real_set_cursor
    at gtktreeview.c line 10611
  • #14 gtk_tree_view_real_move_cursor
    at gtktreeview.c line 8147
  • #15 _gtk_marshal_BOOLEAN__ENUM_INT
    at gtkmarshalers.c line 202
  • #16 g_type_class_meta_marshal
    at gclosure.c line 514
  • #17 g_closure_invoke
    at gclosure.c line 437
  • #18 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #19 g_signal_emitv
    at gsignal.c line 2107
  • #20 gtk_binding_entry_activate
    at gtkbindings.c line 525
  • #21 binding_match_activate
    at gtkbindings.c line 927
  • #22 gtk_bindings_activate_list
    at gtkbindings.c line 1063
  • #23 gtk_bindings_activate_event
    at gtkbindings.c line 1138
  • #24 gtk_widget_real_key_press_event
    at gtkwidget.c line 3307
  • #25 gtk_tree_view_key_press
    at gtktreeview.c line 4167
  • #26 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 82
  • #27 g_type_class_meta_marshal
    at gclosure.c line 514
  • #28 g_closure_invoke
    at gclosure.c line 437
  • #29 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #30 g_signal_emit_valist
    at gsignal.c line 2205
  • #31 g_signal_emit
    at gsignal.c line 2239
  • #32 gtk_widget_event_internal
    at gtkwidget.c line 3563
  • #33 gtk_window_propagate_key_event
    at gtkwindow.c line 4214
  • #34 gtk_window_key_press_event
    at gtkwindow.c line 4244
  • #35 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 82
  • #36 g_type_class_meta_marshal
    at gclosure.c line 514
  • #37 g_closure_invoke
    at gclosure.c line 437
  • #38 signal_emit_unlocked_R
    at gsignal.c line 2474
  • #39 g_signal_emit_valist
    at gsignal.c line 2205
  • #40 g_signal_emit
    at gsignal.c line 2239
  • #41 gtk_widget_event_internal
    at gtkwidget.c line 3563
  • #42 gtk_propagate_event
    at gtkmain.c line 2319
  • #43 gtk_main_do_event
    at gtkmain.c line 1583
  • #44 gdk_event_dispatch
    at gdkevents-x11.c line 2181
  • #45 g_main_context_dispatch
    at gmain.c line 1942
  • #46 g_main_context_iterate
    at gmain.c line 2573
  • #47 g_main_loop_run
    at gmain.c line 2777
  • #48 gtk_main
    at gtkmain.c line 1173
  • #49 main
    at sound-properties-capplet.c line 284

Comment 4 bill.haneman 2005-01-17 15:24:45 UTC
reducing AP priority as this only occurs under stress.  I'm not denying that
it's a serious problem, but it can be reduced in frequency if key repeat is
turned off.

Problem seems to be refcount issue in gailtreeview (or possibly gtktreemodel).
Comment 5 bill.haneman 2005-04-22 16:44:13 UTC
The problem seems to be that we are referencing a cell_info object when
traversing a list, in traverse_cells, while a g_object_unref notification is
incoming.  On receipt of the object-destroy message on a GailCell AtkObject, we
call cell_destroyed.  This may happen while we are traversing our internal cell
cache, in which case we may call API on an object after it's been freed; while
we remove the stale cell_info from our list inside cell_destroyed, we don't
remove it from the list being traversed.

From a lifecycle point of view, the problem seems to be that we don't,
ourselves, increment the refcount of GailCell objects when we return them in
gail_tree_view_ref_child.  The reason for this is unclear, though a source code
comment indicates that it is intentional.  However I don't think it's right,
since it results in the disposal of GailCells which we're holding in our cache,
which we then must re-create on request.  In any case something is going wrong
with the lifecycle management of these objects.

I attach a patch which increments the GailCell object ref count before returning
from gail_tree_view_ref_child, and which decrements the object ref count inside
clean_cell_info.  It does stop the bug, and I don't see a resulting leak,
although it does mean that once a GailCell has been requested by a client, we
keep it in our cache as long as the corresponding GtkTreeview cell exists.  This
is admittedly an inefficiency for large tables; I'm not sure what the best
solution is. 
Comment 6 bill.haneman 2005-04-22 16:45:27 UTC
Created attachment 45557 [details] [review]
patch which causes cells to persist once referenced, while alive
Comment 7 bill.haneman 2005-04-25 10:14:06 UTC
Created attachment 45642 [details] [review]
improved patch which retains weak-ref lifecycle, but is reentrancy-safe
Comment 8 bill.haneman 2005-04-28 11:19:46 UTC
Created attachment 45780 [details] [review]
improved patch which solves more (all?) of the problem

more guards and checks for in_use flag were needed to make this method work,
the previous patch could still segv in some circumstances.
Comment 9 bill.haneman 2005-04-28 14:05:45 UTC
Created attachment 45786 [details] [review]
patch as committed, stopgap measure

finally a patch that works - but it's become obvious that this can only be a
stopgap measure until the gailtreeviewcell/gailcelll implementation is
refactored.  The current approach of not holding refs to the atkobjects in our
cache doesn't work very well, since we need to call a fair bit of
potentially-reenterant api inside our destroy handler using the current
approach.
The above patch fixes the immediate symptoms but it lacks elegance and
generality.