From: Zorro Lang Date: Fri, 29 Sep 2017 16:49:25 +0000 (+0800) Subject: src/nsexec: fix stack pointer alignment exception X-Git-Tag: v2022.05.01~1849 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=1021cf17bced35bae60eb38338c36b33919a6c0a src/nsexec: fix stack pointer alignment exception 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 Reviewed-by: Carlos Maiolino Signed-off-by: Eryu Guan --- diff --git a/src/nsexec.c b/src/nsexec.c index f033b1a4..c2d172fe 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 child_stack[STACK_SIZE] __attribute__((aligned)); int main(int argc, char *argv[])