From 91383e33238918f4e1b1ac822b14c9036a77f82b Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Tue, 31 Aug 2021 12:43:51 -0400 Subject: [PATCH] Testing: Set MALLOC_PERTURB_ to 1 The MALLOC_PERTURB_ parameter was used to initialize allocated arrays to unphysical values. Previously, we had set this to 256 which would initialize bytes to 0xff, and indirectly set all floats to NaN. However, MALLOC_PERTURB_ was undocumnted for values greater than 255, and we were relying on undefined behavior. In newer versions of glibc, a value of 256 does nothing and is equivalent to a value of 0. This patch changes the MALLOC_PERTURB_ value to 1, which sets bytes to 0xfe and tends to initialize them to an unphysically large value. Unfortunately we have temporarily lost the ability to initialize to NaN, but for now this is probably the best we can do. (Note that other compilers like Intel can explicitly initialize allocatables to NaN, so this update is more specific to the GCC configuration of our GitHub Actions setup than the test suite.) --- .testing/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.testing/Makefile b/.testing/Makefile index 1946b133d0..59bf91d6d8 100644 --- a/.testing/Makefile +++ b/.testing/Makefile @@ -559,7 +559,7 @@ $(eval $(call STAT_RULE,repro,repro,,,,1)) $(eval $(call STAT_RULE,openmp,openmp,,,GOMP_CPU_AFFINITY=0,1)) $(eval $(call STAT_RULE,layout,symmetric,,LAYOUT=2$(,)1,,2)) $(eval $(call STAT_RULE,rotate,symmetric,,ROTATE_INDEX=True\nINDEX_TURNS=1,,1)) -$(eval $(call STAT_RULE,nan,symmetric,,,MALLOC_PERTURB_=256,1)) +$(eval $(call STAT_RULE,nan,symmetric,,,MALLOC_PERTURB_=1,1)) $(eval $(call STAT_RULE,dim.t,symmetric,,T_RESCALE_POWER=11,,1)) $(eval $(call STAT_RULE,dim.l,symmetric,,L_RESCALE_POWER=11,,1)) $(eval $(call STAT_RULE,dim.h,symmetric,,H_RESCALE_POWER=11,,1))