All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] hugemmap34 trigger oom if compile with CFLAGS='-fstack-clash-protection'
Date: Wed, 5 Feb 2025 21:28:14 -0500	[thread overview]
Message-ID: <Z6QePvsa+SiyiV9v@wegao> (raw)
In-Reply-To: <CAASaF6zAqMoT6J1nAG2uwo1pyQnHAEFvcZPinv4w=5F0=TKnqQ@mail.gmail.com>

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
> >
> 

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2025-02-06  2:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05  2:54 [LTP] hugemmap34 trigger oom if compile with CFLAGS='-fstack-clash-protection' Wei Gao via ltp
2025-02-05 10:33 ` Jan Stancek
2025-02-06  2:28   ` Wei Gao via ltp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z6QePvsa+SiyiV9v@wegao \
    --to=ltp@lists.linux.it \
    --cc=jstancek@redhat.com \
    --cc=wegao@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.