Charles E. Rolke created DISPATCH-1971:
------------------------------------------

             Summary: Debug tracebacks don't show addresses of static functions
                 Key: DISPATCH-1971
                 URL: https://issues.apache.org/jira/browse/DISPATCH-1971
             Project: Qpid Dispatch
          Issue Type: Improvement
    Affects Versions: 1.15.0
         Environment: i
            Reporter: Charles E. Rolke


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:
{code:java}
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]
{code}
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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to