summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2023-01-09 16:05:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-09 16:52:58 +0000
commitafd5fda2f81419f45f321d425bbcf9127c738ac8 (patch)
tree98a84a22523e082038dc72ffa57beabb54c325a2
parent91fe76bf50c9e2f0b0bc34489d72ae3a31276b98 (diff)
downloadmongo-afd5fda2f81419f45f321d425bbcf9127c738ac8.tar.gz
SERVER-72613 Run gdb with --readnever when only taking core dumps.
-rw-r--r--buildscripts/resmokelib/hang_analyzer/dumper.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/hang_analyzer/dumper.py b/buildscripts/resmokelib/hang_analyzer/dumper.py
index 92d58d7d190..be9d44fc987 100644
--- a/buildscripts/resmokelib/hang_analyzer/dumper.py
+++ b/buildscripts/resmokelib/hang_analyzer/dumper.py
@@ -479,7 +479,15 @@ class GDBDumper(Dumper):
cmds = self._prefix() + self._process_specific(pinfo, take_dump, logger) + self._postfix()
- call([dbg, "--quiet", "--nx"] + list(
+ # gcore is both a command within GDB and a script packaged alongside gdb. The gcore script
+ # invokes the gdb binary with --readnever to avoid spending time loading the debug symbols
+ # prior to taking the core dump. The debug symbols are unneeded to generate the core dump.
+ #
+ # For reference:
+ # https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/gcore.in;h=34860de630cf0ee766e102eb82f7a3fddba6b368#l101
+ skip_reading_symbols_on_take_dump = ["--readnever"] if take_dump else []
+
+ call([dbg, "--quiet", "--nx"] + skip_reading_symbols_on_take_dump + list(
itertools.chain.from_iterable([['-ex', b] for b in cmds])), logger,
self._timeout_seconds_for_gdb_process, pinfo)