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 666371 - Several object-reference warnings while activating the accessibility support
Several object-reference warnings while activating the accessibility support
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-atk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
Depends on:
Blocks:
 
 
Reported: 2011-12-16 16:07 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2012-01-21 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-16 16:07:45 UTC
STEPS TO REPRODUCE IT:

1. Run gnome-shell (ie: gnome-shell --replace)
2. Go to Universal Access Menu and activate Screen Reader
3. Take a look to output messages

FREQUENCY:

Most of the times it doesn't happen the first time you open Orca, so probably you will require to deactivate it and run 2. again

DEBUG OUTPUT:

<snip>
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'
Window manager warning: Log level 8: g_object_get_data: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: register_object: assertion `G_IS_OBJECT (gobj)' failed
Window manager warning: Log level 8: g_object_get_data: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'
Window manager warning: Log level 8: g_object_get_data: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 8: register_object: assertion `G_IS_OBJECT (gobj)' failed
Window manager warning: Log level 8: g_object_get_data: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'
Window manager warning: Log level 8: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Window manager warning: Log level 16: invalid uninstantiatable type `(null)' in cast to `GObject'

</snip>

NOTES:

At first my plan was open this bug on GNOME Shell, but Joanmarie mentioned that something similar happens (with some crashes) on epiphany/webkitgtk, so I have just created this on this shared component. It needs further investigation, we can move to the proper component later.
Comment 1 Joanmarie Diggs (IRC: joanie) 2011-12-21 17:58:53 UTC
Not sure if it's relevant to you or not, but every time launching Orca causes a crash, the following seems to be the case:                                                                                                                        

1. We have a whole bunch of events from objects with STATE_DEFUNCT
2. This is followed by an event from a supposedly valid object:
   * object:state-changed:showing (detail1 == 0)
   * role == UNKNOWN
   * states: FOCUSABLE and VISIBLE (and *not* DEFUNCT)

At this point, gnome-shell crashes and restarts itself. There is no hang, and Orca survives the entire thing.
Comment 2 Joanmarie Diggs (IRC: joanie) 2011-12-21 18:13:02 UTC
And where things seem to be going south in particular -- at least as far as Orca is concerned -- is here:

  • File "/usr/lib/python2.7/site-packages/pyatspi/Accessibility.py", line 177 in <lambda>
    Atspi.Accessible.name = property(fget=lambda x: exwrap(Atspi.Accessible.get_name, x))
  • File "/usr/lib/python2.7/site-packages/pyatspi/Accessibility.py", line 154 in exwrap
    raise LookupError

Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-21 18:23:48 UTC
Thanks for the additional comments.

(In reply to comment #1)
> Not sure if it's relevant to you or not, but every time launching Orca causes a
> crash, the following seems to be the case:                                      
> 
> 1. We have a whole bunch of events from objects with STATE_DEFUNCT
> 2. This is followed by an event from a supposedly valid object:
>    * object:state-changed:showing (detail1 == 0)

Just while we were talking via IRC, I was checking where this showing is emitted but ...

>    * role == UNKNOWN
>    * states: FOCUSABLE and VISIBLE (and *not* DEFUNCT)

... this was a ATK_STATE_DEFUNCT check, so probably this will not be useful.

Anyway, FWIW, Im not able to crash GNOME Shell with Orca using any specific steps. It happens sometimes. Do you have a "recipe" to get GNOME Shell crashing?

I will keep investigating this.
Comment 4 Joanmarie Diggs (IRC: joanie) 2011-12-21 20:19:18 UTC
(Sorry to be spammy!)

Now that I'm running with gnome-shell --replace, when I launch Orca and
gnome-shell dies in response, I am seeing this quite a bit:

    gnome-shell-calendar-server[29420]: Got HUP on stdin - exiting

Not sure exactly what I or Orca might be doing to upset the calendar-server.
<shrugs>

Also please note that this, along with the earlier comments, pertain to Fedora
16, with Orca, AT-SPI2, and ATK from master. I am in the midst of a refactor at
the moment. I'll update my Fedora 17/rawhide box and test more thoroughly
later.

(Mid-air collision!)

(In reply to comment #3)

> Anyway, FWIW, Im not able to crash GNOME Shell with Orca using any specific
> steps. It happens sometimes. Do you have a "recipe" to get GNOME Shell
> crashing?

Not yet. Sorry! But in a bit I might see if I can stop the crash itself in Orca. i.e. if I can predict what is going to p*ss off gnome-shell I can add preventive code to Orca and point out what made gnome-shell decide to stop killing itself. Maybe from that we can derive a "recipe".

> I will keep investigating this.

Awesomesauce! Thanks!!
Comment 5 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-23 16:28:44 UTC
During one of those crashes, I was able to get this backtrace from gnome-shell:

(gdb) bt
  • #0 g_object_ref
    at gobject.c line 2784
  • #1 g_hash_table_foreach
    at ghash.c line 1459
  • #2 impl_GetItems
    at cache-adaptor.c line 316
  • #3 handle_other
    at droute.c line 538
  • #4 handle_message
    at droute.c line 586
  • #5 _dbus_object_tree_dispatch_and_unlock
    at dbus-object-tree.c line 858
  • #6 dbus_connection_dispatch
    at dbus-connection.c line 4691
  • #7 message_queue_dispatch
    at atspi-gmain.c line 97
  • #8 g_main_dispatch
    at gmain.c line 2513
  • #9 g_main_context_dispatch
    at gmain.c line 3050
  • #10 g_main_context_iterate
    at gmain.c line 3121
  • #11 g_main_context_iterate
    at gmain.c line 3058
  • #12 g_main_loop_run
    at gmain.c line 3315
  • #13 meta_run
    at core/main.c line 555
  • #14 main
    at main.c line 352


So it seems that it is happening on the bridge. Of course it still can be happening due a wrong ref/unref on cally code.
Comment 6 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-23 16:41:23 UTC
I also detected one warning that I didn't found on the description:

Window manager warning: Log level 8: atk_gobject_accessible_dispose: assertion `ATK_IS_GOBJECT_ACCESSIBLE (data)' failed
Comment 7 Mike Gorse 2011-12-23 18:09:53 UTC
This is with at-spi2-atk 2.3.3 (or head), right? I guess spi_global_cache is holding a pointer to an object in the hash table after the object has been finalized. In theory this should never happen since all objects in the cache are supposed to have a weak ref that removes them from the cache.
Comment 8 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-24 01:02:10 UTC
(In reply to comment #7)
> This is with at-spi2-atk 2.3.3 (or head), right? I guess spi_global_cache is

Test done on Comment 5 was done with Ubuntu package 2.2.1-0ubuntu. I have tested again with at-spi2 from head, and although I didn't get the crash I was able to get a backtrace on the point at those warning messages at comment 0. 

So, that "g_object_ref: assertion `G_IS_OBJECT (object)' failed":

(gdb) bt
  • #0 meta_warning
    at core/util.c line 453
  • #1 log_handler
    at core/main.c line 110
  • #2 g_logv
    at gmessages.c line 733
  • #3 g_log
    at gmessages.c line 792
  • #4 g_object_ref
    at gobject.c line 2784
  • #5 g_hash_table_foreach
    at ghash.c line 1459
  • #6 impl_GetItems
    at cache-adaptor.c line 316
  • #7 handle_other
    at droute.c line 538
  • #8 handle_message
    at droute.c line 586
  • #9 _dbus_object_tree_dispatch_and_unlock
    at dbus-object-tree.c line 858
  • #10 dbus_connection_dispatch
    at dbus-connection.c line 4691
  • #11 message_queue_dispatch
    at atspi-gmain.c line 97
  • #12 g_main_dispatch
    at gmain.c line 2513
  • #13 g_main_context_dispatch
    at gmain.c line 3050
  • #14 g_main_context_iterate
    at gmain.c line 3121
  • #15 g_main_context_iterate
    at gmain.c line 3058
  • #16 g_main_loop_run
    at gmain.c line 3315
  • #17 meta_run
    at core/main.c line 555
  • #18 main
    at main.c line 352
  • #0 meta_warning
    at core/util.c line 453
  • #1 log_handler
    at core/main.c line 110
  • #2 g_logv
    at gmessages.c line 733
  • #3 g_log
    at gmessages.c line 792
  • #4 g_type_check_instance_cast
    at gtype.c line 4010
  • #5 spi_object_append_reference
    at ../../atk-adaptor/object.c line 104
  • #6 append_cache_item
    at cache-adaptor.c line 140
  • #7 g_hash_table_foreach
    at ghash.c line 1459
  • #8 impl_GetItems
    at cache-adaptor.c line 317
  • #9 handle_other
    at droute.c line 538
  • #10 handle_message
    at droute.c line 586
  • #11 _dbus_object_tree_dispatch_and_unlock
    at dbus-object-tree.c line 858
  • #12 dbus_connection_dispatch
    at dbus-connection.c line 4691
  • #13 message_queue_dispatch
    at atspi-gmain.c line 97
  • #14 g_main_dispatch
    at gmain.c line 2513
  • #15 g_main_context_dispatch
    at gmain.c line 3050
  • #16 g_main_context_iterate
    at gmain.c line 3121
  • #17 g_main_context_iterate
    at gmain.c line 3058
  • #18 g_main_loop_run
    at gmain.c line 3315
  • #19 meta_run
    at core/main.c line 555
  • #20 main
    at main.c line 352
  • #0 meta_warning
    at core/util.c line 453
  • #1 log_handler
    at core/main.c line 110
  • #2 g_logv
    at gmessages.c line 733
  • #3 g_log
    at gmessages.c line 792
  • #4 expiry_func
    at ../../atk-adaptor/accessible-leasing.c line 122
  • #5 g_timeout_dispatch
    at gmain.c line 3857
  • #6 g_main_dispatch
    at gmain.c line 2513
  • #7 g_main_context_dispatch
    at gmain.c line 3050
  • #8 g_main_context_iterate
    at gmain.c line 3121
  • #9 g_main_context_iterate
    at gmain.c line 3058
  • #10 g_main_loop_run
    at gmain.c line 3315
  • #11 meta_run
    at core/main.c line 555
  • #12 main
    at main.c line 352


The two first backtraces happens in the same method that caused a crash on comment 5. As I said, those backtraces are for the warnings, but didn't cause a crash. Anyway, it seems that the problem is the same, try to use an accessible that was destroyed.

> holding a pointer to an object in the hash table after the object has been
> finalized. In theory this should never happen since all objects in the cache
> are supposed to have a weak ref that removes them from the cache.

Hmm, this is odd. At first I thought that the problem was a missing _ref, or a extra _unref. But taking into account this paragraph, if this would be the case, I shouldn't have this problem as the objects should be removed by the cache before being accessed again, right?

BTW, as I said in the description, this doesn't happen since the beginning. My environment is the next one:

1. Launch gnome-shell => no orca running
2. Launch orca, interact a little with gnome-shell => no warnings
3. Close orca
4. Open orca => warnings

Probably when I close orca, the accessible objects are destroyed. What I don't understand is why the bridge tries to interact again with them.

Additional question: should I try to disconnect the cache to test those messsages ?
Comment 9 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-12-24 01:32:50 UTC
(In reply to comment #8)

> Probably when I close orca, the accessible objects are destroyed. What I don't
> understand is why the bridge tries to interact again with them.

I made an additional test. Normally the widgets doesn't maintain a reference to the accessible, as usually the accessible lives longer that the base object. This "I need to close orca and run it again" let me to think that the problem could be that the accessible object is unref, but the base object still maintains a pointer to the old accessible object. So I just tested to add a reference to the accessible object, and an unref on the base object (the widget) dispose. No luck.


And, just one more backtrace of the messages at description. That gobject_get_data

(gdb) bt
  • #0 meta_warning
    at core/util.c line 453
  • #1 log_handler
    at core/main.c line 110
  • #2 g_logv
    at gmessages.c line 733
  • #3 g_log
    at gmessages.c line 792
  • #4 g_object_get_data
    at gobject.c line 3076
  • #5 object_to_ref
    at ../../atk-adaptor/accessible-register.c line 184
  • #6 spi_register_object_to_path
    at ../../atk-adaptor/accessible-register.c line 302
  • #7 spi_object_append_reference
    at ../../atk-adaptor/object.c line 107
  • #8 append_cache_item
    at cache-adaptor.c line 140
  • #9 g_hash_table_foreach
    at ghash.c line 1459
  • #10 impl_GetItems
    at cache-adaptor.c line 317
  • #11 handle_other
    at droute.c line 538
  • #12 handle_message
    at droute.c line 586
  • #13 _dbus_object_tree_dispatch_and_unlock
    at dbus-object-tree.c line 858
  • #14 dbus_connection_dispatch
    at dbus-connection.c line 4691
  • #15 message_queue_dispatch
    at atspi-gmain.c line 97
  • #16 g_main_dispatch
    at gmain.c line 2513
  • #17 g_main_context_dispatch
    at gmain.c line 3050
  • #18 g_main_context_iterate
    at gmain.c line 3121
  • #19 g_main_context_iterate
    at gmain.c line 3058
  • #20 g_main_loop_run
    at gmain.c line 3315
  • #21 meta_run
    at core/main.c line 555
  • #22 main
    at main.c line 352

Comment 10 Mike Gorse 2012-01-21 18:19:17 UTC
I think that 85af8a in at-spi2-atk will fix this. Please re-open if you
see it again.