Skip to content

Commit b16d0f9

Browse files
authored
Fix bug with Mac crash telemetry. (#9357)
1 parent 617261d commit b16d0f9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,10 @@ function handleMacCrashFileRead(err: NodeJS.ErrnoException | undefined | null, d
926926
data = data.replace(/0x1........ \+ 0/g, "");
927927

928928
// Get rid of the process names on each line and just add it to the start.
929-
const processNames: string[] = ["cpptools-srv", "cpptools-wordexp", "cpptools" ];
929+
const processNames: string[] = ["cpptools-srv", "cpptools-wordexp", "cpptools",
930+
// Since only crash logs that start with "cpptools" are reported, the cases below would only occur
931+
// if the crash were to happen before the new process had fully started and renamed itself.
932+
"clang-tidy", "clang-format", "clang", "gcc" ];
930933
let processNameFound: boolean = false;
931934
for (const processName of processNames) {
932935
if (data.includes(processName)) {
@@ -938,7 +941,8 @@ function handleMacCrashFileRead(err: NodeJS.ErrnoException | undefined | null, d
938941
}
939942
if (!processNameFound) {
940943
// Not expected, but just in case a new binary gets added.
941-
data = `cpptools???\t${binaryVersion}\n${data}`;
944+
// Warning: Don't use ??? because that is checked below.
945+
data = `cpptools??\t${binaryVersion}\n${data}`;
942946
}
943947

944948
// Remove runtime lines because they can be different on different machines.

0 commit comments

Comments
 (0)