App crash while using app basing on electron


#1

Hi all,

I encounted a problem while developing my company’s app basing on the electron.

The problem is weird. When my app has been started and I do some click on ‘input’ or ‘textarea’ or ‘a’ element . The app will suddenly crash.

The bug information in my console was something like this:

Electron(4359,0x7fffeed5c3c0) malloc: *** mach_vm_map(size=18446744073709543424) failed (error code=3)
*** error: can’t allocate region
*** set a breakpoint in malloc_error_break to debug
[4359:1109/185329.849777:FATAL:memory.cc(22)] Out of memory. size=0
0 Electron Framework 0x0000000107943b2c crashpad::CloseMultipleNowOrOnExec(int, int) + 933804
1 Electron Framework 0x000000010790e223 crashpad::CloseMultipleNowOrOnExec(int, int) + 714403
2 Electron Framework 0x00000001079128f3 crashpad::CloseMultipleNowOrOnExec(int, int) + 732531
3 Electron Framework 0x00000001078d2cda crashpad::CloseMultipleNowOrOnExec(int, int) + 471386
4 libsystem_malloc.dylib 0x00007fffe5fc1282 malloc_zone_malloc + 107
5 libsystem_malloc.dylib 0x00007fffe5fc0200 malloc + 24
6 HIToolbox 0x00007fffcfe7d8bb -[IMKInputSession _coreAttributesFromRange:whichAttributes:completionHandler:] + 61
7 HIToolbox 0x00007fffcfe7f939 -[IMKInputSession attributedSubstringFromRange:completionHandler:] + 186
8 HIToolbox 0x00007fffcfe6f137 __61-[IMKInputSession imkxpc_attributedSubstringFromRange:reply:]_block_invoke + 530
9 CoreFoundation 0x00007fffd06d917c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
10 CoreFoundation 0x00007fffd06b9f84 __CFRunLoopDoBlocks + 356
11 CoreFoundation 0x00007fffd06b9ac6 __CFRunLoopRun + 1878
12 CoreFoundation 0x00007fffd06b9114 CFRunLoopRunSpecific + 420
13 HIToolbox 0x00007fffcfe5619e -[IMKInputSessionXPCInvocation invocationAwaitXPCReply] + 606
14 HIToolbox 0x00007fffcfe58750 -[IMKInputSession activate] + 3471
15 HIToolbox 0x00007fffcfe0c7ab IMKInputSessionActivate + 36
16 HIToolbox 0x00007fffcfe0bb3c ActivateInputMethodInstance + 100
17 HIToolbox 0x00007fffcfdffbcc utActivateInputMethod + 45
18 HIToolbox 0x00007fffcfdff735 utActivateIM4Document + 72
19 HIToolbox 0x00007fffcfdff5ad utOpenActivateThisDocsInputMethod + 125
20 HIToolbox 0x00007fffcfc2de09 MyActivateTSMDocument + 1687
21 AppKit 0x00007fffce2f488d -[NSTextInputContext activate] + 284
22 AppKit 0x00007fffceb85ec2 +[NSTextInputContext currentInputContext_withFirstResponderSync:] + 362
23 AppKit 0x00007fffce1b2e42 -[NSApplication updateWindows] + 96
24 Electron Framework 0x0000000107e1740f crashpad::CloseMultipleNowOrOnExec(int, int) + 5994639
25 Electron Framework 0x0000000107f24a96 crashpad::CloseMultipleNowOrOnExec(int, int) + 7098134
26 Electron Framework 0x0000000107f24726 crashpad::CloseMultipleNowOrOnExec(int, int) + 7097254
27 Electron Framework 0x0000000107e0007b crashpad::CloseMultipleNowOrOnExec(int, int) + 5899515
28 Electron Framework 0x0000000107dfcf1f crashpad::CloseMultipleNowOrOnExec(int, int) + 5886879
29 Electron Framework 0x00000001084af11b crashpad::CloseMultipleNowOrOnExec(int, int) + 12907931
30 Electron Framework 0x00000001079545c0 crashpad::CloseMultipleNowOrOnExec(int, int) + 1002048
31 Electron Framework 0x000000010791dc5b crashpad::CloseMultipleNowOrOnExec(int, int) + 778459
32 Electron Framework 0x000000010791dfac crashpad::CloseMultipleNowOrOnExec(int, int) + 779308
33 Electron Framework 0x000000010791e373 crashpad::CloseMultipleNowOrOnExec(int, int) + 780275
34 Electron Framework 0x00000001079217fa crashpad::CloseMultipleNowOrOnExec(int, int) + 793722
35 Electron Framework 0x00000001078d5d5a crashpad::CloseMultipleNowOrOnExec(int, int) + 483802
36 Electron Framework 0x0000000107921224 crashpad::CloseMultipleNowOrOnExec(int, int) + 792228
37 CoreFoundation 0x00007fffd06d9321 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
38 CoreFoundation 0x00007fffd06ba21d __CFRunLoopDoSources0 + 557
39 CoreFoundation 0x00007fffd06b9716 __CFRunLoopRun + 934
40 CoreFoundation 0x00007fffd06b9114 CFRunLoopRunSpecific + 420
41 HIToolbox 0x00007fffcfc19ebc RunCurrentEventLoopInMode + 240
42 HIToolbox 0x00007fffcfc19cf1 ReceiveNextEventCommon + 432
43 HIToolbox 0x00007fffcfc19b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
44 AppKit 0x00007fffce1b0a54 _DPSNextEvent + 1120
45 AppKit 0x00007fffce92c7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
46 AppKit 0x00007fffce1a53db -[NSApplication run] + 926
47 Electron Framework 0x000000010792206e crashpad::CloseMultipleNowOrOnExec(int, int) + 795886
48 Electron Framework 0x000000010792165c crashpad::CloseMultipleNowOrOnExec(int, int) + 793308
49 Electron Framework 0x000000010791d92e crashpad::CloseMultipleNowOrOnExec(int, int) + 777646
50 Electron Framework 0x0000000107936983 crashpad::CloseMultipleNowOrOnExec(int, int) + 880131
51 Electron Framework 0x0000000107b98afb crashpad::CloseMultipleNowOrOnExec(int, int) + 3379067
52 Electron Framework 0x0000000107b98950 crashpad::CloseMultipleNowOrOnExec(int, int) + 3378640
53 Electron Framework 0x0000000107b9ba72 crashpad::CloseMultipleNowOrOnExec(int, int) + 3391218
54 Electron Framework 0x0000000107b9453c crashpad::CloseMultipleNowOrOnExec(int, int) + 3361212
55 Electron Framework 0x0000000107aed470 crashpad::CloseMultipleNowOrOnExec(int, int) + 2676976
56 Electron Framework 0x0000000107aec5c6 crashpad::CloseMultipleNowOrOnExec(int, int) + 2673222
57 Electron Framework 0x00000001076cd447 AtomMain + 71
58 Electron 0x00000001076c6f26 main + 38
59 libdyld.dylib 0x00007fffe5e3f235 start + 1

And this problem seems to be appeard only on MacBook Pro 2017.

Could anyone give us some advices, thanks a lot!