All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, sandeen@redhat.com
Subject: Re: [PATCH] src/nsexec: fix stack pointer alignment exception
Date: Wed, 27 Sep 2017 12:01:10 +0200	[thread overview]
Message-ID: <20170927100110.rfhl3hjqek4z2q6z@hades.localdomain> (raw)
In-Reply-To: <20170927055252.12225-1-zlang@redhat.com>

On Wed, Sep 27, 2017 at 05:52:52AM +0000, Zorro Lang wrote:
> When test g/317 or g/318 on ARM server, we got a kernel exception:
> 
>   kernel: nsexec[8203]: SP Alignment exception: pc=00000000004010a0 sp=00000000005200e8
> 
> nsexec gives an unaligned child stack address to clone() system
> call sometimes. For making sure it's always aligned, use
> "__attribute__((aligned))" extension of GCC (Thanks this suggestion
> from Eric sandeen).
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>  src/nsexec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/nsexec.c b/src/nsexec.c
> index f033b1a4..205dd081 100644
> --- a/src/nsexec.c
> +++ b/src/nsexec.c
> @@ -138,7 +138,8 @@ childFunc(void *arg)
>  
>  #define STACK_SIZE (1024 * 1024)
>  
> -static char child_stack[STACK_SIZE];    /* Space for child's stack */
> +/* Space for child's stack */
> +static char __attribute__((aligned)) child_stack[STACK_SIZE];

I don't really think the comment is necessary, other than that:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

>  
>  int
>  main(int argc, char *argv[])
> -- 
> 2.13.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Carlos

  reply	other threads:[~2017-09-27 10:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27  5:52 [PATCH] src/nsexec: fix stack pointer alignment exception Zorro Lang
2017-09-27 10:01 ` Carlos Maiolino [this message]
2017-09-29 14:44 ` Eric Sandeen
2017-09-29 15:52   ` Zorro Lang

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=20170927100110.rfhl3hjqek4z2q6z@hades.localdomain \
    --to=cmaiolino@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=zlang@redhat.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.