summarylogtreecommitdiffstats
path: root/breakpad-fix-for-non-constant-SIGSTKSZ.patch
diff options
context:
space:
mode:
authorAntonio Rojas2022-04-22 10:25:13 +0200
committerAntonio Rojas2022-04-22 10:25:13 +0200
commit5e543d5e15fd235fafc12b48eafba6908fd2a5fc (patch)
tree372f6705df0eec92f53d0b6daf41f0fc021e5152 /breakpad-fix-for-non-constant-SIGSTKSZ.patch
parentaa1e4016c27b08a8661a53cb28841cf7e31118df (diff)
downloadaur-5e543d5e15fd235fafc12b48eafba6908fd2a5fc.tar.gz
import from community
Diffstat (limited to 'breakpad-fix-for-non-constant-SIGSTKSZ.patch')
-rw-r--r--breakpad-fix-for-non-constant-SIGSTKSZ.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/breakpad-fix-for-non-constant-SIGSTKSZ.patch b/breakpad-fix-for-non-constant-SIGSTKSZ.patch
new file mode 100644
index 000000000000..1bb121693146
--- /dev/null
+++ b/breakpad-fix-for-non-constant-SIGSTKSZ.patch
@@ -0,0 +1,35 @@
+From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure@kdab.com>
+Date: Wed, 15 Dec 2021 22:26:40 +0100
+Subject: [PATCH] Fix for non-constant SIGSTKSZ
+
+On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case
+it expands to a call to `sysconf` which returns a `long int`); see
+https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html
+
+Pass unsigned explicitly to std::max, to avoid relying on template
+argument deduction. This works both with the old-style constant
+`SIGSTKSZ` and the new configurable one.
+
+Initially based on https://chromium-review.googlesource.com/c/2776379
+
+Change-Id: I9fc95337f973e871b84735ce822b5e11ba73ea8c
+Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721
+Reviewed-by: Mark Mentovai <mark@chromium.org>
+---
+ src/client/linux/handler/exception_handler.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
+index ca353c40..499be0a9 100644
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
+ // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
+ // the alternative stack. Ensure that the size of the alternative stack is
+ // large enough.
+- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
++ const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ);
+
+ // Only set an alternative stack if there isn't already one, or if the current
+ // one is too small.