<div>Hi,</div>
<div> </div>
<div>I encounter a problem in strace 4.5.19 version(for arm), strace detach as soon as attach.</div>
<div> </div>
<div>I got below old bug report in this mailing list, which have same problem with my situation.</div>
<div> </div>
<div><a href="http://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg01669.html">http://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg01669.html</a></div>
<div> </div>
<div>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? </div>
<div>Thanks!</div>
<div> </div>
<div>
<div style="TEXT-TRANSFORM:none;BACKGROUND-COLOR:rgb(255,255,255);TEXT-INDENT:0px;FONT:medium monospace;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(0,103,146);WORD-SPACING:0px" class="msgHead">
<h1 style="PADDING-BOTTOM:0px;MARGIN:0px;PADDING-LEFT:0px;PADDING-RIGHT:0px;FONT-SIZE:18px;PADDING-TOP:1em"><span style="PADDING-RIGHT:10px;FONT-WEIGHT:bold" class="subject">[bug] strace detach as soon as attach</span></h1>
<p style="MARGIN-TOP:0px"><span style="FONT-STYLE:italic" class="sender">OneGun Lee</span><br><span style="PADDING-RIGHT:10px;COLOR:rgb(136,136,136)" class="date">Wed, 07 Jul 2010 23:13:48 -0700</span></p></div>
<div style="TEXT-TRANSFORM:none;BACKGROUND-COLOR:rgb(255,255,255);TEXT-INDENT:0px;WIDTH:1199px;FONT:medium monospace;WHITE-SPACE:normal;FLOAT:left;LETTER-SPACING:normal;COLOR:rgb(0,0,0);WORD-SPACING:0px" class="msgBody">
<pre>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?</pre></div></div>