Review your favorite Linux distribution.
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 10-02-2007, 11:44 AM   #1
Registered: Sep 2007
Distribution: Ubuntu
Posts: 33

Rep: Reputation: 15
stack backtrace with pthreads

Hi all,

I was just wondering if there exist any issues of using stack backtraces ( int backtrace (void **buffer, int size) ) with multithreaded applications, specifically pthreads compared to using backtraces with single process/thread applications. I know the backtraces are for back-tracing the current thread, but just wondering if I should be aware of anything uncertain to happen if I use the two together or any tips .

The reason I'm asking this question is that its easier to debug applications when you know a problem wont occur because of some issue (namely backtrace with pthreads) and you can then narrow down where the problem can occur.

Thanks in advance!
Old 10-05-2007, 02:41 PM   #2
Registered: May 2002
Location: dracut MA
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 109Reputation: 109
under linux, each thread is given its own stack. so in theory, you should be fine. You might want to check out my new blog ( where my first post shows an alternate backtracing function which should be portable. (tested on x86 and powerpc linux, and on cygwin).
Old 10-06-2007, 05:42 AM   #3
Registered: Sep 2007
Distribution: Ubuntu
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks orgcandman. Thats a nice blog you've got there.


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
Default stack size on Linux/glibc/pthreads? rameshnj Linux - Newbie 3 11-03-2009 02:55 AM
Difference b/t Kernel stack and User stack hazzyb Linux - Software 2 09-29-2008 07:40 PM
Getting stack backtrace for all instantiated threads bcreane Programming 2 05-02-2006 10:58 AM
Backtrace / stack dump for all Linux platforms GreyBeard Programming 7 07-21-2005 12:04 PM
pthreads stack frame lock up detection flakjacket Linux - General 0 06-26-2004 11:19 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:07 PM.

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