summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2023-01-09 18:05:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-09 18:43:00 +0000
commit0a997440edbb4bb546068acf2396ba5d254f3df0 (patch)
tree5e4086739ec8498859a65ac205ca46a23904bede
parent6e0f8d23b304375591c7f5bce257cea348ae1928 (diff)
downloadmongo-0a997440edbb4bb546068acf2396ba5d254f3df0.tar.gz
SERVER-72613 Run gdb with --readnever when only taking core dumps.
(cherry picked from commit afd5fda2f81419f45f321d425bbcf9127c738ac8)
-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 e5112b870b3..2c4d4b761d7 100644
--- a/buildscripts/resmokelib/hang_analyzer/dumper.py
+++ b/buildscripts/resmokelib/hang_analyzer/dumper.py
@@ -458,7 +458,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._root_logger.info("Done analyzing %s processes with PIDs %s", pinfo.name,