forkfd_linux: change childStack size from 4096 to SIGSTKSZ

Starting from qt-6.6.0, the childStack size has been too small to run
qmake or qsb in the sandbox, which will cause segfault.
This problem can be fixed by changing the childStack size to SIGSTKSZ.
For security reasons, some Linux distributions, such as gentoo, will
use the sandbox when building applications. Previously, qt-6.5.0 could
be successfully built in the sandbox. The problem started with qt-6.6.0.
See also: https://bugs.gentoo.org/915695

Change-Id: I229c25397f557dd2fec3e0ec53ac68fda28bab13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 993db5a12227b1e4067714ddc626d64a14474a54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Huang Rui 2023-10-20 14:44:18 +08:00 committed by Qt Cherry-pick Bot
parent 6173f053a0
commit 6008eb98d5

View File

@ -157,7 +157,7 @@ static int system_forkfd_pidfd_set_flags(int pidfd, int flags)
int system_vforkfd(int flags, pid_t *ppid, int (*childFn)(void *), void *token, int *system)
{
__attribute__((aligned(64))) char childStack[4096];
__attribute__((aligned(64))) char childStack[SIGSTKSZ];
pid_t pid;
int pidfd;
unsigned long cloneflags = CLONE_PIDFD | CLONE_VFORK | CLONE_VM | SIGCHLD;