glibc/nptl-stack-size-up.patch
Andreas Schwab 502561a1bc - Build cross-hppa and cross-loongarch64 only with gcc >= 14
- round-log10p1f.patch: math: Fix log10p1f internal table value (BZ
  #32626)
- round-sinhf.patch: math: Fix sinhf for some inputs (BZ #32627)
- nptl-stack-size-up.patch: nptl: Correct stack size attribute when stack
  grows up (BZ #32574)
- round-tanf.patch: math: Fix tanf for some inputs (BZ 32630)
- tst-aarch64-pkey.patch: Fix tst-aarch64-pkey to handle ENOSPC as not
  supported
- float128-sycl.patch: x86 (__HAVE_FLOAT128): Defined to 0 for Intel SYCL
  compiler (BZ #32723)

OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=733
2025-02-24 09:47:46 +00:00

41 lines
1.5 KiB
Diff

From cb7f20653724029be89224ed3a35d627cc5b4163 Mon Sep 17 00:00:00 2001
From: John David Anglin <danglin@gcc.gnu.org>
Date: Wed, 29 Jan 2025 16:51:16 -0500
Subject: [PATCH] nptl: Correct stack size attribute when stack grows up [BZ
#32574]
Set stack size attribute to the size of the mmap'd region only
when the size of the remaining stack space is less than the size
of the mmap'd region.
This was reversed. As a result, the initial stack size was only
135168 bytes. On architectures where the stack grows down, the
initial stack size is approximately 8384512 bytes with the default
rlimit settings. The small main stack size on hppa broke
applications like ruby that check for stack overflows.
Signed-off-by: John David Anglin <dave.anglin@bell.net>
---
nptl/pthread_getattr_np.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index e98e2df152..43dd16d59c 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -145,9 +145,9 @@ __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
> (size_t) iattr->stackaddr - last_to)
iattr->stacksize = (size_t) iattr->stackaddr - last_to;
#else
- /* The limit might be too high. */
+ /* The limit might be too low. */
if ((size_t) iattr->stacksize
- > to - (size_t) iattr->stackaddr)
+ < to - (size_t) iattr->stackaddr)
iattr->stacksize = to - (size_t) iattr->stackaddr;
#endif
/* We succeed and no need to look further. */
--
2.48.1