aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-base_debug_stack__trace__posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium/files/patch-base_debug_stack__trace__posix.cc')
-rw-r--r--www/chromium/files/patch-base_debug_stack__trace__posix.cc52
1 files changed, 49 insertions, 3 deletions
diff --git a/www/chromium/files/patch-base_debug_stack__trace__posix.cc b/www/chromium/files/patch-base_debug_stack__trace__posix.cc
index a71a256577f7..e1b9de653941 100644
--- a/www/chromium/files/patch-base_debug_stack__trace__posix.cc
+++ b/www/chromium/files/patch-base_debug_stack__trace__posix.cc
@@ -1,4 +1,4 @@
---- base/debug/stack_trace_posix.cc.orig 2023-07-16 15:47:57 UTC
+--- base/debug/stack_trace_posix.cc.orig 2023-09-13 12:11:42 UTC
+++ base/debug/stack_trace_posix.cc
@@ -41,7 +41,7 @@
// execinfo.h and backtrace(3) are really only present in glibc and in macOS
@@ -18,7 +18,53 @@
#include "base/debug/proc_maps_linux.h"
#endif
-@@ -798,6 +798,9 @@ class SandboxSymbolizeHelper {
+@@ -300,7 +300,7 @@ void PrintToStderr(const char* output) {
+ std::ignore = HANDLE_EINTR(write(STDERR_FILENO, output, strlen(output)));
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ void AlarmSignalHandler(int signal, siginfo_t* info, void* void_context) {
+ // We have seen rare cases on AMD linux where the default signal handler
+ // either does not run or a thread (Probably an AMD driver thread) prevents
+@@ -317,7 +317,11 @@ void AlarmSignalHandler(int signal, siginfo_t* info, v
+ "Warning: Default signal handler failed to terminate process.\n");
+ PrintToStderr("Calling exit_group() directly to prevent timeout.\n");
+ // See: https://man7.org/linux/man-pages/man2/exit_group.2.html
++#if BUILDFLAG(IS_BSD)
++ _exit(EXIT_FAILURE);
++#else
+ syscall(SYS_exit_group, EXIT_FAILURE);
++#endif
+ }
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ||
+ // BUILDFLAG(IS_CHROMEOS)
+@@ -534,7 +538,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* inf
+ _exit(EXIT_FAILURE);
+ }
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Set an alarm to trigger in case the default handler does not terminate
+ // the process. See 'AlarmSignalHandler' for more details.
+ struct sigaction action;
+@@ -559,6 +563,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* inf
+ // signals that do not re-raise autonomously), such as signals delivered via
+ // kill() and asynchronous hardware faults such as SEGV_MTEAERR, which would
+ // otherwise be lost when re-raising the signal via raise().
++#if !BUILDFLAG(IS_BSD)
+ long retval = syscall(SYS_rt_tgsigqueueinfo, getpid(), syscall(SYS_gettid),
+ info->si_signo, info);
+ if (retval == 0) {
+@@ -573,6 +578,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* inf
+ if (errno != EPERM) {
+ _exit(EXIT_FAILURE);
+ }
++#endif
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) ||
+ // BUILDFLAG(IS_CHROMEOS)
+
+@@ -821,6 +827,9 @@ class SandboxSymbolizeHelper {
// for the modules that are loaded in the current process.
// Returns true on success.
bool CacheMemoryRegions() {
@@ -28,7 +74,7 @@
// Reads /proc/self/maps.
std::string contents;
if (!ReadProcMaps(&contents)) {
-@@ -815,6 +818,7 @@ class SandboxSymbolizeHelper {
+@@ -838,6 +847,7 @@ class SandboxSymbolizeHelper {
is_initialized_ = true;
return true;