Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50476

gdb.lookup_type on dynamically linked mongo programs can be prohibitively expensive

    • Server Development Platform
    • Fully Compatible
    • ALL
    • Hide

      gdb ./path/to/mongod
      $ b main
      $ r
      $ python print(gdb.lookup_type("std::__cxx11::string"))

      Show
      gdb ./path/to/mongod $ b main $ r $ python print(gdb.lookup_type("std::__cxx11::string"))
    • 6

      Calls to gdb.lookup_type when using gdb are ubiquitous. Perhaps most notably is when pretty printing strings.

      Running gdb on a dynamically linked mongo program is struggling mightily compared to a statically linked program with the following invocations:

      • gdb.lookup_type("std::__cxx11::string")
      • gdb.lookup_type("std::__cxx11::wstring")

      On a mongo shell, the former call took maybe a minute? (pegs a single CPU) and consumed ~6-7GB of memory before succeeding. A follow-up call succeeded immediately (I assume the result was cached by gdb).

      However when examining mongod on a spawn host, the lookup consumes all of the system memory and OOMs the gdb program before it gets a chance to succeed.

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: