Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-15-2011, 04:37 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 5

Rep: Reputation: 0
Question backtrace and backtrace_symbols


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

  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, &nl);
  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: [0x2aab5dd9a8] [0x2aab5db13f] [0x2a958de1fe] [0x2a958df77b]

Tom Bucken(

Last edited by XavierP; 02-16-2011 at 11:48 PM. Reason: code tags and moved to Programming


glibc, [c]

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backtrace and _cxa_demangle mshindo Programming 5 05-26-2009 06:50 PM
Generating a backtrace for dummies (me). Daws Programming 4 11-17-2007 07:18 PM
stack backtrace with pthreads virtualCoder Programming 2 10-06-2007 05:42 AM
backtrace your program? lswhbcb Programming 6 05-24-2007 11:35 PM
Alsa backtrace? hosler Slackware 9 02-07-2006 12:23 AM

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration