why can't I ptrace a thread?

why can't I ptrace a thread?

Post by Eric Taylo » Thu, 16 Aug 2001 04:49:41



I am using ptrace to try to attach to a process (one of a group of
processes which I assume is using threads) to read back it's program
counter so I can profile it. This works ok on a normal single threaded
process. But, when I try this on a child process of a group (which I
guess are threads - I am trying to look at mysqld) I cannot seem to
attach. If I try gdb on it, it causes the process to die. If I call ptrace
on it, I can attach but I cannot access the registers. Is there some
restriction using ptrace on child processes in a thread group?

eric

 
 
 

why can't I ptrace a thread?

Post by bill davids » Wed, 22 Aug 2001 05:59:37




| I am using ptrace to try to attach to a process (one of a group of
| processes which I assume is using threads) to read back it's program
| counter so I can profile it. This works ok on a normal single threaded
| process. But, when I try this on a child process of a group (which I
| guess are threads - I am trying to look at mysqld) I cannot seem to
| attach. If I try gdb on it, it causes the process to die. If I call ptrace
| on it, I can attach but I cannot access the registers. Is there some
| restriction using ptrace on child processes in a thread group?

The only thought I can share is that you want to be sure you have the
latest version. The newest strace I found on freshmeat, and the 2.4.6
kernel, play together far better for threads than earlier versions.
If you are lucky there might be a better version of ptrace, or a newer
kernel might help.

Just a thought to help until someone who has more info joins in ;-)

--

"In elementary school, in case of fire you have to line up quietly in a
single file line from smallest to tallest. What is the logic? Do tall
people burn slower?"
                --Warren Hutcherson

 
 
 

1. It's not bad canned meat...

Thanks for your time.  We at I.S.P.O.T. (The International Society
for the Preservation Of Trees (URL http://www.local-touch.com/ISPOT/)) feel
that electronic messages are great for getting the word out while preserving
our friend the tree.  Anyway, please stop by our home page!

Thanks again!

SusieQ

2. Snappy port for Linux

3. tcp/ip packet size

4. ptrace & threads

5. excluding /home from solaris 9 flarcreate

6. Threads don't run faster on Solaris SMP, Why?

7. ndvi plugin not workin'

8. WHY-WHY-WHY.....my Mitsumi CD don't seek at boot??!!!!!

9. Why IPC can't block-wait on thread preemption???

10. What's up with kernel 2.1.9's asm-i386/ptrace.h ?

11. :Why ptrace handles one byte at a time