[LTP] hugemmap34 trigger oom if compile with CFLAGS='-fstack-clash-protection'
Wei Gao
wegao@suse.com
Thu Feb 6 03:28:14 CET 2025
On Wed, Feb 05, 2025 at 11:33:08AM +0100, Jan Stancek wrote:
> On Wed, Feb 5, 2025 at 3:54 AM Wei Gao <wegao@suse.com> wrote:
> >
> > Hi Jan
> >
> > 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.
> >
> > In our normal openqa env we do not have such big memory(1024GB) to support this test. So we
> > have to disable CFLAGS='-fstack-clash-protection' if we still need this case running in our env.
>
> Hi,
>
> It sounds like you already found the cause. We seem to have couple choices:
>
> 1) strip the option from the CFLAGS for this testcase
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> index 2d651b4aa..1154ab3de 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))
> +
> +hugemmap34: CFLAGS=$(CFLAGS_no_stack_prot)
>
> 2) increase the memory requirements for the test.
>
> I'd probably go with 1) since we want kernel to catch any issues anyway. And it
> allows test to run on larger pool of systems.
>
Agree go with 1), i send new patch
https://patchwork.ozlabs.org/project/ltp/patch/20250206022327.11821-1-wegao@suse.com/
Thanks for your quick support.
> >
> > Thanks.
> > Regards
> > Gao Wei
> >
>
More information about the ltp
mailing list