diff --git a/backport-8.2.2550-signal-stack-size-is-wrong-with-lates.patch b/backport-8.2.2550-signal-stack-size-is-wrong-with-lates.patch new file mode 100644 index 0000000000000000000000000000000000000000..19b2bff780434f605e6a5dbba060688ddaf13cd0 --- /dev/null +++ b/backport-8.2.2550-signal-stack-size-is-wrong-with-lates.patch @@ -0,0 +1,132 @@ +From 0e62a6742bca186624e97e2121c98ada30e009a0 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 25 Feb 2021 17:17:56 +0100 +Subject: [PATCH 4236/5000] patch 8.2.2550: signal stack size is wrong with + latest glibc 2.34 + +Problem: Signal stack size is wrong with latest glibc 2.34. +Solution: Use sysconf(_SC_SIGSTKSZ) if available. (Zdenek Dohnal, closes + #7895) +--- + src/auto/configure | 24 ++++++++++++++++++++++++ + src/config.h.in | 3 +++ + src/configure.ac | 9 +++++++++ + src/os_unix.c | 14 +++++++++++++- + 4 files changed, 49 insertions(+), 1 deletion(-) + +diff --git a/src/auto/configure b/src/auto/configure +index 250e5ae..8183499 100755 +--- a/src/auto/configure ++++ b/src/auto/configure +@@ -13943,6 +13943,30 @@ $as_echo "not usable" >&6; } + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_SIGSTKSZ via sysconf()" >&5 ++$as_echo_n "checking for _SC_SIGSTKSZ via sysconf()... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++ (void)sysconf(_SC_SIGSTKSZ); ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSCONF_SIGSTKSZ 1" >>confdefs.h ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 ++$as_echo "not usable" >&6; } ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ + # The cast to long int works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +diff --git a/src/config.h.in b/src/config.h.in +index b114480..5d01e2c 100644 +--- a/src/config.h.in ++++ b/src/config.h.in +@@ -496,3 +496,6 @@ + + /* Define to inline symbol or empty */ + #undef inline ++ ++/* Define if _SC_SIGSTKSZ is available via sysconf() */ ++#undef HAVE_SYSCONF_SIGSTKSZ +diff --git a/src/configure.ac b/src/configure.ac +index 58bfa19..798e9b8 100644 +--- a/src/configure.ac ++++ b/src/configure.ac +@@ -4105,6 +4105,15 @@ AC_TRY_COMPILE( + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), + AC_MSG_RESULT(not usable)) + ++dnl check if we have _SC_SIGSTKSZ via sysconf() ++AC_MSG_CHECKING(for _SC_SIGSTKSZ via sysconf()) ++AC_TRY_COMPILE( ++[#include ], ++[ (void)sysconf(_SC_SIGSTKSZ); ++ ], ++ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF_SIGSTKSZ), ++ AC_MSG_RESULT(not usable)) ++ + AC_CHECK_SIZEOF([int]) + AC_CHECK_SIZEOF([long]) + AC_CHECK_SIZEOF([time_t]) +diff --git a/src/os_unix.c b/src/os_unix.c +index 1edc7e6..1c80799 100644 +--- a/src/os_unix.c ++++ b/src/os_unix.c +@@ -783,7 +783,7 @@ mch_stackcheck(char *p) + * completely full. + */ + +-#ifndef SIGSTKSZ ++#if !defined SIGSTKSZ && !defined(HAVE_SYSCONF_SIGSTKSZ) + # define SIGSTKSZ 8000 // just a guess of how much stack is needed... + #endif + +@@ -806,13 +806,21 @@ init_signal_stack(void) + # else + sigstk.ss_sp = signal_stack; + # endif ++# ifdef HAVE_SYSCONF_SIGSTKSZ ++ sigstk.ss_size = sysconf(_SC_SIGSTKSZ); ++# else + sigstk.ss_size = SIGSTKSZ; ++# endif + sigstk.ss_flags = 0; + (void)sigaltstack(&sigstk, NULL); + # else + sigstk.ss_sp = signal_stack; + if (stack_grows_downwards) ++# ifdef HAVE_SYSCONF_SIGSTKSZ ++ sigstk.ss_sp += sysconf(_SC_SIGSTKSZ) - 1; ++# else + sigstk.ss_sp += SIGSTKSZ - 1; ++# endif + sigstk.ss_onstack = 0; + (void)sigstack(&sigstk, NULL); + # endif +@@ -3261,7 +3269,11 @@ mch_early_init(void) + * Ignore any errors. + */ + #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK) ++# ifdef HAVE_SYSCONF_SIGSTKSZ ++ signal_stack = alloc(sysconf(_SC_SIGSTKSZ)); ++# else + signal_stack = alloc(SIGSTKSZ); ++# endif + init_signal_stack(); + #endif + } +-- +1.8.3.1 + diff --git a/vim.spec b/vim.spec index aefdfb5f8b88b81b1d2d17096146e7503cefe90e..d457584db9a0466594c443ec742267b785130d73 100644 --- a/vim.spec +++ b/vim.spec @@ -12,7 +12,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 8 +Release: 9 Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text. License: Vim and MIT URL: http://www.vim.org @@ -35,6 +35,7 @@ Patch0012: vim-python3-tests.patch Patch0013: Fix-vim-lua5.4.0-defines+luaL_typeerror-twice.patch Patch0014: backport-Fix-build-failuers-with-perl-5.32.patch Patch6000: backport-Configure-does-not-recognize-gcc-10.0-and-later.patch +Patch6001: backport-8.2.2550-signal-stack-size-is-wrong-with-lates.patch Patch9000: bugfix-rm-modify-info-version.patch @@ -423,6 +424,12 @@ popd %{_mandir}/man1/evim.* %changelog +* Tue Aug 10 2021 shixuantong - 2:8.2-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix signal stack size is wrong with latest glibc 2.34 + * Sat Aug 07 2021 shixuantong - 2:8.2-8 - Type:bugfix - ID:NA