Getting real instruction pointer in pthreads?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Getting real instruction pointer in pthreads?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Getting real instruction pointer in pthreads?  
David Frascone


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:22 PM

I'm currently trying to track down some memory corruption in a heavily
multi-threaded application.  So, when a corruption occurs, I'd like to
take a snapshot of all threads, to see what they're doing.

I've looked at proc(5), and at kstkeip, but it's value is outside of
the range [startcode-endcode], and outside of my program's address
space.  I'm assuming I'm having some virtual-vs-physical memory
address problems.

So, perhaps I'm approaching this incorrectly.  Is there a way for one
thread to spin through the other threads and grab current instruction
pointers?

And, would it also be possible to grab stack pointers *and* walk the
stacks of the other threads?

Or, am I stuck with having to signal each thread to dump it's own
pointers/stack?

Please respond by e-mail,


-Dave





[ Post a follow-up to this message ]



    Re: Getting real instruction pointer in pthreads?  
examnotes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:22 PM

chaos@mindspring.com (David Frascone) writes:
quote:
> I'm currently trying to track down some memory corruption in a heavily > multi-threaded application. So, when a corruption occurs, I'd like to > take a snapshot of all threads, to see what they're doing.
valgrind is usually helpful with finding that sort of bugs.
quote:
> I've looked at proc(5), and at kstkeip, but it's value is outside of > the range [startcode-endcode], and outside of my program's address > space. I'm assuming I'm having some virtual-vs-physical memory > address problems. > > So, perhaps I'm approaching this incorrectly. Is there a way for one > thread to spin through the other threads and grab current instruction > pointers? > > And, would it also be possible to grab stack pointers *and* walk the > stacks of the other threads? > > Or, am I stuck with having to signal each thread to dump it's own > pointers/stack?
GDB can do all that for you. Run "gdb program pid-of-program" to attach to a running instance of the program. -- Måns Rullgård mru@kth.se




[ Post a follow-up to this message ]



    Re: Getting real instruction pointer in pthreads?  
David Frascone


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:22 PM

mru@kth.se (Måns Rullgård) wrote in message news:<yw1xptduh5t5.fsf@kth.se>...
quote:
> chaos@mindspring.com (David Frascone) writes: > > > valgrind is usually helpful with finding that sort of bugs.
Sorry, forgot to mention: the architecture is PPC.
quote:
> > GDB can do all that for you. Run "gdb program pid-of-program" to > attach to a running instance of the program.
I need this for a crash file, for post-mortem debugging. -Dave




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:24 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register