New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: avoid crash after upgrade on Linux #41046
Conversation
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Small lint issue:
|
@codebytere are there any other changes you'd like to see here? |
Can you rebase on latest main? Which should be able to fix the Windows CI failure. |
710f5e2
to
4484338
Compare
It's a bit unclear to me why the Linux/mac builds failed. |
4484338
to
69c0962
Compare
f91a77a
to
42d742d
Compare
42d742d
to
7dc235f
Compare
Release Notes Persisted
|
Congrats on merging your first pull request! 🎉🎉🎉 |
I have automatically backported this PR to "31-x-y", please check out #42062 |
I have automatically backported this PR to "28-x-y", please check out #42063 |
I have automatically backported this PR to "30-x-y", please check out #42064 |
I have automatically backported this PR to "29-x-y", please check out #42065 |
Description of Change
Don't perform the "known executable" check on Linux if
/proc/self/exe
is going to be executed.If the executable has been unlinked -- e.g. by the system package manager to perform an upgrade of an Electron-based app -- then executing
/proc/self/exe
will still work to launch copies of the same program since it is a "magic link" (seesymlink(7)
). However, this check breaks:readlink("/proc/self/exe")
returns a fake path like/usr/lib/electron28/electron (deleted)
which does not actually exist, sobase::MakeAbsoluteFilePath
fails to resolve the path and instead returns an empty string. This in turn causes theCHECK_EQ
a few lines down to fail, and Electron crashes.I think this is responsible for the crashes mentioned in #27804 and #33315.
Reproduction instructions for the crash (on Linux)
cd $(mktemp -d); wget https://github.com/electron/electron/releases/download/v28.1.4/electron-v28.1.4-linux-x64.zip; unzip electron-v28.1.4-linux-x64.zip
./electron -i
.rm ./electron
.b = new BrowserWindow(); b.toggleDevTools()
.Checklist
Release Notes
Notes: Fixed crash after upgrade on Linux.