electron: Prebuilt Electron binaries segfault at startup on Arch Linux with glibc 2.28
- Electron Version: 2.0.5, 2.0.6
- Operating System (Platform and Version): Arch Linux latest
- Last known working Electron version: ?
Expected Behavior Electron runs correctly.
Actual behavior Electron segfaults on start, before anything useful happens.
To Reproduce
Download the prebuilt Electron release (electron-2.0.x-linux-x64.zip); unzip it; run ./electron; observe the fireworks.
Additional Information
The issue seems to be caused by the glibc 2.28 upgrade on Arch - downgrading to glibc 2.27 makes Electron work. I’m not really sure what the issue itself is, as Electron crashes even before Breakpad kicks in, so no minidump is produced, and I don’t have a machine powerful enough to produce a debug build in a reasonable amount of time (and it’s likely that a debug build produced on my machine with glibc 2.28 will work fine anyway, being linked against the correct glibc). Distribution-provided binaries (the electron package in the repository) work fine, even though they were not rebuilt to match the glibc upgrade.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 77
- Comments: 43 (3 by maintainers)
Links to this issue
Commits related to this issue
- unbreak electron based apps (skype, slack) by reverting e7feec3; rel 3 revert borrowed from Arch, for details see: https://github.com/electron/electron/issues/13972 — committed to pld-linux/glibc by jpalus 6 years ago
- Merge pull request #13988 from K900/update-lld fix: update clang/lld version to fix #13972 — committed to electron/electron by deleted user 6 years ago
- Update to Electron 2.0.9 Updated Electron fixes segfault on glibc 2.28 (see https://github.com/electron/electron/issues/13972 ) — committed to mfonville/atom by mfonville 6 years ago
- Update electron framework to version 3.0.8 On Ubuntu 18.10 there is a issue with glibc versions below 2.28 see [Prebuilt Electron binaries segfault at startup on Arch Linux with glibc 2.28 #13972](ht... — committed to jhit/Boostnote by jhit 6 years ago
- 2.28-2: backport fix for BZ#23497 and revert commit breaking proprietary electron apps The problem is in fact in lld[1] used to build Electron but it's too serious regression to fool around. [1] htt... — committed to M-Reimer/glibc-PKGBUILD by deleted user 6 years ago
Another workaround that worked for me in 18.10 was to simply replace libnode.so with a newer version. For slack replace /usr/lib/slack/libnode.so with e.g libnode.so found in https://github.com/electron/electron/releases/download/v2.0.12/electron-v2.0.12-linux-x64.zip
Edit: Celebrated too soon. Slack becomes unstable and crashes and restarts every now and then with the updated lib.
For Slack users who replaced
libnode.sofrom somewhere else (and got the app running again) but still get the occasional crash, disable your notification sound for now.It seems if Slack tries to play the notification sound for a new message, it simply restarts instead of ever getting around to playing the clip.
@pcc on #llvm IRC found the exact revision that fixed it: https://github.com/llvm-project/lld/commit/1adba6d5d2f5f51d0719e81f71461437ecc1bd59
Electron apps including Slack are also broken on Fedora 29 for the same reason. I built a glibc with @mfonville’s patch, which solves the problem for me. This build is available here: https://copr.fedorainfracloud.org/coprs/ghjm/glibc/. You can install the updated glibc using
dnf copr enable ghjm/glibc && dnf update glibc(and then probably reboot).slack segfaults on 18.10
I hope this comment doesn’t derail the conversation into a stream of broken apps. If it does, I apologize.
So for me, this issue breaks the Slack desktop app on Ubuntu cosmic. For the same issue with Atom, an upgrade to the latest beta resolved it, so I assume I just need to wait for the Slack team to roll out a new version?
For reference, users of Slack should upgrade to version 3.3.7 released earlier this week, which has this fix: https://slack.com/release-notes/linux
I did not, since I use a pre-built version of Atom.
So I went the other way around, and compiled my own glibc with Arch Linux’s patch for Ubuntu Cosmic, and that works well: https://launchpad.net/~maarten-fonville/+archive/ubuntu/ppa/
@faultylee Yes, but it’s a temporary workaround expressly for this issue, not a permanent fix. The breaking change was identified and reverted in a number of distros, but will be restored once electron is using the updated version of LDD (See @K900’s comments above)
See https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/glibc&id=f2aaaac68876f6959c62ea09dcdda5d441bf4ff7 for the comment from the Arch devs
So yeah, it’s definitely a toolchain issue, more specifically a linker issue. Simply replacing
vendor/llvm-build/Release+Asserts/bin/lldwith a symlink to systemlld(version 6.0.1) results in a functional build. I’m guessing it’s a linker bug, so glibc is correct in barfing here. Now to figure out where the Debian sysroot comes from…The electron package from the Arch Linux community repository was actually built using glibc 2.27, nice try. 😉 (glibc tries pretty hard to maintain ABI compatibility, you should never need to rebuild software in order to work with newer glibc – the fact that this breaks indicates either a glibc bug or a something in the software stack that depends on private details of glibc when it shouldn’t.)
So, it’s entirely likely that rebuilding it on Arch Linux with glibc 2.28 would have the same issues, and that the issue lies in the build process. For the record, our package is built using https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/electron and you can see various patches we apply in order to use system dependencies, in the same directory of the git repository as the PKGBUILD file.
It’s literally in the release notes for Electron 2.0.8, that this bug has been fixed (by https://github.com/electron/electron/pull/13988 to be precise).
It was an electron bug, and now it is a bug in any application that has not updated their vendored Electron copies. At this point, the Electron developers have done everything they could in order to fix it.
The only other thing they could do, is to redesign the entire Electron ecosystem to use global, system electron installations by default, which would allow this to be fixed once and applied everywhere. But this is rather out of scope of the issue.
Good news: the tests pass with an updated lld, and the resulting libnode.so isn’t horribly bugged.