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

Backtrace document should include buildInfo

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Environment:
      POSIX

      Backtrace documents include info about the environment that the process is running in:

      {
          "backtrace" : [
              ...
          ],
          "processInfo" : {
              "mongodbVersion" : "4.0.0-rc4",
              "gitVersion" : "ee1028693fe28bbfbd4dbc4030aed14493e0b2fb",
              "compiledModules" : [ ],
              "uname" : {
                  "sysname" : "Linux",
                  "release" : "4.13.0-32-generic",
                  "version" : "#35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018",
                  "machine" : "x86_64"
              },
              "somap" : [
                  ...
              ]
          }
      }
      

      Before you can interpret the addresses in the stacktrace you need to get the correct buildvariant debugsymbols file, which for released versions requires knowing the distmod and distarch. At present distmod has to be figured out heuristically from processInfo.uname.version (or some other out of band way), and distarch will usually (but maybe not always) be the same as processInfo.uname.machine. It would be much better if these values were already present in the backtrace document. We could add just fields for distmod/distarch, or maybe the whole buildEnvironment subdoc (from the buildInfo command), though this would add a fair bit to already verbose output.

      > db.serverBuildInfo()
      {
              "version" : "4.0.0-rc4",
              "gitVersion" : "ee1028693fe28bbfbd4dbc4030aed14493e0b2fb",
              "modules" : [ ],
              ...
              "buildEnvironment" : {
                      "distmod" : "ubuntu1604",
                      "distarch" : "x86_64",
                      "cc" : "/opt/mongodbtoolchain/v2/bin/gcc: gcc (GCC) 5.4.0",
                      "ccflags" : "-fno-omit-frame-pointer -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fstack-protector-strong -fno-builtin-memcmp",
                      "cxx" : "/opt/mongodbtoolchain/v2/bin/g++: g++ (GCC) 5.4.0",
                      "cxxflags" : "-Woverloaded-virtual -Wno-maybe-uninitialized -std=c++14",
                      "linkflags" : "-pthread -Wl,-z,now -rdynamic -Wl,--fatal-warnings -fstack-protector-strong -fuse-ld=gold -Wl,--build-id -Wl,--hash-style=gnu -Wl,-z,noexecstack -Wl,--warn-execstack -Wl,-z,relro",
                      "target_arch" : "x86_64",
                      "target_os" : "linux"
              },
              ...
              "ok" : 1
      }
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: