summaryrefslogtreecommitdiff
path: root/buildscripts/hang_analyzer.py
diff options
context:
space:
mode:
authorEddie Louie <eddie.louie@mongodb.com>2017-03-03 12:57:05 -0500
committerEddie Louie <eddie.louie@mongodb.com>2017-03-09 19:35:11 -0500
commitdbf7adc73da93308ec7e769bdfa1742c548e2f17 (patch)
tree008726c09f29d6b7fce79be355faf4be6e287978 /buildscripts/hang_analyzer.py
parentffe661dfdb7500cfd95f385a067a7fa7acf32b67 (diff)
downloadmongo-dbf7adc73da93308ec7e769bdfa1742c548e2f17.tar.gz
SERVER-27877 Write function to deduplicate stacks from different threads in GDB
Diffstat (limited to 'buildscripts/hang_analyzer.py')
-rwxr-xr-xbuildscripts/hang_analyzer.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/buildscripts/hang_analyzer.py b/buildscripts/hang_analyzer.py
index da000998711..118501b307b 100755
--- a/buildscripts/hang_analyzer.py
+++ b/buildscripts/hang_analyzer.py
@@ -302,6 +302,23 @@ class GDBDumper(object):
gdb_dir = os.path.join(script_dir, "gdb")
printers_script = os.path.join(gdb_dir, "mongo.py")
+ bt_command = "mongodb-uniqstack bt"
+ if sys.platform.startswith("sunos"):
+ '''
+ On Solaris, currently calling mongo-uniqstack leads to an error:
+
+ Thread 198 received signal SIGSEGV, Segmentation fault.
+ 0x0000000000000000 in ?? ()
+ Python Exception <class 'gdb.error'> The program being debugged was signaled while in a
+ function called from GDB.
+ GDB remains in the frame where the signal was received.
+ To change this behavior use "set unwindonsignal on".
+ Evaluation of the expression containing the function
+ (at 0x0x0) will be abandoned.
+ When the function is done executing, GDB will silently stop.
+ '''
+ bt_command = "thread apply all bt"
+
cmds = [
"set pagination off",
"attach %d" % pid,
@@ -309,7 +326,7 @@ class GDBDumper(object):
"info threads", # Dump a simple list of commands to get the thread name
"set python print-stack full",
"source " + printers_script,
- "thread apply all bt",
+ bt_command,
dump_command,
"mongodb-analyze",
"set confirm off",