summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-01-11 15:11:25 -0500
committerRamon Fernandez <ramon@mongodb.com>2016-02-01 13:36:12 -0500
commit95ed4c16475180d5d95256778e326d0e1277c763 (patch)
tree24ef4dc7407b8542c54b330b5de608c301c46133
parent159b239d31aff2c86ec1e0dc5c982d8d385c0ed0 (diff)
downloadmongo-95ed4c16475180d5d95256778e326d0e1277c763.tar.gz
SERVER-22028 hang_analyzer should fail when run against unsupported lldb
(cherry picked from commit 95edfa113659c384819a5e6067a9fc88ad8ef2ec)
-rwxr-xr-xbuildscripts/hang_analyzer.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/buildscripts/hang_analyzer.py b/buildscripts/hang_analyzer.py
index 338c6c96446..bcdf34ea411 100755
--- a/buildscripts/hang_analyzer.py
+++ b/buildscripts/hang_analyzer.py
@@ -5,7 +5,7 @@
A prototype hang analyzer for MCI integration to help investigate test timeouts
1. Script supports taking dumps, and/or dumping a summary of useful information about a process
-2. Script will iterate through a list of interesting processes (mongo, mongod, and mongos),
+2. Script will iterate through a list of interesting processes (mongo, mongod, and mongos),
and run the tools from step 1.
Supports Linux, MacOS X, and Windows.
@@ -187,7 +187,23 @@ class LLDBDumper(object):
stream.write("INFO: Debugger %s, analyzing %d\n" % (dbg, pid))
- call([dbg, "--version"])
+ lldb_version = callo([dbg, "--version"])
+
+ stream.write(lldb_version)
+
+ # Do we have the XCode or LLVM version of lldb?
+ # Old versions of lldb do not work well when taking commands via a file
+ # XCode (7.2): lldb-340.4.119
+ # LLVM - lldb version 3.7.0 ( revision )
+
+ if 'version' not in lldb_version:
+ # We have XCode's lldb
+ lldb_version = lldb_version[lldb_version.index("lldb-"):]
+ lldb_version = lldb_version.replace('lldb-', '')
+ lldb_major_version = int(lldb_version[:lldb_version.index('.')])
+ if lldb_major_version < 340:
+ stream.write("WARNING: Debugger lldb is too old, please upgrade to XCode 7.2\n")
+ return
cmds = [
"attach -p %d" % pid,