Add regression test for mprotect on pinned memory
PATCH 1/1 Add regression test for mprotect on pinned memory
This tests both the original issue of mprotect reintroducing COW pages to Xenomai processes as well as the recently fixed zero page corruption.
Signed-off-by Jan Kiszka <[email protected]>
--- src/testsuite/regression/native/Makefile.am | 2 +- src/testsuite/regression/native/Makefile.in | 16 +++- src/testsuite/regression/native/mprotect.c | 128 +++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 src/testsuite/regression/native/mprotect.c
src/testsuite/regression/native/Makefile.am +1 -1
@@ -2,7 +2,7 @@ tstdir = @XENO_TEST_DIR@/regression/native noinst_HEADERS = check.h -tst_PROGRAMS = leaks tsc heap sigdebug +tst_PROGRAMS = leaks tsc heap sigdebug mprotect CPPFLAGS = $(XENO_USER_CFLAGS) \ -I$(top_srcdir)/include
src/testsuite/regression/native/Makefile.in +13 -3
@@ -37,7 +37,7 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ tst_PROGRAMS = leaks$(EXEEXT) tsc$(EXEEXT) heap$(EXEEXT) \ - sigdebug$(EXEEXT) + sigdebug$(EXEEXT) mprotect$(EXEEXT) subdir = src/testsuite/regression/native DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in
@@ -70,6 +70,12 @@ leaks_LDADD = $(LDADD) leaks_DEPENDENCIES = ../../../skins/native/libnative.la \ ../../../skins/rtdm/librtdm.la \ ../../../skins/common/libxenomai.la +mprotect_SOURCES = mprotect.c +mprotect_OBJECTS = mprotect.$(OBJEXT) +mprotect_LDADD = $(LDADD) +mprotect_DEPENDENCIES = ../../../skins/native/libnative.la \ + ../../../skins/rtdm/librtdm.la \ + ../../../skins/common/libxenomai.la sigdebug_SOURCES = sigdebug.c sigdebug_OBJECTS = sigdebug.$(OBJEXT) sigdebug_LDADD = $(LDADD)
@@ -95,8 +101,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = heap.c leaks.c sigdebug.c tsc.c -DIST_SOURCES = heap.c leaks.c sigdebug.c tsc.c +SOURCES = heap.c leaks.c mprotect.c sigdebug.c tsc.c +DIST_SOURCES = heap.c leaks.c mprotect.c sigdebug.c tsc.c HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags
@@ -348,6 +354,9 @@ heap$(EXEEXT): $(heap_OBJECTS) $(heap_DEPENDENCIES) leaks$(EXEEXT): $(leaks_OBJECTS) $(leaks_DEPENDENCIES) @rm -f leaks$(EXEEXT) $(LINK) $(leaks_OBJECTS) $(leaks_LDADD) $(LIBS) +mprotect$(EXEEXT): $(mprotect_OBJECTS) $(mprotect_DEPENDENCIES) + @rm -f mprotect$(EXEEXT) + $(LINK) $(mprotect_OBJECTS) $(mprotect_LDADD) $(LIBS) sigdebug$(EXEEXT): $(sigdebug_OBJECTS) $(sigdebug_DEPENDENCIES) @rm -f sigdebug$(EXEEXT) $(LINK) $(sigdebug_OBJECTS) $(sigdebug_LDADD) $(LIBS)
@@ -363,6 +372,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @[email protected]@ @AMDEP_TRUE@@am__include@ @[email protected]@ +@AMDEP_TRUE@@am__include@ @[email protected]@ @AMDEP_TRUE@@am__include@ @[email protected]@ @AMDEP_TRUE@@am__include@ @[email protected]@
src/testsuite/regression/native/mprotect.c new file +128 -0
128 lines not on this page · raw message
Signature · 1 line
1.7.3.4