Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-1971

Debug tracebacks don't show addresses of static functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.15.0
    • None
    • None
    • None
    • i

    Description

      Trying to see the stack trace of a leaked qd_buffer_t is a problem when static functions do not have their addresses exported. For instance:

      Leak: 2021-02-19 15:32:58.999880 -0500 type: qd_buffer_t address: 0x21aa310
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(qd_alloc+0x20c) [0x7f50038107a0]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(new_qd_buffer_t+0x26) [0x7f5003812491]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(qd_buffer+0xd) [0x7f5003812576]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(grant_read_buffers+0xe2) [0x7f5003809e45]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(handle_incoming+0x485) [0x7f500380a3aa]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(handle_connection_event+0x4ca) [0x7f500380bc5e]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(+0xc7aca) [0x7f5003884aca]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(+0xc7b07) [0x7f5003884b07]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(+0xc8a37) [0x7f5003885a37]
      /home/chug/git/qpid-dispatch/build/src/libqpid-dispatch.so(+0xc8b4b) [0x7f5003885b4b]
      

      Having a stack address shown as libqpid-dispatch.so(+0xc8b4b) [0x7f5003885b4b] is absolutely true but it doesn't reveal anything useful in this context. The stack frame identified by handle-incoming was also suppressed as a library address offset until the static attribute was removed.

      Exporting addresses of non-inline, static functions could be effected by linker tricks. Or in source by making a STATIC macro that resolves to blank or to static based on the build type: the functions are no longer static and the addresses are exported.

      The same problem/issue exists for gdb tracebacks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chug Charles E. Rolke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: