https://bugs.kde.org/show_bug.cgi?id=407218

--- Comment #4 from Mark Wielaard <m...@klomp.org> ---
(In reply to Petar Jovanovic from comment #3)
> Mark, the sys-copy_file_range.stderr.exp does not cover all the cases.
> 
> Here is a exp diff on mips32:
> 
> 5a6,10
> > Syscall param copy_file_range(off_in) points to unaddressable byte(s)
> >    ...
> >    by 0x........: main (sys-copy_file_range.c:57)
> >  Address 0x........ is not stack'd, malloc'd or (recently) free'd
> >
> 21c26
> < ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
> ---
> > ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
> 
> In short, on mips32 one more issue is reported. How do you want to handle
> this? New exp file or something else?

O, lovely. So in that case the undefined memory points to an invalid address...
So we want the pointer to be defined to something valid and undefined.

Does the following work on mips32? (patch explicitly doesn't change the line
numbers of the test function calls to keep the exp file the same):

diff --git a/memcheck/tests/linux/sys-copy_file_range.c
b/memcheck/tests/linux/sys-copy_file_range.c
index 83981c6..589399c 100644
--- a/memcheck/tests/linux/sys-copy_file_range.c
+++ b/memcheck/tests/linux/sys-copy_file_range.c
@@ -3,8 +3,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
-#include <sys/syscall.h>
 #include <unistd.h>
+#include "../../memcheck.h"

 int main(int argc, char **argv)
 {
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
     /* Check valgrind will produce expected warnings for the
        various wrong arguments. */
     do {
-        void *t;
+        void *t = 0; VALGRIND_MAKE_MEM_UNDEFINED (&t, sizeof (void *));
         void *z = (void *) -1;

         ret = copy_file_range(fd_in, t, fd_out, NULL, len, 0);

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to