Hi Colin, On 04/25/2016 09:42 PM, Colin Ian King wrote: > Hi there, > > currently, the aarch64 clone() system call requires the stack to be > aligned at a 16 byte boundary, see arch/arm64/kernel/process.c, > copy_thread(): > > if (stack_start) { > if (is_compat_thread(task_thread_info(p))) > childregs->compat_sp = stack_start; > /* 16-byte aligned stack mandatory on AArch64 */ > else if (stack_start & 15) > return -EINVAL; > else > childregs->sp = stack_start; > } > > > ..and returns -EINVAL if not aligned correctly. This should be added to > the manual page clone(2) as it took me a while to figure out why clone() > was failing with -EINVAL for aarch64 but not on x86. Thanks for the report!I applied the patch below. (Seem okay?) Cheers, Michael diff --git a/man2/clone.2 b/man2/clone.2 index c9ce21c..184875a 100644 --- a/man2/clone.2 +++ b/man2/clone.2 @@ -969,6 +969,13 @@ but the kernel was not configured with the .B CONFIG_UTS option. .TP +.B EINVAL +.I child_stack +is not aligned to a suitable boundary for this architecture. +For example, on aarch64, +.I child_stack +must be a multiple of 16. +.TP .B ENOMEM Cannot allocate sufficient memory to allocate a task structure for the child, or to copy those parts of the caller's context that need to be -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html