<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 15, 2019 at 9:53 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)"><div><br></div><div><br></div><hr id="gmail-m_8425705745195182495zwchr"><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:small">Hi Jason,</div><div style="font-size:small"><br></div><div style="font-size:small">A new failure was occured after applying this new patch.</div><div style="font-size:small"><br></div><div style="font-size:small">From our observation, the latest process_vm_readv03.c failed with process_vm_readv() Invalid argument error on rhel7.3 platfrom. We suspect that this problem maybe caused by glibc or compiler, because if compile the test program with -O0 it get pass, but with the ltp default optimization -O2 it get fail.  Also, if we revert this new patch, the test PASS whatever with -O2 and -O0, that's very strange.</div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>One difference is that the extra function promoted int to long.<br></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Good catch.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)"><div></div><div>Can you try with patch below? (Note that I dropped also root requirement, man page</div><div>says that it has same requirements as ptrace - you should be able to read from processes you own)<br></div><div><br></div></div></div></blockquote><div><span class="gmail_default" style="font-size:small"></span></div><div>This change works for me<span class="gmail_default" style="font-size:small">(one comment in below).</span></div><div class="gmail_default"><br></div><div class="gmail_default">But there still have a tiny question, in the syscall tracing log, I noticed a process_vm_readv() calling does not get this failure in function fetch_remote_addrs, what makes it difference with other two calls is something I'm thinking now.</div><div class="gmail_default"><br></div><div class="gmail_default">====Tracing log without '0L' change====</div><div class="gmail_default"><div class="gmail_default">12211 process_vm_readv(12211, 0, 0, 0, 0, 140728898420736) = -1 EINVAL (Invalid argument)</div><div class="gmail_default">...</div><div class="gmail_default">12213 process_vm_readv(12212, [{"\300`\334\0\0\0\0\0`\2\335\0\0\0\0\0\340\26\335\0\0\0\0\0\220h\335\0\0\0\0\0"..., 80}], 1, [{0xdc6060, 80}], 1, 0) = 80</div><div class="gmail_default">...</div></div><div><span class="gmail_default" style="font-size:small">12213 process_vm_readv(12212, 0x7ffecef1e330, 4, 0xdc60c0, 10, 140728898420736) = -1 EINVAL (Invalid argument)</span> </div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)"><div><br></div><div>diff --git a/testcases/kernel/syscalls/cma/process_vm_readv03.c b/testcases/kernel/syscalls/cma/process_vm_readv03.c<br>index 45f7c92e499c..1cec442b3456 100644<br>--- a/testcases/kernel/syscalls/cma/process_vm_readv03.c<br>+++ b/testcases/kernel/syscalls/cma/process_vm_readv03.c<br>@@ -181,7 +181,7 @@ static long *fetch_remote_addrs(void)<br>        remote.iov_len = len;<br> <br>        TEST(ltp_syscall(__NR_process_vm_readv, pids[0], &local,<br>-                        1, &remote, 1, 0));<br>+                        1, &remote, 1, 0L));<br></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">To make things more safely, probably we'd better change all the integer parameter too?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">-                        1, &remote, 1, 0));</div><div class="gmail_default" style="font-size:small">+                        1L, &remote, 1L, 0L));</div></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div></div></div>