hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From b919ed47b11528a640341e81ff6d9ad6c67f0f89 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 12/12] 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>
---
 .../breakpad/src/client/linux/handler/exception_handler.cc      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
index b895f6d7ad..208713ab45 100644
--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/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.
-- 
2.20.1