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 670601 - empathy-accounts segfault (settings are null for liststore iter)
empathy-accounts segfault (settings are null for liststore iter)
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Accounts
3.3.x
Other Linux
: Normal normal
: 3.4
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-22 11:48 UTC by Alban Browaeys
Modified: 2012-03-29 15:56 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4


Attachments
backtrace of the empathy-accounts segfault (5.45 KB, text/plain)
2012-02-22 11:48 UTC, Alban Browaeys
  Details
is there an off by one in the row indice for gtktreeviewaccessible (626 bytes, text/plain)
2012-02-22 13:49 UTC, Alban Browaeys
  Details
is there an off by one in gtktreeviewaccessible (626 bytes, text/plain)
2012-02-22 14:09 UTC, Alban Browaeys
  Details
new backtrace (10.71 KB, text/plain)
2012-03-29 00:08 UTC, Joanmarie Diggs (IRC: joanie)
  Details
accounts-dialog: use gtk_list_store_insert_with_values() (1.69 KB, patch)
2012-03-29 12:37 UTC, Guillaume Desmottes
committed Details | Review

Description Alban Browaeys 2012-02-22 11:48:54 UTC
Created attachment 208189 [details]
backtrace of the empathy-accounts segfault

gtk+ up to 03fdaca1870cb1b436cb69b174028d66fe6b7078 .
I get a segfault starting empathy-accounts. it adds an iter to a list store then set its settings column. Though adding this iter trigger an event which fire apply_cell_attributes itself calling a render function which expects the settings to be defined for the cell (to get the icon) .
Might be related to gtktreeviewaccessible work from Feb 11.
Comment 1 Guillaume Desmottes 2012-02-22 12:18:31 UTC
So yeah, Empathy just uses gtk_list_store_append() and then gtk_list_store_set().
But the data_func function of the GtkCellRendererPixbuf is now called during the_append(). As this function relies on the data which have not been set yet it crashes.

So, does Empathy should cope with the data not being set yet or should Gtk+ not call the cell data func until they have been set?
Comment 2 Guillaume Desmottes 2012-02-22 12:20:17 UTC
Interesting, I updated to Gtk+ master and can't reproduce this bug.
Comment 3 Alban Browaeys 2012-02-22 13:49:56 UTC
Created attachment 208198 [details]
is there an off by one in the row indice for gtktreeviewaccessible 

I made up this local change to workaround the issue (ie I remove the added one to the row index - not confident this is right : there is already one added to the n_rows to account for the new row. I cannot seem to find out if the indice in the loop is suppose to start from zero - what I did - or one - what was there). 
My experiment leads to first _gtk_tree_view_accessible_add fails as it does not manage to get the accessible. Issue start with second add (second account).
Also accessibility is involved. I don't know if with it disabled gtktreeviewaccessible is reached at all.
The data_func calls is triggered in _gtk_tree_view_accessible_add  by:
  g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
Comment 4 Alban Browaeys 2012-02-22 14:09:38 UTC
Created attachment 208199 [details]
is there an off by one in gtktreeviewaccessible
Comment 5 Guillaume Desmottes 2012-02-23 08:35:08 UTC
Re-assigning to Gtk+ to see what gtk dev think about this.
Comment 6 Benjamin Otte (Company) 2012-03-02 12:13:41 UTC
So what's happening (In reply to comment #3)
> Created an attachment (id=208198) [details]
> is there an off by one in the row indice for gtktreeviewaccessible 
> 
That patch is wrong - the addition of the one is needed because the first row in the accessible contains the headers. You are right that it does work around the bug though, because it will then only emit signals for the seond-to-last row, which you already have set up fine.

So, what's happening here is that the treeview a11y code is emitting a signal "a row was just added" and then the accessible bridge comes and asks "and what are its contents so I can send them to Orca?" in children_changed_event_listener().

And I don't see another place to do this - other then when a row was added. So I think it should be empathy that handles this case - preferably using gtk_list_store_insert_with_values().
Comment 7 Alban Browaeys 2012-03-09 00:25:15 UTC
Bug disappeared since I updated my jhbuild. Hard to track which layer had the code that phased out the issue. Thanks.
Comment 8 Joanmarie Diggs (IRC: joanie) 2012-03-29 00:07:40 UTC
Afraid I am reopening. I can still reproduce this problem, including in a fresh jhbuild environment. And from a look at this bug's history, it was closed as FIXED based on WFM rather than any changes being made and without knowing which module fixed it.

In order to reproduce the crasher, it seems you need to have an assistive technology actively listening for events. It can be something as simple as the following:

-------------------------------
#!/usr/bin/python
import pyatspi

def listener(e):
    pass

pyatspi.Registry.registerEventListener(listener, "object:state-changed:showing")
pyatspi.Registry.start()
-------------------------------

Run the above first. with it running, launch empathy-accounts. I get a segfault 100% of the time. Without anything listening, empathy-accounts works as expected.
Comment 9 Joanmarie Diggs (IRC: joanie) 2012-03-29 00:08:21 UTC
Created attachment 210828 [details]
new backtrace
Comment 10 Joanmarie Diggs (IRC: joanie) 2012-03-29 00:12:43 UTC
Sorry for the spamorama. Having chatted with Benjamin about this, transferring back to Empathy.
Comment 11 Guillaume Desmottes 2012-03-29 12:26:27 UTC
Thanks for your help guys. I'm working on a fix.
Comment 12 Guillaume Desmottes 2012-03-29 12:37:23 UTC
Created attachment 210866 [details] [review]
accounts-dialog: use gtk_list_store_insert_with_values()

Prevent a crash when using a11y as GTK+ may want to look at the content of the
row as soon it's added. See the bug for details.
Comment 13 Guillaume Desmottes 2012-03-29 12:44:23 UTC
Attachment 210866 [details] pushed as 889cbf1 - accounts-dialog: use gtk_list_store_insert_with_values()
Comment 14 Joanmarie Diggs (IRC: joanie) 2012-03-29 15:56:04 UTC
Fix verified. Orca users will be pleased. :) Thanks Guillaume!!