[orca] Add debugging info to help track down Orca suicide due to timeout
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add debugging info to help track down Orca suicide due to timeout
- Date: Fri, 6 Apr 2012 18:56:57 +0000 (UTC)
commit 9adab486cd49b5451dc2cd56ca79dbc12d22e096
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Apr 6 14:54:28 2012 -0400
Add debugging info to help track down Orca suicide due to timeout
src/orca/orca.py | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 287cfa7..57306e4 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -26,7 +26,7 @@ __version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
"Copyright (c) 2010-2011 The Orca Team" \
- "Copyright (c) 2012 Igalia"
+ "Copyright (c) 2012 Igalia, S.L."
__license__ = "LGPL"
import argparse
@@ -1265,6 +1265,7 @@ def timeout(signum=None, frame=None):
debug.println(debug.LEVEL_SEVERE,
"TIMEOUT: something has hung. Aborting.")
debug.printStack(debug.LEVEL_ALL)
+ examineProcesses()
die(EXIT_CODE_HANG)
def shutdown(script=None, inputEvent=None):
@@ -1364,6 +1365,34 @@ def abortOnSignal(signum, frame):
% signum)
die(signum)
+def getCmdline(pid):
+ try:
+ openFile = os.popen('cat /proc/%s/cmdline' % pid)
+ cmdline = openFile.read()
+ openFile.close()
+ except:
+ cmdline = '(Could not obtain cmdline)'
+ cmdline = cmdline.replace('\x00', ' ')
+
+ return cmdline
+
+def examineProcesses():
+ desktop = pyatspi.Registry.getDesktop(0)
+ debug.println(
+ debug.LEVEL_ALL, 'INFO: Desktop has %i apps:' % desktop.childCount)
+ for i, app in enumerate(desktop):
+ pid = app.get_process_id()
+ cmd = getCmdline(pid)
+ try:
+ name = app.name
+ except:
+ name = 'ERROR: Could not get name'
+ else:
+ if name == '':
+ name = 'WARNING: Possible hang'
+ debug.println(
+ debug.LEVEL_ALL, '%3i. %s (pid: %s) %s' % (i+1, name, pid, cmd))
+
def multipleOrcas():
"""Returns True if multiple instances of Orca are running
which are owned by the same user."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]