Question: strace detach as soon as attach

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


Hi,

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.

http://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg01669.html

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?
Thanks!

 [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-2.6.29.4, 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().
Or
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: <http://lists.strace.io/pipermail/strace-devel/attachments/20121019/1afaf78a/attachment.html>


More information about the Strace-devel mailing list