-
Notifications
You must be signed in to change notification settings - Fork 15k
/
breakpad_treat_node_processes_as_browser_processes.patch
45 lines (42 loc) · 1.69 KB
/
breakpad_treat_node_processes_as_browser_processes.patch
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
38
39
40
41
42
43
44
45
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 30 Apr 2020 17:04:13 -0700
Subject: breakpad: treat node processes as browser processes
On Linux, to avoid the need to pass breakpad FDs to child node processes
spawned by child_process.fork(), each child process must re-initialize
breakpad independently, as a "browser" process. This patches
//components/crash so that it will correctly report 'ptype=node' as a
crash annotation.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index b1f8fd4494e7f5deac078023c2e0240d701e1f13..a372e9bb12f9cec6235fe529d73b6e0009328038 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -719,8 +719,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
log_path[log_path_len] = '\0';
info.log_filename = log_path;
#endif
- info.process_type = "browser";
- info.process_type_length = 7;
+ if (g_is_node) {
+ info.process_type = "node";
+ info.process_type_length = 4;
+ } else {
+ info.process_type = "browser";
+ info.process_type_length = 7;
+ }
info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro);
info.upload = upload;
@@ -2027,8 +2032,13 @@ void InitCrashReporter(const std::string& process_type) {
process_type == kWebViewSingleProcessType ||
process_type == kBrowserProcessType ||
#endif
+ process_type == "node" ||
process_type.empty();
+ if (process_type == "node") {
+ g_is_node = true;
+ }
+
#if !BUILDFLAG(IS_CHROMEOS)
SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
#endif