Question: strace detach as soon as attach

Jovi Zhang bookjovi at
Fri Oct 19 08:28:25 UTC 2012


I encounter a problem in strace 4.5.19 version(for arm), strace detach as
soon as attach.

I got below old bug report in this mailing list, which have same problem
with my situation.

Unfortunately, I don't get answer on that bug report, so is there anyone
can tell me that this bug is already fixed in strace or kernel?

 [bug] strace detach as soon as attach

OneGun Lee
Wed, 07 Jul 2010 23:13:48 -0700

Hi, all

I tried to use strace-4.5.15(and .20) on linux-, arm-cortex-a8.

but strace was detached as soon as was attached one process.

# strace -p 1711 -d
Process 1711 attached - interrupt to quit
 [wait(0x137f) = 1711]
pid 1711 stopped, [SIGSTOP]
 [wait(0x57f) = 1711]
pid 1711 stopped, [SIGTRAP]
Process 1711 detached

So, I debuged strace.
After attach, strace try to ptrace(PTRACE_PEEKTEXT) and input param
is kernel space's address(0xFFFFxxxx).
This kernel space address's data is scno(restart_syscall).

address = 0xffff051c, data = 0xef900000(restart_syscall)

This command is sent kernel mode.
and than, arch_ptrace,kernel function, try to get data this address.
so this function call access_process_vm() -> get_user_pages().

get_user_pages() function make error because start address param is kernel
space's address.
so strace is detached.
I think that it is bug to need fix.
If address to want to get data is in kernel space, access_process_vm() just
read data. don't call get_user_pages().
strace have not try to peek data, if address is in kernel space.

How do you think about this problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Strace-devel mailing list