From d5c8f2d6d9d3029c4fe2daa42b6314e417cfbbc6 Mon Sep 17 00:00:00 2001 From: cptpcrd <31829097+cptpcrd@users.noreply.github.com> Date: Tue, 7 May 2024 10:04:50 -0400 Subject: [PATCH] fix: avoid crash after upgrade on Linux (#41046) --- shell/browser/electron_browser_client.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index cdaa21c48147..3a5388cda384 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -456,7 +456,15 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, int process_id) { // Make sure we're about to launch a known executable +#if BUILDFLAG(IS_LINUX) + // On Linux, do not perform this check for /proc/self/exe. It will always + // point to the currently running executable so this check is not + // necessary, and if the executable has been deleted it will return a fake + // name that causes this check to fail. + if (command_line->GetProgram() != base::FilePath(base::kProcSelfExe)) { +#else { +#endif ScopedAllowBlockingForElectron allow_blocking; base::FilePath child_path; base::FilePath program =