|
| 1 | +From 66a2b6e4ba8e2b49115043127ce4aa0fcd71ad1e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Khem Raj < [email protected]> |
| 3 | +Date: Tue, 11 May 2021 11:12:35 -0700 |
| 4 | +Subject: [PATCH] exception_handler.cc: Match the types for SIGSTKSZ |
| 5 | + |
| 6 | +In glibc 2.34, SIGSTKSZ is a syscall which returns a long int, therefore |
| 7 | +current check fails |
| 8 | + |
| 9 | +| ../git/src/client/linux/handler/exception_handler.cc:141:49: error: no matching function for call to 'max(int, long int)' |
| 10 | +| 141 | static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); |
| 11 | +| | ~~~~~~~~^~~~~~~~~~~~~~~~~ |
| 12 | + |
| 13 | +Upstream-Status: Pending |
| 14 | +Signed-off-by: Khem Raj < [email protected]> |
| 15 | +--- |
| 16 | + src/client/linux/handler/exception_handler.cc | 2 +- |
| 17 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
| 18 | + |
| 19 | +--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc |
| 20 | ++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc |
| 21 | +@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { |
| 22 | + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning |
| 23 | + // the alternative stack. Ensure that the size of the alternative stack is |
| 24 | + // large enough. |
| 25 | +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); |
| 26 | ++ static const unsigned kSigStackSize = std::max(static_cast<long>(16384), SIGSTKSZ); |
| 27 | + |
| 28 | + // Only set an alternative stack if there isn't already one, or if the current |
| 29 | + // one is too small. |
| 30 | +--- a/sandbox/linux/services/credentials.cc |
| 31 | ++++ b/sandbox/linux/services/credentials.cc |
| 32 | +@@ -98,7 +98,9 @@ bool ChrootToSafeEmptyDir() { |
| 33 | + // attempt this optimization. |
| 34 | + clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS; |
| 35 | + |
| 36 | +- char tls_buf[PTHREAD_STACK_MIN] = {0}; |
| 37 | ++ const std::size_t pthread_stack_min = PTHREAD_STACK_MIN; |
| 38 | ++ char tls_buf[pthread_stack_min]; |
| 39 | ++ memset(tls_buf, 0, pthread_stack_min); |
| 40 | + tls = tls_buf; |
| 41 | + #endif |
| 42 | + |
0 commit comments