On Solaris, link to backtrace() at run-time or emulate it if not found

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.4.6, 2.5.1
    • Affects Version/s: 2.2.0
    • Component/s: Logging
    • None
    • Environment:
      Oracle Solaris
    • Fully Compatible
    • Solaris
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Solaris 11 has a working backtrace() function (which we use for stack traces), but Solaris 10 does not. When present, this function, and related functions backtrace_symbols and backtrace_symbols_fd, are found in libc.so.1, which is generally in /lib/64 (aka /lib/amd64).

      We should not have an external reference to backtrace but should instead search for it in libc.so.1 and use it if found. If not found, we should emulate it using printstack() and walkcontext(). This will make the same binary runnable on both Solaris 10 and Solaris 11 and will use the native function on Solaris 11.

      References:
      https://blogs.oracle.com/mandalika/entry/c_c_printing_stack_trace
      man page for walkcontext / printstack

      Old description:
      backtrace() symbol does not exist on all Solaris (but it apparently exists for our build?)
      We should investigate and remove backtrace() support from Solaris

      ld.so.1: mongod: fatal: relocation error: file mongod: symbol backtrace:
      referenced symbol not found
      

              Assignee:
              Tad Marshall
              Reporter:
              Eric Milkie
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: