Re: newer glibc version changes definition of SIGSTKSZ

Paul Eggert <[email protected]> Mon, 5 Apr 2021 10:16:05 -0700
Newsgroups gmane.comp.version-control.rcs.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------3628DF1F71413A4BE39D4B21
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for reporting that. I installed the attached slightly-different fix.


--------------3628DF1F71413A4BE39D4B21
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-int-Don-t-use-SIGSTKSZ-in-if.patch"
Content-Disposition: attachment;
 filename="0001-int-Don-t-use-SIGSTKSZ-in-if.patch"
Content-Transfer-Encoding: quoted-printable

From edecf4ac3c824f9312865dbbeb561630c5360309 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Mon, 5 Apr 2021 10:13:49 -0700
Subject: [PATCH] =3D?UTF-8?q?[int]=3D20Don=3DE2=3D80=3D99t=3D20use=3D20SI=
GSTKSZ=3D20in=3D20#?=3D
 =3D?UTF-8?q?if?=3D
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Christoph Karl in:
https://lists.gnu.org/r/bug-rcs/2021-04/msg00000.html
* b-isr.c (ISR_STACK_SIZE): Remove.
(isr_init): Don=E2=80=99t assume SIGSTKSZ is a preprocessor constant.
---
 src/ChangeLog |  8 ++++++++
 src/b-isr.c   | 13 ++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 3e21bda..5463be3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-05  Paul Eggert  <[email protected]>
+
+	[int] Don=E2=80=99t use SIGSTKSZ in #if
+	Problem reported by Christoph Karl in:
+	https://lists.gnu.org/r/bug-rcs/2021-04/msg00000.html
+	* b-isr.c (ISR_STACK_SIZE): Remove.
+	(isr_init): Don=E2=80=99t assume SIGSTKSZ is a preprocessor constant.
+
 2020-10-24  Thien-Thi Nguyen  <[email protected]>
=20
 	[int] Use =E2=80=98NULL=E2=80=99 instead of '\0'.
diff --git a/src/b-isr.c b/src/b-isr.c
index f03794c..fc86cea 100644
--- a/src/b-isr.c
+++ b/src/b-isr.c
@@ -198,22 +198,17 @@ setup_catchsig (size_t count, int const set[VLA_ELE=
MS (count)])
 #undef MUST
 }
=20
-#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ
-#define ISR_STACK_SIZE  (10 * SIGSTKSZ)
-#else
-#define ISR_STACK_SIZE  0
-#endif
-
 struct isr_scratch *
 isr_init (bool *be_quiet)
 {
   struct isr_scratch *scratch =3D ZLLOC (1, struct isr_scratch);
=20
-#if ISR_STACK_SIZE
+#if defined HAVE_SIGALTSTACK && defined SIGSTKSZ
+  size_t stack_size =3D 10 * SIGSTKSZ;
   stack_t ss =3D
     {
-      .ss_sp =3D alloc (PLEXUS, ISR_STACK_SIZE),
-      .ss_size =3D ISR_STACK_SIZE,
+      .ss_sp =3D alloc (PLEXUS, stack_size),
+      .ss_size =3D stack_size,
       .ss_flags =3D 0
     };
=20
--=20
2.30.2


--------------3628DF1F71413A4BE39D4B21--