[LTP] [PATCH v1] hugemmap34: Disable -fstack-clash-protection

Wei Gao wegao@suse.com
Thu Feb 6 03:23:27 CET 2025


Signed-off-by: Wei Gao <wegao@suse.com>
Suggested-by: Jan Stancek <jstancek@redhat.com>

Compiling hugemmap34 with CFLAGS='-fstack-clash-protection' causes
gcc to insert additional stack address validation checks during
alloca calls.  This results in kernel start allocate memory really,
eventually triggering an OOM.

Base Jan's suggestion, disable -fstack-clash-protection to allows
test to run on larger pool of systems

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/mem/hugetlb/hugemmap/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
index 2d651b4aa..6e72e7009 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
+++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
@@ -8,4 +8,7 @@ include $(top_srcdir)/include/mk/testcases.mk
 include $(abs_srcdir)/../Makefile.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
+CFLAGS_no_stack_prot := $(filter-out -fstack-clash-protection, $(CFLAGS))
+
 hugemmap06: CFLAGS+=-pthread
+hugemmap34: CFLAGS=$(CFLAGS_no_stack_prot)
-- 
2.35.3



More information about the ltp mailing list