* tests/test-strstr.c (main): Use memory fence, in order to be
more likely to trigger Debian bug 521737.
* modules/strstr-tests (Files): Pull in additional files.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-06-08 Eric Blake <ebb9@byu.net>
+ test-strstr: use memory fence, when possible
+ * tests/test-strstr.c (main): Use memory fence, in order to be
+ more likely to trigger Debian bug 521737.
+ * modules/strstr-tests (Files): Pull in additional files.
+
memchr: no longer obsolete, for wider field testing
* modules/memchr (Status, Notice): Delete, this module is no
longer obsolete.
Files:
tests/test-strstr.c
+tests/zerosize-ptr.h
+m4/mmap-anon.m4
Depends-on:
+extensions
+getpagesize
configure.ac:
AC_CHECK_DECLS_ONCE([alarm])
+gl_FUNC_MMAP_ANON
+AC_CHECK_HEADERS_ONCE([sys/mman.h])
+AC_CHECK_FUNCS_ONCE([mprotect])
Makefile.am:
TESTS += test-strstr
check_PROGRAMS += test-strstr
-
#include <stdlib.h>
#include <unistd.h>
+#include "zerosize-ptr.h"
+
#define ASSERT(expr) \
do \
{ \
This is a bug in memchr(), see the Austin Group's clarification
<http://www.opengroup.org/austin/docs/austin_454.txt>. */
const char *fix = "aBaaaaaaaaaaax";
- char *input = malloc (strlen (fix) + 1);
+ char *page_boundary = (char *) zerosize_ptr ();
+ size_t len = strlen (fix) + 1;
+ char *input = page_boundary ? page_boundary - len : malloc (len);
const char *result;
strcpy (input, fix);
result = strstr (input, "B1x");
ASSERT (result == NULL);
- free (input);
+ if (!page_boundary)
+ free (input);
}
{