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

Loading core dump on spawn host with gdb isn't reading debug symbols from shared objects automatically

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • ALL
    • Dev Platform 2020-06-29, Dev Platform 2020-07-13, Dev Platform 2020-07-27
    • 9

      My typical workflow is to extract tarballs for the executables, debug symbols, and core dumps into the source-mongodb-mongo-master-xx directory and then to invoke gdb as follows. For --link-model=dynamic builds, gdb fails to read the debug symbols from the dist-test/lib/ directory.

      $ /opt/mongodbtoolchain/gdb/bin/gdb ./dist-test/bin/mongod ./dump_js.15583.core
      ...
      warning: Could not load shared library symbols for 605 libraries, e.g. /data/mci/fb4e7f494e41a1298b97bc36d5110734/src/dist-test/bin/../lib/libmongod_main.so.
      Use the "info sharedlibrary" command to see the complete listing.
      Do you need "set solib-search-path" or "set sysroot"?
      ...
      (gdb) info sharedlibrary
      From                To                  Syms Read   Shared Object Library
                                              No          /data/mci/fb4e7f494e41a1298b97bc36d5110734/src/dist-test/bin/../lib/libmongod_main.so
      

      Creating the /data/mci/fb4e7f494e41a1298b97bc36d5110734/src/ directory and extracting the executables and debug symbols (i.e. the dist-test/ directory) into it addresses this issue but is a hassle.

      Setting the following search path for shared objects also addresses the issue for me. Is there a way to make this more automatic?

      (gdb) set solib-search-path ./dist-test/lib
      Reading symbols from /data/mci/source-mongodb-mongo-master-601e8c/dist-test/lib/libmongod_main.so...
      Reading symbols from /data/mci/source-mongodb-mongo-master-601e8c/dist-test/lib/libmongod_main.so.debug...
      ...
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: