I'm getting user reports of people on various mac versions of the electron app quitting unexpectedly.
I thought an update to Electron would fix these issues, but they still persist.
This report below is from Mojave 10.14, another reported issue was from High Sierra
Process: Ahad Cove [1565]
Path: /Applications/Ahad Cove.app/Contents/MacOS/Ahad Cove
Identifier: com.ahadcove.ahadcove
Version: 4.0.0 (4.0.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Ahad Cove [1565]
User ID: 501
Date/Time: 2018-10-26 18:03:12.519 -0400
OS Version: Mac OS X 10.14 (18A391)
Report Version: 12
Bridge OS Version: 3.0 (16P375)
Anonymous UUID: E2D02A6C-9B54-1334-A9C4-4B63BE77DB19
Time Awake Since Boot: 2700 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [1565]
Application Specific Information:
dyld2 mode
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.github.electron.framework 0x0000000108910db5 0x107e57000 + 11247029
1 com.github.electron.framework 0x0000000108274093 0x107e57000 + 4313235
2 com.github.electron.framework 0x0000000109f1d8e3 0x107e57000 + 34367715
3 com.github.electron.framework 0x0000000108273074 0x107e57000 + 4309108
4 com.github.electron.framework 0x0000000107e59a04 AtomMain + 68
5 com.ahadcove.ahadcove 0x00000001048f9f16 main + 38
6 libdyld.dylib 0x00007fff77311085 start + 1
Thread 1:
0 libsystem_pthread.dylib 0x00007fff77502408 start_wqthread + 0
1 ??? 0x0000000054485244 0 + 1414025796
Thread 2:
0 libsystem_pthread.dylib 0x00007fff77502408 start_wqthread + 0
1 ??? 0x0000000054485244 0 + 1414025796
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000000010c26de70 rbx: 0x000000010c5215c0 rcx: 0x000000000000001d rdx: 0x0000000000000000
rdi: 0x00007ffeeb306af8 rsi: 0x00007fff483bdf53 rbp: 0x00007ffeeb3065c0 rsp: 0x00007ffeeb3065c0
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000107dfe078 r11: 0x00007fff4a24b4f1
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x00006000004142a0
rip: 0x0000000108910db5 rfl: 0x0000000000000202 cr2: 0x0000000108131180
Logical CPU: 4
Error Code: 0x00000000
Trap Number: 3
I'm getting this when quitting the app. It quits, and then I get the "quit unexpectedly" error.
Do you use any custom code around electron-updater?
@develar I'm using vue-cli-plugin-electron-builder.
Both the debug version and the final built version of the app "quit unexpectedly" when quitting.
I haven't tried making a reduced testcase yet but I will try and make time to do so.
I do not have any custom code around electron-updater
Sorry, I think my issue is different. It's nothing to do with electron-updater – or electron-builder, in fact, because it's happening with the unmodified default electron app straight from the NPM bundle too.
electron 3.0.6
fix: Native window close crash. #15338
Maybe related.
I think it may have been fixed in 3.0.6 @develar.
I updated the electron version to 3.0.6 a few days ago and reverted the electron builder back to 20.28.4 and haven't heard any complaints yet.
I also haven't heard back from those who were having the issue either lol.
So I can't confirm just yet
I suspect this may be an issue with electron-builder. I updated from electron-builder 2.22.0 to 2.29.0 and left electron at 2.0.5 (actually not even sure if 2.X is still supported!). I am publishing to S3. I pushed out a release with electron-builder --mac --x64 --publish always that crashes with SIGTRAP. But then afterward to test when I built with electron-builder --mac it ran fine. Also when I run the broken app with various locally installed electron versions, i.e. electron2.0.5 app.asar or electron3.0.6 app.asar it works fine.
Please attach log of electron-updater (https://www.electron.build/auto-update#debugging).
Please attach log of electron-updater (https://www.electron.build/auto-update#debugging).
Will do. But in the meantime I published the app without any changes in electron or electron-builder to a test bucket and it works. Strange!
The app crashes before logging anything. Or do you mean to log something during the build process (electron-builder --mac --x64)?
The app crashes before logging anything
If it so, I cannot help here :(
Let's me explain where electron-updater can lead to crash your app and why:
electron-updater implemented in JS. Uses:
zlib module (so, native);More reliable and crash-free code can be implemented in Go and electron-updater can simply delegate all heavy work to Go code that will be executed as external program (so, offload your main application, as keep in mind, NodeJS is single-threaded).
But if you say that no even logs like "update-downloaded" or "update-available" events, it means that crash occurred before. Hmm... are you sure that you have enabled electron-updater logs?
Keep in mind that because of #3424 differential update is not yet enabled for macOS. So, here we cannot blame differential downloader because it is not enabled for macOS at all.
Here's the start of my index.js:
"use strict";
const electron = require("electron");
const autoUpdater = require("electron-updater").autoUpdater;
const logger = require("electron-log");
const windowStateKeeper = require("electron-window-state");
const os = require("os");
const path = require("path");
const platform = os.platform();
if (platform === "win32") {
electron.app.setAppUserModelId("Amazing.Marvin");
}
// Used to send data to renderer ipc
let webContents;
let updateDownloaded = false;
logger.transports.file.level = "info";
autoUpdater.logger = logger;
logger.info("Starting up...");
logger.info(JSON.stringify(process.versions, null, 2));
Not even "Starting up..." is logged. I feel like something went wrong in the creation of the dmg when I ran electron-builder (since running electron on app.asar directly works) but I guess I don't understand the process well enough to know what the problem could be. I'll let you know if I find something.
Thank you for your help!
@amazingmarvin Maybe #3435 related.
I hope it is fixed in latest electron-updater/electron-builder/electron versions.
Not related to this issue, but if you change the name of the application (in my case, using the builder programmatically), you also need to change the appName field in package.json by overriding the value with config.extraMetadata.productName. This seems simple, but if you have any invalid characters in your name (I had a /), the build process sanitizes those out of the app name, but they remain in the appName field. This causes the app to instant-crash when opened, even though the build process seems fine.
Just leaving my experience here in case someone else finds this and is doing the same thing I am.
Most helpful comment
I'm getting this when quitting the app. It quits, and then I get the "quit unexpectedly" error.