From 6008eb98d52588320a8a23c913db3c5db50f4324 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Fri, 20 Oct 2023 14:44:18 +0800 Subject: [PATCH] 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 (cherry picked from commit 993db5a12227b1e4067714ddc626d64a14474a54) Reviewed-by: Qt Cherry-pick Bot --- src/3rdparty/forkfd/forkfd_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/forkfd/forkfd_linux.c b/src/3rdparty/forkfd/forkfd_linux.c index cc7af6cb530..4dacc1919d4 100644 --- a/src/3rdparty/forkfd/forkfd_linux.c +++ b/src/3rdparty/forkfd/forkfd_linux.c @@ -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;