LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   backtrace and backtrace_symbols (http://www.linuxquestions.org/questions/programming-9/backtrace-and-backtrace_symbols-862918/)

tbucken 02-15-2011 05:37 PM

backtrace and backtrace_symbols
 
Hi,

I am attempting to generate stacktraces in a thread using the
system calls backtrace and backtrace_symbols

Code:

#define NUM_STACKFRAMES 50
  void *arr[NUM_STACKFRAMES];
  int nSize = backtrace(arr, NUM_STACKFRAMES);
  char **sym = backtrace_symbols(arr, nSize);
  char nl = '\n';
  int ii;
  for (ii = 0; ii < nSize; ii++) {
    SENDTOLOGS(alog,apstklog,sym[ii]);
    SENDTOLOGS(alog,apstklog, &nl);
  }
  free(sym);
  return ii;

backtrace_symbols is able to find function names in the
library that has the stacktracing code but is unable to find the
function names in any of our other libraries - backtrace has returned the
correct address.

I used the the flags -rdynamic and -fno-omit-frame-pointer to build
our libraries.

Any suggestions for what I might try ?


Code:

lib15.so(_ZN6UIQCtl14ValidateOptionEP11IConnectionP9an_option15an_option_scopePcP15an_option_value+0xb6) [0x2aab5dd9a8]
lib15.so(_ZN20saint_iqthresholdctl14ValidateOptionEP11IConnectionP9an_option15an_option_scopePcP15an_option_value+0x4d) [0x2aab5db13f]
lib16_r.so [0x2a958de1fe]
lib16_r.so [0x2a958df77b]


Tom Bucken(tbucken@sybase.com)


All times are GMT -5. The time now is 03:23 AM.