Module Name:    src
Committed By:   rillig
Date:           Sun Dec  5 14:57:36 UTC 2021

Modified Files:
        src/usr.bin/make: test-variants.sh
        src/usr.bin/make/unit-tests: Makefile export.mk opt-file.mk

Log Message:
tests/make: migrate to jemalloc > 100

When I started working on usr.bin/make in 2020, I used NetBSD 8, which
used jemalloc 100.

After updating to NetBSD 8 to 9.99.x, the debugging options for jemalloc
stopped working since MALLOC_OPTIONS had been replaced with MALLOC_CONF
in 2019.

Enable malloc debugging again, to reliably reproduce the use-after-free
for the variable modifier ':@'.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/test-variants.sh
cvs rdiff -u -r1.284 -r1.285 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/export.mk
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/opt-file.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/test-variants.sh
diff -u src/usr.bin/make/test-variants.sh:1.12 src/usr.bin/make/test-variants.sh:1.13
--- src/usr.bin/make/test-variants.sh:1.12	Sun Sep 12 10:28:40 2021
+++ src/usr.bin/make/test-variants.sh	Sun Dec  5 14:57:36 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: test-variants.sh,v 1.12 2021/09/12 10:28:40 rillig Exp $
+# $NetBSD: test-variants.sh,v 1.13 2021/12/05 14:57:36 rillig Exp $
 #
 # Build several variants of make and run the tests on them.
 #
@@ -30,7 +30,7 @@ testcase() {
 	&& env -i PATH="$PATH" USETOOLS="no" "$@" \
 		sh -ce "make -ks -j6 dependall" \
 	&& size *.o make \
-	&& env -i PATH="$PATH" USETOOLS="no" MALLOC_OPTIONS="JA" \
+	&& env -i PATH="$PATH" USETOOLS="no" MALLOC_CONF="junk:true" \
 		_MKMSG_TEST=":" "$@" \
 		sh -ce "make -s test" \
 	|| fail

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.284 src/usr.bin/make/unit-tests/Makefile:1.285
--- src/usr.bin/make/unit-tests/Makefile:1.284	Tue Oct 19 15:59:26 2021
+++ src/usr.bin/make/unit-tests/Makefile	Sun Dec  5 14:57:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.284 2021/10/19 15:59:26 sjg Exp $
+# $NetBSD: Makefile,v 1.285 2021/12/05 14:57:36 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -651,7 +651,7 @@ TMPDIR:=	/tmp/uid${.MAKE.UID}
 x!= echo; mkdir -p ${TMPDIR}
 .endif
 
-MAKE_TEST_ENV?=	MALLOC_OPTIONS="JA"	# for jemalloc
+MAKE_TEST_ENV?=	MALLOC_CONF="junk:true"	# for jemalloc
 MAKE_TEST_ENV+= TMPDIR=${TMPDIR}
 
 .if ${.MAKE.OS} == "NetBSD"

Index: src/usr.bin/make/unit-tests/export.mk
diff -u src/usr.bin/make/unit-tests/export.mk:1.10 src/usr.bin/make/unit-tests/export.mk:1.11
--- src/usr.bin/make/unit-tests/export.mk:1.10	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/export.mk	Sun Dec  5 14:57:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: export.mk,v 1.10 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: export.mk,v 1.11 2021/12/05 14:57:36 rillig Exp $
 
 UT_TEST=	export
 UT_FOO=		foo${BAR}
@@ -40,7 +40,7 @@ BAR=	bar is ${UT_FU}
 
 .MAKE.EXPORTED+=	UT_ZOO UT_TEST
 
-FILTER_CMD?=	egrep -v '^(MAKEFLAGS|MALLOC_OPTIONS|PATH|PWD|SHLVL|_|&)='
+FILTER_CMD?=	egrep -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)='
 
 all:
 	@env | ${FILTER_CMD} | sort

Index: src/usr.bin/make/unit-tests/opt-file.mk
diff -u src/usr.bin/make/unit-tests/opt-file.mk:1.12 src/usr.bin/make/unit-tests/opt-file.mk:1.13
--- src/usr.bin/make/unit-tests/opt-file.mk:1.12	Sun Apr  4 10:13:09 2021
+++ src/usr.bin/make/unit-tests/opt-file.mk	Sun Dec  5 14:57:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: opt-file.mk,v 1.12 2021/04/04 10:13:09 rillig Exp $
+# $NetBSD: opt-file.mk,v 1.13 2021/12/05 14:57:36 rillig Exp $
 #
 # Tests for the -f command line option.
 
@@ -19,7 +19,7 @@ all: file-containing-null-byte
 # outside of the file buffer.
 #
 #	printf '%s' 'VAR=value\' \
-#	| MALLOC_OPTIONS=JA make-2014.01.01.00.00.00 -r -f - -V VAR -dA 2>&1 \
+#	| MALLOC_CONF="junk:true" make-2014.01.01.00.00.00 -r -f - -V VAR -dA 2>&1 \
 #	| less
 #
 # The debug output shows how make happily uses freshly allocated memory (the

Reply via email to