From 352e8ae352e1eeaa7b0ecc5cdf51e8a272b6d02f Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 20 Aug 2024 11:29:12 +0200 Subject: [PATCH] fix requested thread stack size on aarch64 (RHEL-55260) Resolves: RHEL-55260 --- synce4l-stacksize.patch | 26 ++++++++++++++++++++++++++ synce4l.spec | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 synce4l-stacksize.patch diff --git a/synce4l-stacksize.patch b/synce4l-stacksize.patch new file mode 100644 index 0000000..bdadc15 --- /dev/null +++ b/synce4l-stacksize.patch @@ -0,0 +1,26 @@ +commit f134a38219fc390405f488d5eaaa64e7957b29f3 +Author: Miroslav Lichvar +Date: Tue Aug 13 12:19:24 2024 +0200 + + Fix requested thread stack size + + The pthread_attr_setstacksize() call requesting size of 0xffff fails on + systems with 64k pages. Request the maximum of 0xffff and + PTHREAD_STACK_MIN instead. + + Signed-off-by: Miroslav Lichvar + +diff --git a/synce_thread_common.h b/synce_thread_common.h +index cf607ac..8db11d7 100644 +--- a/synce_thread_common.h ++++ b/synce_thread_common.h +@@ -13,7 +13,8 @@ + #define MSEC_TO_USEC(X) (X * 1000) + #define THREAD_STOP_SLEEP_USEC MSEC_TO_USEC(50) + #define THREAD_START_SLEEP_USEC MSEC_TO_USEC(20) +-#define SYNCE_THREAD_STACK_SIZE 0xffff ++#define SYNCE_THREAD_STACK_SIZE (0xffff > PTHREAD_STACK_MIN ? \ ++ 0xffff : PTHREAD_STACK_MIN) + #define TASK_COMM_LEN 16 + + #endif /* HAVE_SYNCE_THREAD_COMMON_H */ diff --git a/synce4l.spec b/synce4l.spec index 672b26c..562b0cc 100644 --- a/synce4l.spec +++ b/synce4l.spec @@ -16,6 +16,8 @@ Patch2: synce4l-smc.patch Patch3: synce4l-noduppin.patch # Fix initial pin ID to not match an existing pin Patch4: synce4l-initpinid.patch +# Fix requested thread stack size on aarch64 +Patch5: synce4l-stacksize.patch BuildRequires: gcc make systemd BuildRequires: libnl3-devel