Professional Web Applications Themes

Getting real instruction pointer in pthreads? - UNIX Programming

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* ...

  1. #1

    Default Getting real instruction pointer in pthreads?

    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
    David Guest

  2. #2

    Default Re: Getting real instruction pointer in pthreads?

    com (David Frascone) writes:
     

    valgrind is usually helpful with finding that sort of bugs.
     

    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
    se
    Måns Guest

  3. #3

    Default Re: Getting real instruction pointer in pthreads?

    se (Måns Rullgård) wrote in message news:<se>... 
    >
    > valgrind is usually helpful with finding that sort of bugs.[/ref]

    Sorry, forgot to mention: the architecture is PPC.
     
    >
    > GDB can do all that for you. Run "gdb program pid-of-program" to
    > attach to a running instance of the program.[/ref]

    I need this for a crash file, for post-mortem debugging. :(

    -Dave
    David Guest

Similar Threads

  1. Which lib for pthreads?
    By Jonathon in forum FreeBSD
    Replies: 10
    Last Post: March 7th, 03:45 PM
  2. --enable-pthreads option
    By James in forum Ruby
    Replies: 2
    Last Post: January 9th, 03:25 PM
  3. Mouse pointer flickers between hand and pointer
    By enutty webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 15
    Last Post: December 5th, 05:07 PM
  4. Pthreads and SIGCHLD
    By Chris in forum UNIX Programming
    Replies: 5
    Last Post: September 11th, 08:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139