Skip to content
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

@bugsnag/electron in main process hangs or crashes on Linux with Electron v26+ #2015

Closed
phoenixwong opened this issue Sep 20, 2023 · 4 comments
Labels
bug Confirmed bug released This feature/bug fix has been released

Comments

@phoenixwong
Copy link

Describe the bug

We've implemented BugSnag in our Electron app for a while, and it works excellently with Electron v23, v24, and v25 across MacOS/Windows/Linux platforms. However, with Electron v26, the Bugsnag.start($OPTION) either hangs or causes an immediate crash of the app in Linux (Ubuntu 22 LTS).

Steps to reproduce

  1. In any Electron project that uses Electron v25 or below with @bugsnag/electron, upgrade the Electron package to v26 - Ensure the app builder modules are under the latest version compatible with v26.
  2. Try running your project in Linux, either in development mode or a generated build.
  3. Here the error happens --
  • 3-A. On a physical device, the app hangs in the line Bugsnag.start($OPTION). There's no error throwing out, but the lines after Bugsnag.start($OPTION) are never executed
  • 3-B. On the virtual machine, the app crashes right after executing Bugsnag.start($OPTION) with the following errors --
[0915/041701.496328:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0915/041701.496755:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
  1. Downgrade the Electron back to v25 or lower (e.g., v23, v24)
  2. Rebuild and rerun your app without changing any codes.
  3. The error is gone. Both your app and Bugsnag are running smoothly again.

Environment

  • Bugsnag version: @bugsnag/electron 7.20.0 and 7.21.0
  • Electron framework version
    • 26.x.y
    • 27.x.y (beta version at this moment)
  • Linux version: Ubuntu 22 LTS

Example code snippet

// In Electron Main process

import Bugsnag from '@bugsnag/electron'

// ...

console.log('Starting BugSnag [Main process]')

Bugsnag.start($YOUR_OPTIONS)

console.log('Main process BugSnag started')

// ... the rest code blocks
Expected Outputs In The Main Process
Starting BugSnag [Main process]
[bugsnag][main] Loaded! In main process.
Main process BugSnag started
# followed by outputs from the remaining scripts.

Outputs from an actual (physical) device

Starting BugSnag [Main process]
# Nothing else. The app hangs there.

Outputs from a virtual machine

Starting BugSnag [Main process]
[0915/041701.496328:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0915/041701.496755:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
# -> App crashed
@trungutt
Copy link

That sounds problematic as Electron team only supports latest three stable major versions

@phoenixwong
Copy link
Author

That sounds problematic as Electron team only supports latest three stable major versions

Yup. Time is ticking.

If we remove (comment out) the BugSnag, everything works well under Electron v26 and v27.

To keep using BugSnag in the Linux app, we must downgrade Electron to 25.x.y, the last supported version.

@mclack
Copy link
Contributor

mclack commented Oct 24, 2023

Hi @phoenixwong & @trungutt

Apologies for the delay in response. We now have a fix for this, which is scheduled for the next release of bugsnag-js.

Thanks for bringing this to our attention. We will make sure to update this thread once v7.22.1 is available.

@mclack mclack added bug Confirmed bug wip There is work in progress labels Oct 24, 2023
@clr182 clr182 added released This feature/bug fix has been released and removed wip There is work in progress labels Nov 1, 2023
@clr182
Copy link

clr182 commented Nov 1, 2023

Hi

We have just released Bugsnag-js v7.22.1 which should fix main process hangs or crashes for electron v26+. After updating, if you are still seeing issues please let us know.

@clr182 clr182 closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

4 participants