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 473422 - Orca has traceback when giving focus to the pidgin application.
Orca has traceback when giving focus to the pidgin application.
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.19.x
Other Linux
: Normal normal
: 2.22.0
Assigned To: Li Yuan
Orca Maintainers
Depends on: 474504
Blocks:
 
 
Reported: 2007-09-04 02:45 UTC by Rich Burridge
Modified: 2008-07-22 19:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to try to implement what's discussed in comment #6 (1.59 KB, patch)
2007-09-04 21:49 UTC, Rich Burridge
none Details | Review
Patch for trunk to prevent second traceback. (1.08 KB, patch)
2007-09-05 15:32 UTC, Rich Burridge
committed Details | Review
Patch for gnome-2-20 branch to prevent second traceback (1008 bytes, patch)
2007-09-05 15:33 UTC, Rich Burridge
committed Details | Review

Description Rich Burridge 2007-09-04 02:45:19 UTC
1/ Startup Orca.
2/ Startup pidgin
3/ Give focus to the pidgin application.

The following is output in the xterm window where I started Orca:

  • File "<string>", line 1 in <module>
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 1485 in main
    start(registry) # waits until we stop the registry
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 1170 in start
    registry.start()
  • File "/usr/lib/python2.5/site-packages/orca/atspi.py", line 158 in start
    bonobo.main()
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 838 in _dequeueEvent
    self._processObjectEvent(event)
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 627 in _processObjectEvent
    s.processObjectEvent(event)
  • File "/usr/lib/python2.5/site-packages/orca/script.py", line 296 in processObjectEvent
    self.listeners[key](event)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2975 in onStateChanged
    self.onFocus(event)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2533 in onFocus
    orca.setLocusOfFocus(event, newFocus)
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 201 in setLocusOfFocus
    orca_state.locusOfFocus)
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 938 in locusOfFocusChanged
    newLocusOfFocus)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2262 in locusOfFocusChanged
    self.speechGenerator.getSpeech(newLocusOfFocus, False))
  • File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1676 in getSpeech
    return [" ".join(generator(obj, already_focused))]
  • File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1251 in _getSpeechForTable
    child = obj.child(i)
  • File "/usr/lib/python2.5/site-packages/orca/atspi.py", line 1436 in child
    debug.printStack(debug.LEVEL_WARNING)
  • File "/usr/lib/python2.5/site-packages/orca/debug.py", line 136 in printStack
    traceback.print_stack(None, 100, debugFile)
Child at index 2 is not an Accessible

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 627, in _processObjectEvent
    s.processObjectEvent(event)
  File "/usr/lib/python2.5/site-packages/orca/script.py", line 296, in processObjectEvent
    self.listeners[key](event)
  File "/usr/lib/python2.5/site-packages/orca/default.py", line 2975, in onStateChanged
    self.onFocus(event)
  File "/usr/lib/python2.5/site-packages/orca/default.py", line 2533, in onFocus
    orca.setLocusOfFocus(event, newFocus)
  File "/usr/lib/python2.5/site-packages/orca/orca.py", line 201, in setLocusOfFocus
    orca_state.locusOfFocus)
  File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 938, in locusOfFocusChanged
    newLocusOfFocus)
  File "/usr/lib/python2.5/site-packages/orca/default.py", line 2262, in locusOfFocusChanged
    self.speechGenerator.getSpeech(newLocusOfFocus, False))
  File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1676, in getSpeech
    return [" ".join(generator(obj, already_focused))]
  File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1252, in _getSpeechForTable
    if child.state.count(atspi.Accessibility.STATE_SHOWING):
AttributeError: 'NoneType' object has no attribute 'state'

this is with Orca from SVN trunk.
Comment 1 Willie Walker 2007-09-04 12:56:36 UTC
(In reply to comment #0)
> this is with Orca from SVN trunk.

Is this 100% repeatable?  In addition, do you also see it with the gnome-2-20 branch or just on trunk?
Comment 2 Rich Burridge 2007-09-04 15:05:38 UTC
> Is this 100% repeatable?  

Yes.

> In addition, do you also see it with the gnome-2-20
> branch or just on trunk?

Both.
Comment 3 Willie Walker 2007-09-04 15:42:15 UTC
(In reply to comment #2)
> > Is this 100% repeatable?  
> 
> Yes.
> 
> > In addition, do you also see it with the gnome-2-20
> > branch or just on trunk?
> 
> Both.
> 

Thanks!  This definitely looks like something to try to fix by 10-Sep.
Comment 4 Rich Burridge 2007-09-04 17:18:37 UTC
> This definitely looks like something to try to fix by 10-Sep.

I'm not sure we are going to be able to fix it. Looks like another pidgin bug.
I added some debug to speechgenerator._getSpeechForTable(). When you
put focus in the tree view in the buddy window, this method is called.

It says it has:

child count:  32

We then try to check each one to see if it has a state of SHOWING
and it craps out on child[2]. The first two are column headers.

child[ 0 ]: name:
child[ 0 ]: role:  table column header
child[ 1 ]: name:
child[ 1 ]: role:  table column header
... traceback ...
Child at index 2 is not an Accessible

If I look at the tree view in pidgin with accerciser, it thinks those
children are:

table column header
table column header
<dead>
table cell
<dead>
table cell
<dead>
...

There is a pair of "<dead>"  and "table cell" entries for each row
of my buddy list.

I'll file another pidgin bug and block this one.


Comment 5 Rich Burridge 2007-09-04 17:59:59 UTC
Here's the pidgin ticket url:

http://developer.pidgin.im/ticket/2946#preview

Blocking this bug against it.

Comment 6 Willie Walker 2007-09-04 20:56:41 UTC
In the Orca team meeting today, we discussed putting a try/except around the block inside the for loop in speechgenerator.py:_getSpeechForTable as a defensive move for gnome-2-20.  So, if you can work up patches for trunk and the gnome-2-20 branch, and get Mike to test them with success, we should try to get it in for this Sunday's GNOME 2.20 code freeze. 
Comment 7 Rich Burridge 2007-09-04 21:49:33 UTC
Created attachment 94962 [details] [review]
Patch to try to implement what's discussed in comment #6

Not committed yet. I just tried this and I was surprised
to discover that we are still getting a stack trace (this is
at the INFO debug level). It's being nicely caught, and we are
no longer getting the second stack trace and the utterances 
are being returned (see output snippet below).

Will, is this good enough (sans the extra print statement)?
Or should I be looking for also adding in a try:/except: clause
somewhere in atspi.py?

...
BRAILLE LINE:  'pidgin Application Buddy List Frame'
     VISIBLE:  'Buddy List Frame', cursor=1
SPEECH OUTPUT: 'Buddy List frame'
BRAILLE LINE:  'pidgin Application Buddy List Frame TabList  ScrollPane TreeTable'
     VISIBLE:  'TreeTable', cursor=1

  • File "<string>", line 1 in <module>
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 1485 in main
    start(registry) # waits until we stop the registry
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 1170 in start
    registry.start()
  • File "/usr/lib/python2.5/site-packages/orca/atspi.py", line 158 in start
    bonobo.main()
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 838 in _dequeueEvent
    self._processObjectEvent(event)
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 627 in _processObjectEvent
    s.processObjectEvent(event)
  • File "/usr/lib/python2.5/site-packages/orca/script.py", line 296 in processObjectEvent
    self.listeners[key](event)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2975 in onStateChanged
    self.onFocus(event)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2533 in onFocus
    orca.setLocusOfFocus(event, newFocus)
  • File "/usr/lib/python2.5/site-packages/orca/orca.py", line 201 in setLocusOfFocus
    orca_state.locusOfFocus)
  • File "/usr/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 938 in locusOfFocusChanged
    newLocusOfFocus)
  • File "/usr/lib/python2.5/site-packages/orca/default.py", line 2262 in locusOfFocusChanged
    self.speechGenerator.getSpeech(newLocusOfFocus, False))
  • File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1684 in getSpeech
    return [" ".join(generator(obj, already_focused))]
  • File "/usr/lib/python2.5/site-packages/orca/speechgenerator.py", line 1252 in _getSpeechForTable
    child = obj.child(i)
  • File "/usr/lib/python2.5/site-packages/orca/atspi.py", line 1436 in child
    debug.printStack(debug.LEVEL_WARNING)
  • File "/usr/lib/python2.5/site-packages/orca/debug.py", line 136 in printStack
    traceback.print_stack(None, 100, debugFile)
Child at index 2 is not an Accessible
GOT BAD CHILD.
SPEECH OUTPUT: ''
SPEECH OUTPUT: 'tree table'
...
Comment 8 Willie Walker 2007-09-04 22:57:49 UTC
> Not committed yet. I just tried this and I was surprised
> to discover that we are still getting a stack trace (this is
> at the INFO debug level). It's being nicely caught, and we are
> no longer getting the second stack trace and the utterances 
> are being returned (see output snippet below).

Ahhh...that's good.  So, the real problem is this:

in _getSpeechForTable
    if child.state.count(atspi.Accessibility.STATE_SHOWING):
AttributeError: 'NoneType' object has no attribute 'state'

If that's the case, then a really simple patch might be to not do the try/except clause, but just do a one-liner patch:

    if child and child.state.count(atspi.Accessibility.STATE_SHOWING):

With this, atspi.py:child() would handle the bogus pidgin behavior, returning None for the child, and the one liner change would handle the None value.

What do you think?
Comment 9 Rich Burridge 2007-09-05 00:16:04 UTC
> So, the real problem is this:
>
> in _getSpeechForTable
>    if child.state.count(atspi.Accessibility.STATE_SHOWING):
> AttributeError: 'NoneType' object has no attribute 'state'

That's one of the problems (that was the second traceback).
Are you saying that there is no way to prevent the first traceback?

> If that's the case, then
> ...
> What do you think?

That should give us the same as what we've got (and is cleaner).
I would have thought we should be trying to prevent the first 
traceback though.
 
Comment 10 Willie Walker 2007-09-05 11:43:32 UTC
(In reply to comment #9)
> > So, the real problem is this:
> >
> > in _getSpeechForTable
> >    if child.state.count(atspi.Accessibility.STATE_SHOWING):
> > AttributeError: 'NoneType' object has no attribute 'state'
> 
> That's one of the problems (that was the second traceback).
> Are you saying that there is no way to prevent the first traceback?

It looks like we are handling the first exception in atspi.py:child() and using the traceback information purposely:

        if not newChild:
            # The problem with a child not existing is a bad one.
            # We want to issue a warning and we also want to know
            # where it happens.
            #
            debug.printStack(debug.LEVEL_WARNING)
            debug.println(debug.LEVEL_WARNING,
                          "Child at index %d is not an Accessible" % index)

That is, in order to not just silently swallow the problem and let errant toolkits continue to have these kinds of problems, we output the stack information at LEVEL_WARNING.  LEVEL_WARNING is used to decribe events of interest to end users or system managers or which indicate potential problems, but which Orca can deal with without crashing.

So, I think the simple clean "handle the None" fix is sufficient for our side of things, but we should keep this bug open and [blocked] until the blocker is fixed in pidgin (assuming it really is a problem in pidgin).
Comment 11 Rich Burridge 2007-09-05 15:32:11 UTC
Created attachment 95000 [details] [review]
Patch for trunk to prevent second traceback.
Comment 12 Rich Burridge 2007-09-05 15:33:43 UTC
Created attachment 95001 [details] [review]
Patch for gnome-2-20 branch to prevent second traceback

Fair enough. Your simple fix works nicely and is much
cleaner. As it's almost a no-brainer, I've committed
the patch to both the gnome-2-20 branch and SVN trunk
and will put this but into a "[pending]" state.

Please test.
Comment 13 Rich Burridge 2007-09-05 15:35:06 UTC
Ack. Forgot we were already [blocked]
Guess it doesn't make much sense to be [pending] and [blocked]
so please just test the workaround patch and comment 
if you see any problems. 

Thanks.
Comment 14 Joanmarie Diggs (IRC: joanie) 2007-09-06 04:23:14 UTC
I think this might actually be a gail bug.... Or something better addressed by a gail fix.

In my quest to get the %^&*$! expanders and levels made accessible (see bug 395781), I hacked some at gail and some at pidgin and in the process got rid of the dead accessibles by accident.

The trick to making the dead accessibles go away *seems* to be adding a fake/dummy renderer into the invisible column that is set as the expander_column in gtkblist.c's pidgin_blist_show().  What they've apparently done is used the strategy described here: http://scentric.net/tutorial/sec-misc-expander-visibility.html.  They didn't add a renderer for that column because, well, why bother?  So what is happening, as best as I can tell, is that the absence of the renderer is hitting this block of code in gailtreeview.c's gail_tree_view_ref_child():

  /* XXX FIXME: The code below avoids SEGV but it also avoids the issue;
   * probably we should be returning minimally-functional AtkObject instances
   * instead.  See bugzilla.gnome.org #331042.
   */
  if (renderer_list == NULL)
    return NULL;

it returns NULL and dead accessibles show up.

I suppose we *could* ask the Pidgin guys to modify their invisible expander hack by adding another hack....  But perhaps returning a minimally-functional AtkObject would address the problem better -- and do so for other apps that find the tutorial hack....

Just a thought....
Comment 15 Rich Burridge 2007-09-06 16:06:12 UTC
Thanks for investigating this further. Adding Li to the CC:
Li, could you please comment of Joanie's findings in comment #14
and tell us whether you think this might be a gail rather than a
pidgin bug.

Thanks.
Comment 16 Rich Burridge 2007-09-06 16:14:43 UTC
[Let's try that again].

Thanks for investigating this further. Adding Li to the CC:
Li, could you please comment of Joanie's findings in comment #14
and tell us whether you think this might be a gail rather than a
pidgin bug.

Thanks.
Comment 17 Li Yuan 2007-09-07 10:12:30 UTC
Sounds reasonable to fix in gail. Will make a patch after code freeze.
Comment 18 Li Yuan 2007-11-15 09:33:02 UTC
Please refer to http://bugzilla.gnome.org/show_bug.cgi?id=474504#c7
Comment 19 Joanmarie Diggs (IRC: joanie) 2007-11-16 00:43:32 UTC
I can confirm that Li's patch solves the dead accessibles problem.  Thanks Li!

(Am I the only one who thinks "The Dead Accessibles" is a band name just waiting for the right musicians?)
Comment 20 Joanmarie Diggs (IRC: joanie) 2007-11-19 15:21:44 UTC
Li, this bug got assigned to you somewhere along the line and your Gail patch fixes it. :-)  I think you can close this one out as well.
Comment 21 Li Yuan 2007-11-19 15:45:48 UTC
OK, thank you!