This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.27.9000-414-ged98310
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 23 May 2018 11:01:37 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-414-ged98310
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via ed983107bbc62245b06b99f02e69acf36a0baa3e (commit)
from 9aaaab7c6e4176e61c59b0a63c6ba906d875dc0e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ed983107bbc62245b06b99f02e69acf36a0baa3e
commit ed983107bbc62245b06b99f02e69acf36a0baa3e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 23 03:59:56 2018 -0700
Add a test case for [BZ #23196]
[BZ #23196]
* string/test-memcpy.c (do_test1): New function.
(test_main): Call it.
diff --git a/ChangeLog b/ChangeLog
index 8032adf..8e69700 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #23196]
+ * string/test-memcpy.c (do_test1): New function.
+ (test_main): Call it.
+
2018-05-23 Andreas Schwab <schwab@suse.de>
[BZ #23196]
diff --git a/string/test-memcpy.c b/string/test-memcpy.c
index 45f20a6..3c8066d 100644
--- a/string/test-memcpy.c
+++ b/string/test-memcpy.c
@@ -212,6 +212,50 @@ do_random_tests (void)
}
}
+static void
+do_test1 (void)
+{
+ size_t size = 0x100000;
+ void *large_buf;
+
+ large_buf = mmap (NULL, size * 2 + page_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (large_buf == MAP_FAILED)
+ {
+ puts ("Failed to allocat large_buf, skipping do_test1");
+ return;
+ }
+
+ if (mprotect (large_buf + size, page_size, PROT_NONE))
+ error (EXIT_FAILURE, errno, "mprotect failed");
+
+ size_t arrary_size = size / sizeof (uint32_t);
+ uint32_t *dest = large_buf;
+ uint32_t *src = large_buf + size + page_size;
+ size_t i;
+
+ for (i = 0; i < arrary_size; i++)
+ src[i] = (uint32_t) i;
+
+ FOR_EACH_IMPL (impl, 0)
+ {
+ memset (dest, -1, size);
+ CALL (impl, (char *) dest, (char *) src, size);
+ for (i = 0; i < arrary_size; i++)
+ if (dest[i] != src[i])
+ {
+ error (0, 0,
+ "Wrong result in function %s dst \"%p\" src \"%p\" offset \"%zd\"",
+ impl->name, dest, src, i);
+ ret = 1;
+ break;
+ }
+ }
+
+ munmap ((void *) dest, size);
+ munmap ((void *) src, size);
+}
+
int
test_main (void)
{
@@ -253,6 +297,9 @@ test_main (void)
do_test (0, 0, getpagesize ());
do_random_tests ();
+
+ do_test1 ();
+
return ret;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
string/test-memcpy.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources