electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.72k stars 1.74k forks source link

Mac ARM64 app crashes on startup (sigtrap) while X64 works fine. #7050

Closed AxelTerizaki closed 2 years ago

AxelTerizaki commented 2 years ago

I'm building my app for both arm64 and x64. I was only building for x64 until now because I use other binaries I bundle wiht my app, but I managed to get native arm64 versions of those (or universal) so I'm now trying to build both x64 and arm64 versions of my app bundle (not universal.)

Problem is, the x64 version works, but not the arm64 one. I get a "trap" signal crash when launching the ARM64 one.

Here in a terminal :

karaokemugen@Nanamini MacOS % ./Karaoke\ Mugen --cli
zsh: trace trap  ./Karaoke\ Mugen --cli

Or here on screen (to get the complete error log) :

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Karaoke Mugen [32244]
Path:                  /Users/USER/*/Karaoke Mugen.app/Contents/MacOS/Karaoke Mugen
Identifier:            KaraokeMugen
Version:               7.0.15-next (7.0.15-next)
Code Type:             ARM-64 (Native)
Parent Process:        zsh [28838]
Responsible:           iTerm2 [43420]
User ID:               502

Date/Time:             2022-08-06 17:21:03.8574 +0100
OS Version:            macOS 12.5 (21G72)
Report Version:        12
Anonymous UUID:        36094D73-979C-9A2F-F3AF-1EE21E59D2B3

Time Awake Since Boot: 320000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x0000000109761710
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [32244]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Electron Framework                     0x109761710 v8::internal::CodeRange::~CodeRange() + 476
1   Electron Framework                     0x1097616cc v8::internal::CodeRange::~CodeRange() + 408
2   Electron Framework                     0x109761bf0 v8::internal::CodeRange::~CodeRange() + 1724
3   Electron Framework                     0x1097ac304 v8::internal::Heap::AllocatedExternalMemorySinceMarkCompact() + 1200
4   Electron Framework                     0x10973a358 v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) + 1304
5   Electron Framework                     0x10973aed0 v8::internal::Isolate::InitWithSnapshot(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) + 12
6   Electron Framework                     0x109bf6214 v8::internal::Checksum(v8::base::Vector<unsigned char const>) + 940
7   Electron Framework                     0x109629968 v8::Isolate::Initialize(v8::Isolate*, v8::Isolate::CreateParams const&) + 368
8   Electron Framework                     0x10c4f0440 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 37344888
9   Electron Framework                     0x1089124ac v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>) + 9920
10  Electron Framework                     0x1088fe394 v8::internal::compiler::RawMachineAssembler::TargetParameter() + 8744
11  Electron Framework                     0x10a47fc88 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 3329728
12  Electron Framework                     0x10a483030 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 3342952
13  Electron Framework                     0x10a47f6c0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 3328248
14  Electron Framework                     0x108acf83c v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 13512
15  Electron Framework                     0x108ad0954 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 17888
16  Electron Framework                     0x108ad04d0 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 16732
17  Electron Framework                     0x108aceefc v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 11144
18  Electron Framework                     0x108acf3cc v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) + 12376
19  Electron Framework                     0x10883bb58 ElectronMain + 128
20  dyld                                   0x10089d08c start + 520

Thread 1:
0   libsystem_pthread.dylib                0x1944db078 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib                0x1944db078 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib                0x1944db078 start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib                0x1944db078 start_wqthread + 0

Thread 5:: ThreadPoolServiceThread
0   libsystem_kernel.dylib                 0x1944ae358 kevent64 + 8
1   Electron Framework                     0x10b1012e8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16442656
2   Electron Framework                     0x10b0ba0f4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16151340
3   Electron Framework                     0x10b085d20 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 15937368
4   Electron Framework                     0x10b0d35e8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255008
5   Electron Framework                     0x10b0be824 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16169564
6   Electron Framework                     0x10b0d375c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255380
7   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
8   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
9   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 6:: ThreadPoolForegroundWorker
0   libsystem_kernel.dylib                 0x1944a28b0 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1944a2d20 mach_msg + 76
2   Electron Framework                     0x10b0fb564 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16418716
3   Electron Framework                     0x10b0ccc4c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16227972
4   Electron Framework                     0x10b0cd590 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16230344
5   Electron Framework                     0x10b0cd2b8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229616
6   Electron Framework                     0x10b0cd220 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229464
7   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
8   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
9   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 7:: ThreadPoolBackgroundWorker
0   libsystem_kernel.dylib                 0x1944a28b0 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1944a2d20 mach_msg + 76
2   Electron Framework                     0x10b0fb564 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16418716
3   Electron Framework                     0x10b0ccc4c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16227972
4   Electron Framework                     0x10b0cd3e0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229912
5   Electron Framework                     0x10b0cd234 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229484
6   Electron Framework                     0x10b0cd19c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229332
7   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
8   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
9   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 8:: ThreadPoolForegroundWorker
0   libsystem_kernel.dylib                 0x1944a28b0 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1944a2d20 mach_msg + 76
2   Electron Framework                     0x10b0fb564 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16418716
3   Electron Framework                     0x10b0ccc4c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16227972
4   Electron Framework                     0x10b0cd3e0 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229912
5   Electron Framework                     0x10b0cd2b8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229616
6   Electron Framework                     0x10b0cd220 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16229464
7   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
8   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
9   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 9:: Chrome_IOThread
0   libsystem_kernel.dylib                 0x1944ae358 kevent64 + 8
1   Electron Framework                     0x10b1012e8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16442656
2   Electron Framework                     0x10b0ba0f4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16151340
3   Electron Framework                     0x10b085d20 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 15937368
4   Electron Framework                     0x10b0d35e8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255008
5   Electron Framework                     0x10a4841f4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 3347500
6   Electron Framework                     0x10b0d375c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255380
7   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
8   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
9   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 10:: MemoryInfra
0   libsystem_kernel.dylib                 0x1944a28b0 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1944a2d20 mach_msg + 76
2   Electron Framework                     0x10b0fb564 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16418716
3   Electron Framework                     0x10b0fb43c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16418420
4   Electron Framework                     0x10b067888 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 15813312
5   Electron Framework                     0x10b0ba0f4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16151340
6   Electron Framework                     0x10b085d20 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 15937368
7   Electron Framework                     0x10b0d35e8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255008
8   Electron Framework                     0x10b0d375c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16255380
9   Electron Framework                     0x10b0eed28 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 16367456
10  libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
11  libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 11:
0   libsystem_kernel.dylib                 0x1944a8c20 kevent + 8
1   Electron Framework                     0x10883b1d0 uv_free_interface_addresses + 1196
2   Electron Framework                     0x10882aa20 uv_run + 356
3   Electron Framework                     0x10e5a5244 node::CommonEnvironmentSetup::context() const + 145884
4   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
5   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 12:
0   libsystem_kernel.dylib                 0x1944a6270 __psynch_cvwait + 8
1   libsystem_pthread.dylib                0x1944e083c _pthread_cond_wait + 1236
2   Electron Framework                     0x10883633c uv_cond_wait + 12
3   Electron Framework                     0x10e5a53f4 node::CommonEnvironmentSetup::context() const + 146316
4   Electron Framework                     0x10e5a3250 node::CommonEnvironmentSetup::context() const + 137704
5   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
6   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 13:
0   libsystem_kernel.dylib                 0x1944a6270 __psynch_cvwait + 8
1   libsystem_pthread.dylib                0x1944e083c _pthread_cond_wait + 1236
2   Electron Framework                     0x10883633c uv_cond_wait + 12
3   Electron Framework                     0x10e5a53f4 node::CommonEnvironmentSetup::context() const + 146316
4   Electron Framework                     0x10e5a3250 node::CommonEnvironmentSetup::context() const + 137704
5   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
6   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 14:
0   libsystem_kernel.dylib                 0x1944a6270 __psynch_cvwait + 8
1   libsystem_pthread.dylib                0x1944e083c _pthread_cond_wait + 1236
2   Electron Framework                     0x10883633c uv_cond_wait + 12
3   Electron Framework                     0x10e5a53f4 node::CommonEnvironmentSetup::context() const + 146316
4   Electron Framework                     0x10e5a3250 node::CommonEnvironmentSetup::context() const + 137704
5   libsystem_pthread.dylib                0x1944e026c _pthread_start + 148
6   libsystem_pthread.dylib                0x1944db08c thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0xffffffffffffffff   x2: 0x0000000000000007   x3: 0x0000000000000006
    x4: 0x0000000000040000   x5: 0x0000000000000001   x6: 0x0000000000000001   x7: 0x0000000000000090
    x8: 0x000000000000000d   x9: 0x00000001ed439b20  x10: 0x0000000108a0737c  x11: 0x000000000000000c
   x12: 0x00000000f82338ee  x13: 0x0000000078233800  x14: 0x0000000078200000  x15: 0x0000000000000000
   x16: 0x00000001944a3454  x17: 0x00000000000008fd  x18: 0x0000000000000000  x19: 0x0000000010000000
   x20: 0x0000000000000001  x21: 0x0000012ce0000000  x22: 0x0000000010000000  x23: 0x000060000027dfe0
   x24: 0x000060000027e038  x25: 0x000060000027dff8  x26: 0x000000010fa032d8  x27: 0x0000000000000001
   x28: 0x000060000067d508   fp: 0x000000016f5e6330   lr: 0x00000001097616cc
    sp: 0x000000016f5e62d0   pc: 0x0000000109761710 cpsr: 0xa0001000
   far: 0x000000010e73d36d  esr: 0xf2000000 (Breakpoint) brk 0

Binary Images:
       0x108648000 -        0x10f88ffff com.github.Electron.framework (*) <4c4c4441-5555-3144-a155-1e16efca5010> /Users/USER/*/Karaoke Mugen.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
       0x100898000 -        0x1008f7fff dyld (*) <75627683-a780-32ad-ae34-cf86dd23a26b> /usr/lib/dyld
       0x1944d9000 -        0x1944e5fff libsystem_pthread.dylib (*) <f32ff902-ba43-30b0-ad43-a2a8a9ff69fe> /usr/lib/system/libsystem_pthread.dylib
       0x1944a1000 -        0x1944d8fff libsystem_kernel.dylib (*) <67f22904-88ed-3847-bbf0-5c4c599fd79e> /usr/lib/system/libsystem_kernel.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=1.2G resident=0K(0%) swapped_out_or_unallocated=1.2G(100%)
Writable regions: Total=907.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=907.2M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
ColorSync                          432K       21 
CoreGraphics                        16K        1 
CoreServices                       240K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           189.2M       23 
MALLOC guard page                   96K        6 
MALLOC_MEDIUM (reserved)         240.0M        2         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
Memory Tag 253                    32.0G        2 
Memory Tag 255                     4.2G        2 
STACK GUARD                       56.2M       15 
Stack                             90.3M       15 
VM_ALLOCATE                         32K        2 
__AUTH                            2600K      308 
__AUTH_CONST                      20.3M      501 
__CTF                               756        1 
__DATA                            19.2M      496 
__DATA_CONST                      23.9M      511 
__DATA_DIRTY                      1792K      214 
__FONT_DATA                          4K        1 
__LINKEDIT                       581.3M        8 
__OBJC_CONST                      3634K      279 
__OBJC_RO                         83.0M        1 
__OBJC_RW                         3168K        1 
__TEXT                           608.9M      528 
__UNICODE                          592K        1 
dyld private memory               1024K        1 
mapped file                       60.6M       11 
shared memory                      848K       12 
===========                     =======  ======= 
TOTAL                             38.6G     2967 
TOTAL, minus reserved VM space    38.0G     2967 

-----------
Full Report
-----------

{"app_name":"Karaoke Mugen","timestamp":"2022-08-06 17:21:04.00 +0100","app_version":"7.0.15-next","slice_uuid":"4c4c4440-5555-3144-a113-2b150d2fc782","build_version":"7.0.15-next","platform":1,"bundleID":"KaraokeMugen","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.5 (21G72)","incident_id":"B5A9F95B-DB26-4307-84CE-472261198AC7","name":"Karaoke Mugen"}
{
  "uptime" : 320000,
  "procLaunch" : "2022-08-06 17:21:03.6409 +0100",
  "procRole" : "Background",
  "version" : 2,
  "userID" : 502,
  "deployVersion" : 210,
  "modelCode" : "Macmini9,1",
  "procStartAbsTime" : 7786997497367,
  "coalitionID" : 16167,
  "osVersion" : {
    "train" : "macOS 12.5",
    "build" : "21G72",
    "releaseType" : "User"
  },
  "captureTime" : "2022-08-06 17:21:03.8574 +0100",
  "incident" : "B5A9F95B-DB26-4307-84CE-472261198AC7",
  "bug_type" : "309",
  "pid" : 32244,
  "procExitAbsTime" : 7787002686217,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "Karaoke Mugen",
  "procPath" : "\/Users\/USER\/*\/Karaoke Mugen.app\/Contents\/MacOS\/Karaoke Mugen",
  "bundleInfo" : {"CFBundleShortVersionString":"7.0.15-next","CFBundleVersion":"7.0.15-next","CFBundleIdentifier":"KaraokeMugen"},
  "storeInfo" : {"deviceIdentifierForVendor":"4EDE0D22-A548-54FD-8F31-47FC0FBE8FEC","thirdParty":true},
  "parentProc" : "zsh",
  "parentPid" : 28838,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "36094D73-979C-9A2F-F3AF-1EE21E59D2B3",
  "responsiblePid" : 43420,
  "responsibleProc" : "iTerm2",
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x0000000109761710","rawCodes":[1,4453701392],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
  "termination" : {"flags":0,"code":5,"namespace":"SIGNAL","indicator":"Trace\/BPT trap: 5","byProc":"exc handler","byPid":32244},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":4330388,"threadState":{"x":[{"value":0},{"value":18446744073709551615},{"value":7},{"value":6},{"value":262144},{"value":1},{"value":1},{"value":144},{"value":13},{"value":8275598112,"symbolLocation":0,"symbol":"errno"},{"value":4439700348,"symbolLocation":157860,"symbol":"electron::fuses::IsOnlyLoadAppFromAsarEnabled()"},{"value":12},{"value":4163057902},{"value":2015574016},{"value":2015363072},{"value":0},{"value":6782858324,"symbolLocation":0,"symbol":"__error"},{"value":2301},{"value":0},{"value":268435456},{"value":1},{"value":1292248285184},{"value":268435456},{"value":105553118879712},{"value":105553118879800},{"value":105553118879736},{"value":4557124312,"symbolLocation":363616,"symbol":"vtable for v8::Extension"},{"value":1},{"value":105553123071240}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4453701324},"cpsr":{"value":2684358656},"fp":{"value":6163424048},"sp":{"value":6163423952},"esr":{"value":4060086272,"description":"(Breakpoint) brk 0"},"pc":{"value":4453701392,"matchesCrashFrame":1},"far":{"value":4537439085}},"queue":"com.apple.main-thread","frames":[{"imageOffset":17930000,"symbol":"v8::internal::CodeRange::~CodeRange()","symbolLocation":476,"imageIndex":0},{"imageOffset":17929932,"symbol":"v8::internal::CodeRange::~CodeRange()","symbolLocation":408,"imageIndex":0},{"imageOffset":17931248,"symbol":"v8::internal::CodeRange::~CodeRange()","symbolLocation":1724,"imageIndex":0},{"imageOffset":18236164,"symbol":"v8::internal::Heap::AllocatedExternalMemorySinceMarkCompact()","symbolLocation":1200,"imageIndex":0},{"imageOffset":17769304,"symbol":"v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool)","symbolLocation":1304,"imageIndex":0},{"imageOffset":17772240,"symbol":"v8::internal::Isolate::InitWithSnapshot(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool)","symbolLocation":12,"imageIndex":0},{"imageOffset":22733332,"symbol":"v8::internal::Checksum(v8::base::Vector<unsigned char const>)","symbolLocation":940,"imageIndex":0},{"imageOffset":16652648,"symbol":"v8::Isolate::Initialize(v8::Isolate*, v8::Isolate::CreateParams const&)","symbolLocation":368,"imageIndex":0},{"imageOffset":65700928,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":37344888,"imageIndex":0},{"imageOffset":2925740,"symbol":"v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)","symbolLocation":9920,"imageIndex":0},{"imageOffset":2843540,"symbol":"v8::internal::compiler::RawMachineAssembler::TargetParameter()","symbolLocation":8744,"imageIndex":0},{"imageOffset":31685768,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":3329728,"imageIndex":0},{"imageOffset":31698992,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":3342952,"imageIndex":0},{"imageOffset":31684288,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":3328248,"imageIndex":0},{"imageOffset":4749372,"symbol":"v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*)","symbolLocation":13512,"imageIndex":0},{"imageOffset":4753748,"symbol":"v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*)","symbolLocation":17888,"imageIndex":0},{"imageOffset":4752592,"symbol":"v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*)","symbolLocation":16732,"imageIndex":0},{"imageOffset":4747004,"symbol":"v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*)","symbolLocation":11144,"imageIndex":0},{"imageOffset":4748236,"symbol":"v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*)","symbolLocation":12376,"imageIndex":0},{"imageOffset":2046808,"symbol":"ElectronMain","symbolLocation":128,"imageIndex":0},{"imageOffset":20620,"symbol":"start","symbolLocation":520,"imageIndex":1}]},{"id":4330393,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":2}]},{"id":4330394,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":2}]},{"id":4330413,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":2}]},{"id":4330418,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":2}]},{"id":4330421,"name":"ThreadPoolServiceThread","frames":[{"imageOffset":54104,"symbol":"kevent64","symbolLocation":8,"imageIndex":3},{"imageOffset":44798696,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16442656,"imageIndex":0},{"imageOffset":44507380,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16151340,"imageIndex":0},{"imageOffset":44293408,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":15937368,"imageIndex":0},{"imageOffset":44611048,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255008,"imageIndex":0},{"imageOffset":44525604,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16169564,"imageIndex":0},{"imageOffset":44611420,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255380,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330422,"name":"ThreadPoolForegroundWorker","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":3},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":3},{"imageOffset":44774756,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16418716,"imageIndex":0},{"imageOffset":44584012,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16227972,"imageIndex":0},{"imageOffset":44586384,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16230344,"imageIndex":0},{"imageOffset":44585656,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229616,"imageIndex":0},{"imageOffset":44585504,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229464,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330423,"name":"ThreadPoolBackgroundWorker","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":3},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":3},{"imageOffset":44774756,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16418716,"imageIndex":0},{"imageOffset":44584012,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16227972,"imageIndex":0},{"imageOffset":44585952,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229912,"imageIndex":0},{"imageOffset":44585524,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229484,"imageIndex":0},{"imageOffset":44585372,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229332,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330424,"name":"ThreadPoolForegroundWorker","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":3},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":3},{"imageOffset":44774756,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16418716,"imageIndex":0},{"imageOffset":44584012,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16227972,"imageIndex":0},{"imageOffset":44585952,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229912,"imageIndex":0},{"imageOffset":44585656,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229616,"imageIndex":0},{"imageOffset":44585504,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16229464,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330425,"name":"Chrome_IOThread","frames":[{"imageOffset":54104,"symbol":"kevent64","symbolLocation":8,"imageIndex":3},{"imageOffset":44798696,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16442656,"imageIndex":0},{"imageOffset":44507380,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16151340,"imageIndex":0},{"imageOffset":44293408,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":15937368,"imageIndex":0},{"imageOffset":44611048,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255008,"imageIndex":0},{"imageOffset":31703540,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":3347500,"imageIndex":0},{"imageOffset":44611420,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255380,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330426,"name":"MemoryInfra","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":3},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":3},{"imageOffset":44774756,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16418716,"imageIndex":0},{"imageOffset":44774460,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16418420,"imageIndex":0},{"imageOffset":44169352,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":15813312,"imageIndex":0},{"imageOffset":44507380,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16151340,"imageIndex":0},{"imageOffset":44293408,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":15937368,"imageIndex":0},{"imageOffset":44611048,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255008,"imageIndex":0},{"imageOffset":44611420,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16255380,"imageIndex":0},{"imageOffset":44723496,"symbol":"v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*)","symbolLocation":16367456,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330427,"frames":[{"imageOffset":31776,"symbol":"kevent","symbolLocation":8,"imageIndex":3},{"imageOffset":2044368,"symbol":"uv_free_interface_addresses","symbolLocation":1196,"imageIndex":0},{"imageOffset":1976864,"symbol":"uv_run","symbolLocation":356,"imageIndex":0},{"imageOffset":99996228,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":145884,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330428,"frames":[{"imageOffset":21104,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":3},{"imageOffset":30780,"symbol":"_pthread_cond_wait","symbolLocation":1236,"imageIndex":2},{"imageOffset":2024252,"symbol":"uv_cond_wait","symbolLocation":12,"imageIndex":0},{"imageOffset":99996660,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":146316,"imageIndex":0},{"imageOffset":99988048,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":137704,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330429,"frames":[{"imageOffset":21104,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":3},{"imageOffset":30780,"symbol":"_pthread_cond_wait","symbolLocation":1236,"imageIndex":2},{"imageOffset":2024252,"symbol":"uv_cond_wait","symbolLocation":12,"imageIndex":0},{"imageOffset":99996660,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":146316,"imageIndex":0},{"imageOffset":99988048,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":137704,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]},{"id":4330430,"frames":[{"imageOffset":21104,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":3},{"imageOffset":30780,"symbol":"_pthread_cond_wait","symbolLocation":1236,"imageIndex":2},{"imageOffset":2024252,"symbol":"uv_cond_wait","symbolLocation":12,"imageIndex":0},{"imageOffset":99996660,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":146316,"imageIndex":0},{"imageOffset":99988048,"symbol":"node::CommonEnvironmentSetup::context() const","symbolLocation":137704,"imageIndex":0},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":2},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":2}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4435771392,
    "CFBundleIdentifier" : "com.github.Electron.framework",
    "size" : 119832576,
    "uuid" : "4c4c4441-5555-3144-a155-1e16efca5010",
    "path" : "\/Users\/USER\/*\/Karaoke Mugen.app\/Contents\/Frameworks\/Electron Framework.framework\/Versions\/A\/Electron Framework",
    "name" : "Electron Framework",
    "CFBundleVersion" : "20.0.0"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4303978496,
    "size" : 393216,
    "uuid" : "75627683-a780-32ad-ae34-cf86dd23a26b",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6783078400,
    "size" : 53248,
    "uuid" : "f32ff902-ba43-30b0-ad43-a2a8a9ff69fe",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6782849024,
    "size" : 229376,
    "uuid" : "67f22904-88ed-3847-bbf0-5c4c599fd79e",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  }
],
  "sharedCache" : {
  "base" : 6779781120,
  "size" : 3144695808,
  "uuid" : "ffede77c-d90b-366b-96f2-665c2f50ee59"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=1.2G resident=0K(0%) swapped_out_or_unallocated=1.2G(100%)\nWritable regions: Total=907.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=907.2M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nColorSync                          432K       21 \nCoreGraphics                        16K        1 \nCoreServices                       240K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           189.2M       23 \nMALLOC guard page                   96K        6 \nMALLOC_MEDIUM (reserved)         240.0M        2         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nMemory Tag 253                    32.0G        2 \nMemory Tag 255                     4.2G        2 \nSTACK GUARD                       56.2M       15 \nStack                             90.3M       15 \nVM_ALLOCATE                         32K        2 \n__AUTH                            2600K      308 \n__AUTH_CONST                      20.3M      501 \n__CTF                               756        1 \n__DATA                            19.2M      496 \n__DATA_CONST                      23.9M      511 \n__DATA_DIRTY                      1792K      214 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       581.3M        8 \n__OBJC_CONST                      3634K      279 \n__OBJC_RO                         83.0M        1 \n__OBJC_RW                         3168K        1 \n__TEXT                           608.9M      528 \n__UNICODE                          592K        1 \ndyld private memory               1024K        1 \nmapped file                       60.6M       11 \nshared memory                      848K       12 \n===========                     =======  ======= \nTOTAL                             38.6G     2967 \nTOTAL, minus reserved VM space    38.0G     2967 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "5ffde50ce2aacd000d47a95f",
      "factorPackIds" : {

      },
      "deploymentId" : 240000175
    },
    {
      "rolloutId" : "6112e14f37f5d11121dcd519",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "62d569b84b57044a9fcdfe33"
      },
      "deploymentId" : 240000188
    }
  ],
  "experiments" : [

  ]
}
}

Model: Macmini9,1, BootROM 7459.141.1, proc 8:4:4 processors, 16 GB, SMC 
Graphics: Apple M1, Apple M1, Built-In
Display: fitHeadless4k, 1920 x 1080 (1080p FHD - Full High Definition), Main, MirrorOff, Online
Memory Module: LPDDR4
AirPort: Wi-Fi, wl0: Mar 23 2022 19:57:59 version 18.60.27.0.7.8.129 FWID 01-570be953
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Ethernet, Ethernet, en0
USB Device: USB31Bus
USB Device: USB31Bus
USB Device: USB30Bus
Thunderbolt Bus: Mac mini, Apple Inc.
Thunderbolt Bus: Mac mini, Apple Inc.

I'd like to know where I should be searching first. I noticed there was a similar-sounding issue in #6962 but my productName and executableName are the same and I don't see any message with a missing helper.

Note that starting my app with the Electron runtime (electron .) works fine, so I think it has something to do with the build process somehow.

Here's my electron builder config (I've cut the non mac stuff)

  "build": {
    "appId": "KaraokeMugen",
    "afterSign": "build/notarize.cjs",
    "dmg": {
      "icon": "build/DMG.icns",
      "contents": [
        {
          "x": 800,
          "y": 208,
          "name": "Karaoke Mugen.app"
        },
        {
          "x": 1000,
          "y": 208,
          "type": "link",
          "path": "/Applications"
        }
      ]
    },
    "mac": {
      "artifactName": "${productName}-${version}-mac-${arch}.${ext}",
      "target": [
        {
          "target": "dmg",
          "arch": [
            "x64",
            "arm64"
          ]
        },
        {
          "target": "zip",
          "arch": [
            "x64",
            "arm64"
          ]
        }
      ],
      "publish": {
        "provider": "generic",
        "url": "https://mugen.karaokes.moe/downloads/"
      },
      "hardenedRuntime": true,
      "entitlements": "build/entitlements.plist",
      "entitlementsInherit": "build/entitlements.plist",
      "gatekeeperAssess": false,
      "compression": "normal",
      "minimumSystemVersion": "10.14.0",
      "category": "public.app-category.entertainment"
    },
    "productName": "Karaoke Mugen",
    "copyright": "© 2017-2022 Karaoke Mugen Team",
    "extraResources": [
      "migrations/**",
      "locales/*",
      "assets/**",
      "kmfrontend/build/**",
      "initpage/**",
      "build/icon.png",
      "build/electronAboutWindow.css"
    ],
    "extraFiles": [
      "app/bin/**",
      {
        "from": "app-mac/bin/${arch}",
        "to": "app/bin"
      },
      {
        "from": "app-mac/bin/universal",
        "to": "app/bin"
      }
    ],
    "directories": {
      "output": "packages",
      "buildResources": "build"
    },
    "files": [
      "dist/*",
      "package.json",
      "!**/node_modules/**/*"
    ]
  },

Does anyone have a clue of where I could search to try to fix this? Or encountered the same kind of issue?

Thanks in advance!

idanwork commented 2 years ago

I experience the same issue with electron 20, running it with the electron executable is ok. I am using apple silicone as well, macOS 12.4.

I wasn't able to narrow down the cause yet. I'll update if I do.

AxelTerizaki commented 2 years ago

@idanwork thanks for your comment, it actually made me try something since you mentionned Electron 20.

I downgraded Electron to version 19.0.11 and the app seems to work!

So I guess this is more of an Electron bug, but we don't know what electron-builder does that would make it crash?

idanwork commented 2 years ago

Hi I tried packaging empty application with electron-builder and electron 20 I didn't get the error, Later I've added all the 3rd party modules and packaged again with no issue (double click will open the app). So now I've trying to code-eliminate my code.

On Electron 19.x it works with no issues, I read the Electron 20 has changed the memory handling so it might have this effect.

idanwork commented 2 years ago

Hi I've narrowed the issue on my side to the entitlements files

With electron 20+ the result application can't be launched on Apple Silicone

Gist here https://gist.github.com/idanwork/b5ce9b6af0b2ac944c387cc2e9f67673

When packing with electron 19 or not including the entitlements files image

When including entitlements & packed it'll crash on Apple Silicone image

Note that the same entitlements are used in both cases (electron 19 & 20)

AxelTerizaki commented 2 years ago

Just a heads-up to confirm that the comment above is indeed right. I dropped the entitlments.plist file from my package.json and successfully ran the ARM64 version of my app with Electron 20. So this might be a good workaround, unless you really need entitlments.

mmaietta commented 2 years ago

These are my two entitlement files. AFAICT, the child one needs to inherit and not be a direct copy of the main entitlements. My arm64 app builds and runs completely fine when building on an M1, same with x64, and universal builds: all work correctly for me

entitlements: "installer/mac/main.entitlements",
entitlementsInherit: "installer/mac/Upwork.entitlements",
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
    <false/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <false/>
  </dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.inherit</key>
    <true/>
  </dict>
</plist>
jeremyspiegel commented 2 years ago

I ran into the same issue and found that adding the com.apple.security.cs.allow-jit entitlement fixed the issue:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
  </dict>
</plist>

This is in the Electron docs at https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds but didn't seem to be necessary before Electron 20.

AxelTerizaki commented 2 years ago

I confirm the comment above solved the issue for me : the ARM64 version I built did work again.

This wasn't easy to diagnose, maybe putting it in electron-builder's documentation (or a link to the relevant part of Electron's docs) would be nice.

mmaietta commented 2 years ago

@AxelTerizaki please consider opening a PR for adding that to the documentation when you have a chance :) It's located in the docs folder (or can be added in the jsdocs Configuration class)

suryam080 commented 8 months ago

I ran into the same issue and found that adding the com.apple.security.cs.allow-jit entitlement fixed the issue:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
  </dict>
</plist>

This is in the Electron docs at https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds but didn't seem to be necessary before Electron 20.

After days of trying, chanced upon this which worked like a charm. Thanks.