subproc: comments around new proc stack
authorRobert Swiecki <robert@swiecki.net>
Thu, 19 Oct 2017 11:11:41 +0000 (13:11 +0200)
committerRobert Swiecki <robert@swiecki.net>
Thu, 19 Oct 2017 11:11:41 +0000 (13:11 +0200)
subproc.c

index 5d98eda..d843535 100644 (file)
--- a/subproc.c
+++ b/subproc.c
@@ -398,9 +398,11 @@ static bool subprocInitParent(struct nsjconf_t* nsjconf, pid_t pid, int pipefd)
        return true;
 }
 
-/* Will be used inside the child process only, so it's safe to have it in BSS */
-static uint8_t subprocCloneStack[128 * 1024]
-    __attribute__((aligned(__BIGGEST_ALIGNMENT__))); /* 128 KiB */
+/*
+ * Will be used inside the child process only, so it's safe to have it in BSS.
+ * Some CPU archs (e.g. aarch64) must have it aligned. Size: 128 KiB (/2)
+ */
+static uint8_t subprocCloneStack[128 * 1024] __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
 /* Cannot be on the stack, as the child's stack pointer will change after clone() */
 static __thread jmp_buf env;