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 319652 - Investigate Orca hanging.
Investigate Orca hanging.
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
unspecified
Other All
: High critical
: ---
Assigned To: Willie Walker
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-24 20:45 UTC by Rich Burridge
Modified: 2006-08-10 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to initialize the ORB in threaded mode (1.60 KB, patch)
2006-05-24 00:47 UTC, Willie Walker
committed Details | Review
Patch to move script processing of input events to the gidle handler (17.91 KB, patch)
2006-06-16 14:12 UTC, Willie Walker
committed Details | Review
Patch to abort Orca if a hang is detected. (11.55 KB, patch)
2006-07-26 14:29 UTC, Willie Walker
committed Details | Review

Description Rich Burridge 2005-10-24 20:45:20 UTC
Orca can hang and we don't know why.  We need to determine a way
to at least figure out where in Orca this is happening.
Comment 1 Willie Walker 2006-04-09 09:21:39 UTC
One of the hangs was attempting to keep the application list up to date in Orca by automatically building it whenever various at-spi events were received (e.g., children added and removed from the desktop).  This has been removed and a getKnownApplications method has been added to at-spi for scripts that want to get the list of applications.

Orca can still hang, however, when making a call to with the at-spi and gnome-speech interfaces. I'm not sure of the exact conditions for this, or if it's even predictable.  There's some work being done in the at-spi infrastructure to provide multiple threads for handling at-spi events from applications, and this might help some.

I put some experimental threading.Timer code into orca.py and focus_tracking_presenter.py to try to detect hangs, but I wasn't satified with the results.  It's still in there (commented out) for further experimentation, though.
Comment 2 Willie Walker 2006-05-24 00:47:15 UTC
Created attachment 66100 [details] [review]
Patch to initialize the ORB in threaded mode

This is based upon what we've learned in bug 342614.  It initializes the ORB in threaded mode.  With this patch in place, I slammed on gedit while being forced to watch that sappy show, American Idol.  I couldn't get it to hang, but that's only a data point.  Intermittent problems are a bear to find.  But, this patch is at least based upon some analysis.
Comment 3 Willie Walker 2006-06-16 14:12:58 UTC
Created attachment 67485 [details] [review]
Patch to move script processing of input events to the gidle handler

The processing of input events, such as keyboard and braille commands to control Orca itself, can often result in AT-SPI calls buy scripts.  This patch moves the processing of input events by scripts to the gidle handler, which is where we tend to do all of our AT-SPI calls.

One the remaining things to do is to refactor speech so things like SayAll and speech progress handling are also done in the gidle handler.  With the refactor of speech, the bulk of Orca logic will be done in a single thread, helping prevent deadlocks as much as possible.
Comment 4 Willie Walker 2006-07-26 14:21:33 UTC
I modified the Orca signal handlers to dump a stack trace.  The way this can be used is as follows:

1) Enable orca.debug.debugLevel=orca.debug.LEVEL_ALL
2) Run Orca, wait for a hang.
3) From a virtual console or other means, find the orca process and
   kill -TERM it.  You might need to do this several times - what you're
   looking for is a stack trace to be put at the end of debug.out.

The stack trace above can give some insight.  For example, I discovered that the gnome-speech driver for DECtalk was hanging on a call to TextToSpeechReset, which caused Orca's call to speech.stop to hang, which then hung Orca.
 
Comment 5 Willie Walker 2006-07-26 14:29:48 UTC
Created attachment 69667 [details] [review]
Patch to abort Orca if a hang is detected.

This patch puts a timer in place when performing calls that might take a long time.  If the timer expires, orca will abort.
Comment 6 Willie Walker 2006-08-10 16:29:01 UTC
We've done a lot of work here and have eliminated many hangs.  We've also added defensive code to Orca itself to quit if it detects a hang.  The last remaining badness seems to be in two areas:

1) DECtalk hanging.  This is not an Orca bug and the defensive code we added will at least detect this, allowing Orca to be restarted.

2) Flat review hangs.  These are covered in other bugs.

If any more hangs occur, we will enter specific bugs for them.