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 707659 - orca becomes non-responsive when doing read line on Unbound
orca becomes non-responsive when doing read line on Unbound
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Accessibility
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-09-06 21:13 UTC by Jarek Czekalski
Modified: 2013-09-09 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
python thread dump using faulthandler.register (5.00 KB, application/octet-stream)
2013-09-06 21:13 UTC, Jarek Czekalski
Details

Description Jarek Czekalski 2013-09-06 21:13:17 UTC
Created attachment 254307 [details]
python thread dump using faulthandler.register

So I started to listen to key-bindings :)

Almost succeeded, but it finally hanged :(

I reproduce it by going quickly (using keyboard, mainly page down) to Unbound cell. Then press KP_8, to read current line, while it still reads it. It does not read again, hangs.

Attaching thread dump. Interesting is the number of speech-dispatchers: 5. Right after orca start there is only one.

Using today's repository.
Comment 1 Jarek Czekalski 2013-09-07 15:46:25 UTC
Seems like the speech dispatcher threads are unrelated and the hang happens inside atspi.

I added some debugging code to at-spi2-core, atspi-text.c, AtspiTextRange *atspi_text_get_text_at_offset.

It displays the following:

entering gettext, object: 0xb6f588e9
calling dbus
returned from dbus
entering gettext, object: 0xb6f588e9
calling dbus

Before pressing KP_8 there is no call to get_text_at_offset. Then 2 calls are made, the first one returns, the second one seems to hang on dbus.

I am using at-spi2-core and at-spi2-atk from latest git (2013-09-05).

Passing it to at-spi, hopefully a correct action.
Comment 2 Mike Gorse 2013-09-08 02:40:49 UTC
I'm seeing a crash in gtk (for some reason, orca starts to use 100% of cpu cycles when it crashes, rather than dying), so I'm guessing that it's what you're running into:

(gdb) bt full
  • #0 _gtk_pango_get_text_at
    at gtkpango.c line 1225
  • #1 gtk_text_cell_accessible_get_text_at_offset
    at gtktextcellaccessible.c line 257
  • #2 atk_text_get_text_at_offset
    at atktext.c line 484
  • #3 impl_GetTextAtOffset
    at text-adaptor.c line 176

I'm not sure if _gtk_pango_get_text_at should just check that pango_layout_get_text hasn't returned NULL, or if something deeper is going wrong.
Comment 3 Jarek Czekalski 2013-09-08 06:10:26 UTC
Mike, thanks for checking that and for showing me new useful debugging methods: gdb and bt full.

I only get a segfault in gtk-3.0, probably because I don't have source code for gtk. But I confirm seeing that crash. What do we do now?

When testing with orca please do not use latest commit which removes calls to threads_init. I suffer from strange problems after this commit. Fortunately this bug is not affected by this. So my current orca version is "git checkout 2741abd28b10864d3342190ce6f583c1d3fe4345".
Comment 4 Mike Gorse 2013-09-08 13:17:31 UTC
Moving to gtk.

Also, what version of glib2 are you using?
Comment 5 Jarek Czekalski 2013-09-08 15:03:56 UTC
I am at debian unstable, that is version of package libgtk-3-0 is 3.8.2-3.
Comment 6 Jarek Czekalski 2013-09-08 16:28:41 UTC
After muting this violation in pango orca seems to be totally lost in the labels it speaks. It speaks the same label on many rows, and it is a label of the row that is not on the screen. Probably that has something to do with the scroll bar in the long table.

Please wait with investigation inside gtk, because it's possible that orca provides malformed parameters to its atspi calls. I'll test it more thoroughly and report again.
Comment 7 Jarek Czekalski 2013-09-09 09:48:16 UTC
My analyze (I am a gtk newbie) confirms what Joanmarie said in 707729, that there is a bug in gtk. If the PangoLayout is created and the "text" member is not set, then "text"
remains null. This happens for example in gtk_widget_create_pango_layout.

So calls to pango_layout_get_text should not assume it always returns non null pointer. However numerous calls to this function in gtkpango seem to assume, that the pointer is never null.

Another way of fixing this null problem would be to assume that the layouts gtk creates are always filled with text. But this assumption is broken by gtk_widget_create_pango_layout, which does not set text at all. I tested that if pango_layout_set_text is called with a null parameter, the text is set to an empty string. So the following code does not crash, but prints "text: ":

#include <pango/pango.h>

main()
{
  gtk_init(NULL, NULL);
  PangoContext *pcont = pango_context_new();
  PangoLayout *play = pango_layout_new(pcont);
  //pango_layout_set_text(play, "some text", 9);
  pango_layout_set_text(play, NULL, 0);
  printf("text: %s\n", pango_layout_get_text(play));
  g_object_unref(play);
  g_object_unref(pcont);
  return 0;
}


comment on 707729 bug: https://bugzilla.gnome.org/show_bug.cgi?id=707729#c1
some handy source links:
https://git.gnome.org/browse/gtk+/tree/gtk/gtkpango.c
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c
https://git.gnome.org/browse/pango/tree/pango/pango-layout.c
https://git.gnome.org/browse/gtk+/tree/gtk/a11y/gtktextcellaccessible.c
Comment 8 Jarek Czekalski 2013-09-09 16:07:35 UTC
Thanks, Benjamin.

I guess this is the right link of the fix commit:

https://git.gnome.org/browse/pango/commit/pango/pango-layout.c?id=114d5bfe9d54d1efabc233312d2c23267cf16f59