From 46ae2e7041cb90ddcc0c2a54929ebeb79fcc40a2 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 Pick-to: 6.6 Change-Id: I229c25397f557dd2fec3e0ec53ac68fda28bab13 --- src/3rdparty/forkfd/forkfd_linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/forkfd/forkfd_linux.c b/src/3rdparty/forkfd/forkfd_linux.c index cc7af6cb5307..c8ccf4768059 100644 --- a/src/3rdparty/forkfd/forkfd_linux.c +++ b/src/3rdparty/forkfd/forkfd_linux.c @@ -28,6 +28,7 @@ #include "forkfd.h" +#include #include #include #include @@ -157,7 +158,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; -- 2.42.0