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

[macOS Big Sur] Kernel panic error caused by Electron Helper (Renderer) #27332

Open
3 tasks done
Trafiz opened this issue Jan 15, 2021 · 31 comments
Open
3 tasks done

[macOS Big Sur] Kernel panic error caused by Electron Helper (Renderer) #27332

Trafiz opened this issue Jan 15, 2021 · 31 comments

Comments

@Trafiz
Copy link

@Trafiz Trafiz commented Jan 15, 2021

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 10.1.5
  • Operating System:
    • macOS Big Sur v11.1

Expected Behavior

Electron Helper (Renderer) shouldn't caused macOS restart

Actual Behavior

Electron Helper (Renderer) restarts macOS

To Reproduce

I don't know the exact way to reproduce this problem, because when programming an application using Electron, the system automatically reboots at various intervals. I cannot share the entire codebase as it is a commercial product.

Additional Information

Hey, I have an issue with my Mac that keeps restarting periodically due to Electron Helper process. I develop app using Electron and few weeks ago I updated OS to Big Sur (I had no such problems with Catalina).

What happened:
During Electron app development Mac periodically restarts in different period of time (sometimes every few minutes, sometimes every few hours). It didn’t show any error logs at first, so here’s what I tried to do:

  • Reinstall Electron
  • Run a First aid in recovery mode (nothing was found)
  • Run Apple Diagnostics (nothing was found)
  • PRAM reset
  • SMC reset
  • Create new user account in order to update some libraries or sth like that (idea from Apple support)
  • BigSur reinstallation (both - 'only OS' and 'full' with clearing all data)

After these steps Mac still reboots but now with kernel panic log (attached below) with info about corresponding process - Electron Helper (Renderer).

I contacted the Apple service several times, they redirected the matter from the 1st line support to the 2nd, and from there to their 'engineers'. After a few days, I got the answer that Electron is the cause (something new...) and I have two options:

  • Report the issue to Electron's team (so here I'm)
  • Don't use Electron (ridiculous answer)

I also created similar issue on 'developer.apple.com', but with no answer.

I’m out of idea what else I can do. Maybe except downgrading to Catalina, but it’s not a solution at all.

I would be grateful for any suggestions

Kernel panic log.txt

@alb3rtuk
Copy link

@alb3rtuk alb3rtuk commented Jan 27, 2021

I have the same issue and it’s driving me nuts. I have also concluded it’s Electron (and not the Mac) because the same thing is happening on 2 different machines, both after upgrading to Big Sur. Please help! This is a major show stopping issue for us

@finnweiler
Copy link

@finnweiler finnweiler commented Feb 15, 2021

I have the same issue and have not found a solution yet. What I did find out it that the crash occurred every time I worked with the WebSocket library from node.js. I am using the Angular-Electron repository as a basis for my project.

Here is what I did to cause the kernel panic error:

  • First calling the getUpdates() function and adding the received data to a chart.js chart.
  • After a few minutes of adding data to my chart, my MacBook Pro crashes giving a similar error report.

Here is what I think to be the relevant parts of my code:

// electron.service.ts

// ...
import WebSocket from 'ws';
// ...

@Injectable({
  providedIn: 'root'
})
export class ElectronService {
  // ...
  ws: typeof WebSocket;
  // ...

  constructor() {
    if (this.isElectron) {
      // ...
      this.ws = window.require('ws');
    }
  }
}
// myservice.service.ts

// ...
import { ElectronService } from '../electron/electron.service';
import WebSocket from 'ws';
// ...

Injectable({
  providedIn: 'root'
})
export class MyServiceService {

  // ...
  private ws: typeof WebSocket
  // ...

  constructor(
    private electronService: ElectronService
  ) {
    this.ws = electronService.ws
  }

  // ...

  public getUpdates(symbol: string): Observable<any> {
    return new Observable((obs) => {
      const socket = new this.ws(`wss://xxx:9443`);
      socket.on('message', data => {
          try {
              const parsed = JSON.parse(data).data
              obs.next(parsed)
          } catch (error) {
              console.log('Parse error: ' + error)
          }
      });
      socket.on('error', error => {
        console.error(error)
        obs.complete()
      })

      return () => {
        socket.close()
      }
    })
  }
}

Can you spot a similarity to your project?

Please correct me if I am doing anything obvious incorrectly, I just started working with Electron today.

EDIT:

Added kernel log.

kernel_log.txt

@robinclaes
Copy link

@robinclaes robinclaes commented Mar 30, 2021

Any updates from the dev team on this? This is happening 3-5 times per day for me. Also MacOS Big Sur.

@nornagon
Copy link
Member

@nornagon nornagon commented Mar 30, 2021

Sorry to hear that Apple's support was unresponsive, but this isn't something we can debug. We do not have access to the Darwin kernel source code or the tools required to debug kernel panics. I recommend escalating with Apple if possible.

@luckman212
Copy link

@luckman212 luckman212 commented Mar 31, 2021

@nornagon But, isn't it partially the project's responsibility to try to get Apple's attention on this? Wouldn't the dev team of one of the largest open source projects on the planet submitting panic reports to Apple be more likely to elicit a response than just a random handful of lowly end-users? (no offense @robinclaes)

@nornagon
Copy link
Member

@nornagon nornagon commented Mar 31, 2021

Sadly, you overestimate our influence. If you have the ability to do so, I would recommend raising a TSI with Apple.

@robinclaes
Copy link

@robinclaes robinclaes commented Mar 31, 2021

Looks like threadstarter @Trafiz already contacted Apple, and open an issue op developer.apple.com. Maybe an update from this?

@luckman212
Copy link

@luckman212 luckman212 commented Mar 31, 2021

@nornagon I reviewed the requirements for submitting a TSI and, well, that idea is dead on arrival (at least for me) for a number of reasons:

How to submit a TSI

Apple Developer Program and Apple Developer Enterprise Program members can submit a TSI in the Code-level Support section in their account.

Right out of the gate, you must be a paying member of Apple's Dev program to even submit one of these—Strike 1.

Before submitting a TSI, make sure to do the following:

  • Run Build and Analyze in Xcode and resolve any outstanding analyzer results

Don't even think this is remotely possible...the app in question in my case (Obsidian) is not even open source—Strike 2.

  • Attach symbolicated crash reports and diagnostic logs that you have in regards to your question.

Again, not open source, so there is no chance to get dSYMs, so no symbolication—Strike 3.

There are more roadblocks, but it's pointless to go on.

@Hibbem
Copy link

@Hibbem Hibbem commented Apr 22, 2021

Same problem here on Catalina. Only while developing, so it has something to do w/ the filewatchers I guess

@robinclaes
Copy link

@robinclaes robinclaes commented Apr 30, 2021

@hans24o @Trafiz @luckman212 are you also using electron-forge?

@luckman212
Copy link

@luckman212 luckman212 commented Apr 30, 2021

are you also using electron-forge?

I'm not.

@robinclaes
Copy link

@robinclaes robinclaes commented May 3, 2021

After a lot of testing and debugging, I made some progress:

Our codebase has some direct integrations with node from the renderer process (legacy, bad code). For example, we start a file watcher from the renderer process. The crashes happened significantly faster/more often as the folders we watched got bigger and bigger.

This morning, I moved that code to the main process, starting the file watcher via ipc. So far I haven't had a crash yet (coming from consistently crashing within 2 minutes after starting the file watcher). It's still too short of a timespan to assume it completely solved the problem, but at least I wanted to post an update and see if others have similar node integrations/file watchers that run from the renderer process.
If this is the case we could assume the kernel panics are a result of the nodeIntegration?

Let me know what you think.

@luckman212
Copy link

@luckman212 luckman212 commented May 3, 2021

@robinclaes Thank you for posting that, yes it's very helpful and interesting indeed. I confirmed with the developer of the project where I'm experiencing these crashes and he said they also initialize the filewatcher from the Renderer process. So the pattern is at least consistent there.

Time will tell, would appreciate any further update/confirmation from your side on whether this is really fixed by this change.

@xinaesthete
Copy link

@xinaesthete xinaesthete commented May 10, 2021

@robinclaes any further insight a week later?

@lishid
Copy link
Contributor

@lishid lishid commented May 10, 2021

Also out of curiosity, what version of Electron are you testing with? For us it seems to be 11.x (we haven't had a chance to test with 12.x yet)

@robinclaes
Copy link

@robinclaes robinclaes commented May 12, 2021

So far so good, we haven't had any crashes since we start file watching via ipc!
We are using electron 12.0.4 but I could reproduce this issue on several electron major versions.

@xinaesthete
Copy link

@xinaesthete xinaesthete commented May 12, 2021

I'm particularly happy to hear this @robinclaes as it means hopefully my own software isn't waiting to suddenly crash for the first time, just when I really really don't want during a live performance...

@finom
Copy link

@finom finom commented May 15, 2021

We were rewriting an application also because of that issue but got it at the new version again! My guess is that it's because of Node WS. More specifically we use https://github.com/jaggedsoft/node-binance-api for often changed trading data.

@Trafiz
Copy link
Author

@Trafiz Trafiz commented May 25, 2021

Sorry for no updates on my part.

@robinclaes

are you also using electron-forge?

No, I'm not.

@robinclaes what types of file watchers do you mean? Like fs.watch() / fs.watchFile()? If so, we don't use any of them.

Also, I haven't had a panic error in the last 35 days but unfortunately I'm not sure what exactly could be the reason for that.
I have two suspicions:

First:
I updated some libraries and OS since I created this thread:

  • Node to v14.15.1
  • Electron to v12.0.1
  • macOS to v11.2.3

Second (more probable, as the date of introducing the change coincides with the date from which there are no panic errors):
We had an issue related to ipc communication between main and renderer processes of Electron. We're setting up few listeners that weren't properly removed when reloading the app (important note -> I'm pretty sure all my panic errors were showing up after at least one reload of the app). We fixed that (as well as some problems with Chrome developer tools not loaded properly) by closing all app windows BrowserWindow.close() on reload, and then reopening them and setting up new listeners.
Since this change I haven't had panic crash even once.

As I said, I'm not sure if this could be causing the renderer panic error, but maybe it will be helpful for you.

@upeguiborja
Copy link

@upeguiborja upeguiborja commented Sep 21, 2021

A very similar issue is still happening with big commercial apps that I presume use electron (VSCode, Slack, Whatsapp, Figma). This is probably a hardware acceleration issue related to chromium as the kernel extensions in the backtrace are always similar to IOAcceleratorFamily2 and AppleIntelICLGraphics, the entire OS crash happens 2 to 3 times a day as I use these apps very often.

panic(cpu 6 caller 0xffffff8001fc4996): Kernel trap at 0xffffff7f9bf84dc1, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x0000000000000000, CR3: 0x000000033628f11a, CR4: 0x00000000003626e0
RAX: 0x0000000000000000, RBX: 0xffffff935bfa4fc0, RCX: 0xffffff86b5f133d0, RDX: 0x0000000000000000
RSP: 0xffffffb1092c3950, RBP: 0xffffffb1092c3960, RSI: 0x0000000000000001, RDI: 0xffffff935bfa4fc0
R8:  0xffffff8002e79228, R9:  0xffffffc8a547c610, R10: 0xffffff935ba41370, R11: 0x0000000000000041
R12: 0xffffff935bfa4fc0, R13: 0x0000000000000001, R14: 0x0000000000000002, R15: 0xffffff935b6a4000
RFL: 0x0000000000010246, RIP: 0xffffff7f9bf84dc1, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0x0000000000000000, Error code: 0x0000000000000000, Fault CPU: 0x6, PL: 0, VF: 0

Backtrace (CPU 6), Frame : Return Address
0xffffffb1092c3370 : 0xffffff8001e8cfdd 
0xffffffb1092c33c0 : 0xffffff8001fd3fd3 
0xffffffb1092c3400 : 0xffffff8001fc45ca 
0xffffffb1092c3450 : 0xffffff8001e31a2f 
0xffffffb1092c3470 : 0xffffff8001e8c7fd 
0xffffffb1092c3590 : 0xffffff8001e8caf3 
0xffffffb1092c3600 : 0xffffff800269cdca 
0xffffffb1092c3670 : 0xffffff8001fc4996 
0xffffffb1092c37f0 : 0xffffff8001fc467d 
0xffffffb1092c3840 : 0xffffff8001e31a2f 
0xffffffb1092c3860 : 0xffffff7f9bf84dc1 
0xffffffb1092c3960 : 0xffffff7f9bf849ec 
0xffffffb1092c39c0 : 0xffffff7f9bf84314 
0xffffffb1092c39f0 : 0xffffff7f9bf39d13 
0xffffffb1092c3a10 : 0xffffff7f9bf39d7e 
0xffffffb1092c3a40 : 0xffffff7f9cbf8fca 
0xffffffb1092c3a60 : 0xffffff7f9cbf9326 
0xffffffb1092c3aa0 : 0xffffff800261d67e 
0xffffffb1092c3af0 : 0xffffff7f9bf39b82 
0xffffffb1092c3b20 : 0xffffff800262792b 
0xffffffb1092c3c80 : 0xffffff8001f7f7d1 
0xffffffb1092c3d90 : 0xffffff8001e9265d 
0xffffffb1092c3e00 : 0xffffff8001e68cd5 
0xffffffb1092c3e60 : 0xffffff8001e801e2 
0xffffffb1092c3ef0 : 0xffffff8001fa869d 
0xffffffb1092c3fa0 : 0xffffff8001e32216 
      Kernel Extensions in backtrace:
         com.apple.iokit.IOAcceleratorFamily2(442.9)[065DAA9E-DE99-3C6D-A8D6-06BFD26CA1DC]@0xffffff7f9cbb4000->0xffffff7f9cc1efff
            dependency: com.apple.driver.AppleMobileFileIntegrity(1.0.5)[A994AEFE-3919-310E-A2C9-405E864BCB7B]@0xffffff80034c0000->0xffffff80034d5fff
            dependency: com.apple.iokit.IOGraphicsFamily(585.1)[240F08CD-4BC4-3093-8832-0E899EFC14F4]@0xffffff7f9cd35000->0xffffff7f9cd63fff
            dependency: com.apple.iokit.IOPCIFamily(2.9)[4E85D41F-6AD7-3C24-911C-A8B80B599F86]@0xffffff800496c000->0xffffff8004994fff
            dependency: com.apple.iokit.IOReportFamily(47)[77F098F2-012A-32EF-BD19-8A0E7ADF46E9]@0xffffff80049a3000->0xffffff80049a5fff
            dependency: com.apple.iokit.IOSurface(290.8.1)[3BE6ED95-B932-3F71-9DD5-4563CF4BD0DC]@0xffffff8004a96000->0xffffff8004ab2fff
         com.apple.driver.AppleIntelICLGraphics(16.0.5)[682E0669-AB9B-346A-AF27-06CB83CB3C2E]@0xffffff7f9bf0d000->0xffffff7f9bfc2fff
            dependency: com.apple.iokit.IOAcceleratorFamily2(442.9)[065DAA9E-DE99-3C6D-A8D6-06BFD26CA1DC]@0xffffff7f9cbb4000->0xffffff7f9cc1efff
            dependency: com.apple.iokit.IOGraphicsFamily(585.1)[240F08CD-4BC4-3093-8832-0E899EFC14F4]@0xffffff7f9cd35000->0xffffff7f9cd63fff
            dependency: com.apple.iokit.IOPCIFamily(2.9)[4E85D41F-6AD7-3C24-911C-A8B80B599F86]@0xffffff800496c000->0xffffff8004994fff
            dependency: com.apple.iokit.IOSurface(290.8.1)[3BE6ED95-B932-3F71-9DD5-4563CF4BD0DC]@0xffffff8004a96000->0xffffff8004ab2fff

Process name corresponding to current thread: Figma
Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20G165

Kernel version:
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64
Kernel UUID: C2591F4E-EE82-33CC-8C59-DB81D9AD80DD
KernelCache slide: 0x0000000001c00000
KernelCache base:  0xffffff8001e00000
Kernel slide:      0x0000000001c10000
Kernel text base:  0xffffff8001e10000
__HIB  text base: 0xffffff8001d00000
System model name: MacBookPro16,2 (Mac-5F9802EFE386AA28)
System shutdown begun: NO
Hibernation exit count: 2

System uptime in nanoseconds: 13894011879825
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x00000ca2f3a485bc
  Sleep   : 0x00000c1717a5d763 0x00000cfb439aade1 0x00000c14472d907a
  Wake    : 0x00000c171d8fcbac 0x00000d2c114496c1 0x00000c171bf1132a
last started kext at 13088583660978: >!UAudio	405.39 (addr 0xffffff7f9c9ac000, size 315392)
last stopped kext at 13381520497245: >!UAudio	405.39 (addr 0xffffff7f9c9ac000, size 315392)
loaded kexts:
com.google.drivefs.filesystems.dfsfuse	45.3.0
org.virtualbox.kext.VBoxNetAdp	6.1.26
org.virtualbox.kext.VBoxNetFlt	6.1.26
org.virtualbox.kext.VBoxUSB	6.1.26
org.virtualbox.kext.VBoxDrv	6.1.26
>AGPM	122.1
>!APlatformEnabler	2.7.0d0
>X86PlatformShim	1.0.0
@filesystems.autofs	3.0
@fileutil	20.036.15
>!ATopCaseHIDEventDriver	4050.1
>!AHIDALSService	1
>!AUpstreamUserClient	3.6.8
>!AGraphicsDevicePolicy	6.3.5
>!ABacklight	180.3
@AGDCPluginDisplayMetrics	6.3.5
>!ABridgeAudio!C	140.4
>pmtelemetry	1
|IOUserEthernet	1.0.1
>usb.!UUserHCI	1
|IO!BSerialManager	8.0.5d7
>!A!IICLGraphics	16.0.5
>BridgeAudioCommunication	140.4
@Dont_Steal_Mac_OS_X	7.0.0
>!AGFXHDA	100.1.433
>!A!IPCHPMC	2.0.1
>!AMCCSControl	1.14
>!AHV	1
>!ADiskImages2	1
>!A!ISlowAdaptiveClocking	4.0.0
>!AAVEBridge	6.1
>!AThunderboltIP	4.0.3
>!A!IICLLPGraphicsFramebuffer	16.0.5
>BCMWLANFirmware4378.Hashstore	1
>BCMWLANFirmware4377.Hashstore	1
>BCMWLANFirmware4364.Hashstore	1
>BCMWLANFirmware4355.Hashstore	1
>!AFileSystemDriver	3.0.1
@filesystems.tmpfs	1
@filesystems.hfs.kext	556.100.11
@BootCache	40
@!AFSCompression.!AFSCompressionTypeZlib	1.0.0
@!AFSCompression.!AFSCompressionTypeDataless	1.0.0d1
@filesystems.apfs	1677.141.2
>!ABCMWLANBusInterfacePCIeMac	1
@private.KextAudit	1.0
>!ASmartBatteryManager	161.0.0
>!AACPIButtons	6.1
>!ASMBIOS	2.1
>!AACPIEC	6.1
>!AAPIC	1.7
@!ASystemPolicy	2.0.0
@nke.applicationfirewall	311
|IOKitRegistryCompatibility	1
|EndpointSecurity	1
|IOUSBUserClient	900.4.2
@kext.triggers	1.0
>!AHS!BDriver	4050.1
>IO!BHIDDriver	8.0.5d7
>!AHIDKeyboard	224
>!AActuatorDriver	4440.3
>!AMultitouchDriver	4440.3
>!AInputDeviceSupport	4400.35
>!AGraphicsControl	6.3.5
>!ABacklightExpert	1.1.0
|IO!BHost!CUARTTransport	8.0.5d7
|IO!BHost!CTransport	8.0.5d7
|IOAVB!F	940.4
|IOEthernetAVB!C	1.1.0
>!A!ILpssUARTv1	3.0.60
>!A!ILpssUARTCommon	3.0.60
>!AOnboardSerial	1.0
|IOAudio!F	300.6.1
@vecLib.kext	1.2.0
>!ASMBus!C	1.0.18d1
|IONDRVSupport	585.1
@!AGPUWrangler	6.3.5
|IOSlowAdaptiveClocking!F	1.0.0
>!AThunderboltDPOutAdapter	8.1.4
|IOAccelerator!F2	442.9
@!AGraphicsDeviceControl	6.3.5
|IOGraphics!F	585.1
>X86PlatformPlugin	1.0.0
>IOPlatformPlugin!F	6.0.0d8
@plugin.IOgPTPPlugin	985.2
>usb.IOUSBHostHIDDevice	1.2
>usb.cdc.ecm	5.0.0
>usb.cdc.ncm	5.0.0
>usb.cdc	5.0.0
>usb.networking	5.0.0
>usb.!UHostCompositeDevice	1.2
>!AThunderboltPCIDownAdapter	4.1.1
>!AThunderboltDPInAdapter	8.1.4
>!AThunderboltDPAdapter!F	8.1.4
>!AHPM	3.4.4
>!A!ILpssI2C!C	3.0.60
>!A!ILpssI2C	3.0.60
>!A!ILpssDmac	3.0.60
>!ABSDKextStarter	3
|IOSurface	290.8.1
@filesystems.hfs.encodings.kext	1
>!AXsanScheme	3
>usb.!UVHCIBCE	1.2
>usb.!UVHCICommonBCE	1.0
>usb.!UVHCI	1.2
>usb.!UVHCICommon	1.0
>!AEffaceableNOR	1.0
|IOBufferCopy!C	1.1.0
|IOBufferCopyEngine!F	1
|IONVMe!F	2.1.0
>!ABCMWLANCoreMac	1.0.0
|IOSerial!F	11
|IO80211!FV2	1200.12.2b1
|IOSkywalk!F	1
>mDNSOffloadUserClient	1.0.1b8
>IOImageLoader	1.0.0
>corecapture	1.0.4
>usb.!UHostPacketFilter	1.0
|IOUSB!F	900.4.2
>!AThunderboltNHI	7.2.8
|IOThunderbolt!F	9.3.2
>usb.!UXHCIPCI	1.2
>usb.!UXHCI	1.2
>!AEFINVRAM	2.1
>!AEFIRuntime	2.1
>!ASMCRTC	1.0
|IOSMBus!F	1.1
|IOHID!F	2.0.0
$!AImage4	3.0.0
|IOTimeSync!F	985.2
|IONetworking!F	3.4
>DiskImages	493.0.0
|IO!B!F	8.0.5d7
|IOReport!F	47
|IO!BPacketLogger	8.0.5d7
$quarantine	4
$sandbox	300.0
@kext.!AMatch	1.0.0d1
|CoreAnalytics!F	1
>!ASSE	1.0
>!AKeyStore	2
>!UTDM	511.141.1
|IOUSBMass!SDriver	184.140.2
|IOSCSIBlockCommandsDevice	436.140.1
|IO!S!F	2.1
|IOSCSIArchitectureModel!F	436.140.1
>!AMobileFileIntegrity	1.0.5
@kext.CoreTrust	1
>!AFDEKeyStore	28.30
>!AEffaceable!S	1.0
>!ACredentialManager	1.0
>KernelRelayHost	1
|IOUSBHost!F	1.2
>!UHostMergeProperties	1.2
>usb.!UCommon	1.0
>!ABusPower!C	1.0
>!ASEPManager	1.0.1
>IOSlaveProcessor	1
>!AACPIPlatform	6.1
>!ASMC	3.1.9
|IOPCI!F	2.9
|IOACPI!F	1.4
>watchdog	1
@kec.pthread	1
@kec.corecrypto	11.1
@kec.Libm	1

@holmesal
Copy link

@holmesal holmesal commented Oct 20, 2021

Sadly, I'm also seeing this. It causes my machine to lock up and fully reboot about 3x per day. I'm running electron in dev mode, and the crash is attributed to Electron Helper (Renderer):

Panic(CPU 2, time 19486006222819): NMIPI for spinlock acquisition timeout, spinlock: 0xffffff86d57aeb70, spinlock owner: 0xffffff86d79b3140, current_thread: 0xffffff86d79b3140, spinlock_owner_cpu: 0x2
...
Process name corresponding to current thread: Electron Helper (Renderer)
Full dump
Panic(CPU 2, time 19486006222819): NMIPI for spinlock acquisition timeout, spinlock: 0xffffff86d57aeb70, spinlock owner: 0xffffff86d79b3140, current_thread: 0xffffff86d79b3140, spinlock_owner_cpu: 0x2
RAX: 0xffffff86d6360b20, RBX: 0xffffff9394a9c148, RCX: 0x000000000000003a, RDX: 0x000023d600000000
RSP: 0xffffffa16a16baa0, RBP: 0xffffffa16a16bae0, RSI: 0xffffff86d79b3140, RDI: 0xffffff9394a9c148
R8:  0xffffffa16a16bc60, R9:  0xffffff801eee2fb0, R10: 0x0000000000ffffff, R11: 0x0000000000000000
R12: 0xffffff86d79b3140, R13: 0x0000000000000000, R14: 0x000023d6d14ed3fa, R15: 0xffffff86d6360b20
RFL: 0x0000000000000017, RIP: 0xffffff801ee9fee7, CS:  0x0000000000000008, SS:  0x0000000000000010
Backtrace (CPU 2), Frame : Return Address
0xffffffa0aac1ef80 : 0xffffff801efc3d6b 
0xffffffa0aac1efd0 : 0xffffff801ee31bdd 
0xffffffa16a16bae0 : 0xffffff801eea0004 
0xffffffa16a16bb10 : 0xffffff801eee1800 
0xffffffa16a16bb30 : 0xffffff801eee2fe9 
0xffffffa16a16bbe0 : 0xffffff801eee34e2 
0xffffffa16a16bc50 : 0xffffff801eee255a 
0xffffffa16a16bd10 : 0xffffff801eee6465 
0xffffffa16a16bd50 : 0xffffff801f3f85c4 
0xffffffa16a16bd70 : 0xffffff801f3f86ae 
0xffffffa16a16bdb0 : 0xffffff801f451d9d 
0xffffffa16a16be30 : 0xffffff801f44d1a5 
0xffffffa16a16bee0 : 0xffffff801f44cfd1 
0xffffffa16a16bf40 : 0xffffff801f53f1de 
0xffffffa16a16bfa0 : 0xffffff801ee321f6 

Process name corresponding to current thread: Electron Helper (Renderer)
Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20G165

Kernel version:
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64
Kernel UUID: C2591F4E-EE82-33CC-8C59-DB81D9AD80DD
KernelCache slide: 0x000000001ec00000
KernelCache base:  0xffffff801ee00000
Kernel slide:      0x000000001ec10000
Kernel text base:  0xffffff801ee10000
__HIB  text base: 0xffffff801ed00000
System model name: MacBookPro15,1 (Mac-937A206F2EE63C01)
System shutdown begun: NO
Hibernation exit count: 0

System uptime in nanoseconds: 19486006247501
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x000011b8f07b0257
  Sleep   : 0x000003e588c96c42 0x000000007552c802 0x000003bd21e295d6
  Wake    : 0x000003e5936ed160 0x000000007608e52a 0x000003e590fe1d1d
last started kext at 12629466784651: >!UAudio	405.39 (addr 0xffffff7fb99ac000, size 315392)
last stopped kext at 17833967128442: >usb.serial	6.0.0 (addr 0xffffff7fb9a12000, size 20480)
loaded kexts:
@filesystems.smbfs	3.6.1
>AGPM	122.1
>!APlatformEnabler	2.7.0d0
>X86PlatformShim	1.0.0
@filesystems.autofs	3.0
@fileutil	20.036.15
>!ATopCaseHIDEventDriver	4050.1
>!AHIDALSService	1
@kext.AMDFramebuffer	4.0.6
>!AUpstreamUserClient	3.6.8
@kext.AMDRadeonX4000	4.0.6
@kext.AMDRadeonServiceManager	4.0.6
>!AGraphicsDevicePolicy	6.3.5
@AGDCPluginDisplayMetrics	6.3.5
>pmtelemetry	1
|IOUserEthernet	1.0.1
>usb.!UUserHCI	1
|IO!BSerialManager	8.0.5d7
>!A!IKBLGraphics	16.0.5
@kext.AMD9500!C	4.0.6
@Dont_Steal_Mac_OS_X	7.0.0
>!AHV	1
>!ADiskImages2	1
>AGDCBacklightControl	6.3.5
>!A!ICFLGraphicsFramebuffer	16.0.5
>BridgeAudioCommunication	140.4
>!AAVEBridge	6.1
>!AMCCSControl	1.14
>!AMuxControl2	6.3.5
>!A!ISlowAdaptiveClocking	4.0.0
>!AGFXHDA	100.1.433
>!ABridgeAudio!C	140.4
>!A!IPCHPMC	2.0.1
>!AThunderboltIP	4.0.3
>BCMWLANFirmware4378.Hashstore	1
>BCMWLANFirmware4377.Hashstore	1
>BCMWLANFirmware4364.Hashstore	1
>BCMWLANFirmware4355.Hashstore	1
>!AFileSystemDriver	3.0.1
@filesystems.tmpfs	1
@filesystems.hfs.kext	556.100.11
@BootCache	40
@!AFSCompression.!AFSCompressionTypeZlib	1.0.0
@!AFSCompression.!AFSCompressionTypeDataless	1.0.0d1
>!ABCMWLANBusInterfacePCIeMac	1
@filesystems.apfs	1677.141.2
@private.KextAudit	1.0
>!ASmartBatteryManager	161.0.0
>!AACPIButtons	6.1
>!ASMBIOS	2.1
>!AACPIEC	6.1
>!AAPIC	1.7
@!ASystemPolicy	2.0.0
@nke.applicationfirewall	311
|IOKitRegistryCompatibility	1
|EndpointSecurity	1
>!UMergeNub	900.4.2
@kext.triggers	1.0
>!AHIDKeyboard	224
>!AHS!BDriver	4050.1
>IO!BHIDDriver	8.0.5d7
>!AActuatorDriver	4440.3
>!AMultitouchDriver	4440.3
>!AInputDeviceSupport	4400.35
@kext.AMDRadeonX4100HWLibs	1.0
@kext.AMDRadeonX4000HWServices	4.0.6
|IOAVB!F	940.4
@plugin.IOgPTPPlugin	985.2
|IOEthernetAVB!C	1.1.0
@kext.AMDSupport	4.0.6
|IOAccelerator!F2	442.9
>!ABacklightExpert	1.1.0
>X86PlatformPlugin	1.0.0
>!ASMBus!C	1.0.18d1
>!AGraphicsControl	6.3.5
|IO!BHost!CUARTTransport	8.0.5d7
|IO!BHost!CTransport	8.0.5d7
@!AGPUWrangler	6.3.5
@!AGraphicsDeviceControl	6.3.5
|IOSlowAdaptiveClocking!F	1.0.0
|IONDRVSupport	585.1
>IOPlatformPlugin!F	6.0.0d8
>!A!ILpssUARTv1	3.0.60
>!A!ILpssUARTCommon	3.0.60
>!AOnboardSerial	1.0
|IOGraphics!F	585.1
|IOAudio!F	300.6.1
@vecLib.kext	1.2.0
>!AThunderboltDPOutAdapter	8.1.4
>usb.IOUSBHostHIDDevice	1.2
>usb.cdc.ecm	5.0.0
>usb.cdc.ncm	5.0.0
>usb.cdc	5.0.0
>usb.networking	5.0.0
>usb.!UHostCompositeDevice	1.2
>!AThunderboltPCIDownAdapter	4.1.1
>!AThunderboltDPInAdapter	8.1.4
>!AThunderboltDPAdapter!F	8.1.4
>!AHPM	3.4.4
>!A!ILpssI2C!C	3.0.60
>!A!ILpssI2C	3.0.60
>!A!ILpssDmac	3.0.60
>!ABSDKextStarter	3
|IOSurface	290.8.1
@filesystems.hfs.encodings.kext	1
>!ABCMWLANCoreMac	1.0.0
|IOSerial!F	11
|IO80211!FV2	1200.12.2b1
|IOSkywalk!F	1
>mDNSOffloadUserClient	1.0.1b8
>IOImageLoader	1.0.0
>corecapture	1.0.4
>!AXsanScheme	3
>!AThunderboltNHI	7.2.8
|IOThunderbolt!F	9.3.2
>usb.!UVHCIBCE	1.2
>usb.!UVHCICommonBCE	1.0
>usb.!UVHCI	1.2
>usb.!UVHCICommon	1.0
>!AEffaceableNOR	1.0
|IOBufferCopy!C	1.1.0
|IOBufferCopyEngine!F	1
|IONVMe!F	2.1.0
>usb.!UHostPacketFilter	1.0
|IOUSB!F	900.4.2
>usb.!UXHCIPCI	1.2
>usb.!UXHCI	1.2
>!AEFINVRAM	2.1
>!AEFIRuntime	2.1
>!ASMCRTC	1.0
|IOSMBus!F	1.1
|IOHID!F	2.0.0
$!AImage4	3.0.0
|IOTimeSync!F	985.2
|IONetworking!F	3.4
>DiskImages	493.0.0
|IO!B!F	8.0.5d7
|IOReport!F	47
|IO!BPacketLogger	8.0.5d7
$quarantine	4
$sandbox	300.0
@kext.!AMatch	1.0.0d1
|CoreAnalytics!F	1
>!ASSE	1.0
>!AKeyStore	2
>!UTDM	511.141.1
|IOUSBMass!SDriver	184.140.2
|IOSCSIBlockCommandsDevice	436.140.1
|IO!S!F	2.1
|IOSCSIArchitectureModel!F	436.140.1
>!AMobileFileIntegrity	1.0.5
@kext.CoreTrust	1
>!AFDEKeyStore	28.30
>!AEffaceable!S	1.0
>!ACredentialManager	1.0
>KernelRelayHost	1
|IOUSBHost!F	1.2
>!UHostMergeProperties	1.2
>usb.!UCommon	1.0
>!ABusPower!C	1.0
>!ASEPManager	1.0.1
>IOSlaveProcessor	1
>!AACPIPlatform	6.1
>!ASMC	3.1.9
|IOPCI!F	2.9
|IOACPI!F	1.4
>watchdog	1
@kec.pthread	1
@kec.corecrypto	11.1
@kec.Libm	1
panic(cpu 4 caller 0xffffff801f6a0afd): "Spinlock acquisition timed out: lock=0xffffff86d57aeb70, " "lock owner thread=0xffffff86d79b3140, current_thread: 0xffffff86d6360b20, " "lock owner active on CPU 0x2, current owner: 0xffffff86d79b3140, time: 19486006267092"@/System/Volumes/Data/SWE/macOS/BuildRoots/38cf1d983f/Library/Caches/com.apple.xbs/Sources/xnu/xnu-7195.141.6/osfmk/i386/locks_i386.c:541
Backtrace (CPU 4), Frame : Return Address
0xffffffa0cac55ad0 : 0xffffff801ee8cfdd 
0xffffffa0cac55b20 : 0xffffff801efd3fd3 
0xffffffa0cac55b60 : 0xffffff801efc45ca 
0xffffffa0cac55bb0 : 0xffffff801ee31a2f 
0xffffffa0cac55bd0 : 0xffffff801ee8c7fd 
0xffffffa0cac55cf0 : 0xffffff801ee8caf3 
0xffffffa0cac55d60 : 0xffffff801f69cdca 
0xffffffa0cac55dd0 : 0xffffff801f6a0afd 
0xffffffa0cac55e10 : 0xffffff801efb8f95 
0xffffffa0cac55e30 : 0xffffff801eeade16 
0xffffffa0cac55e60 : 0xffffff801eedcb6f 
0xffffffa0cac55f20 : 0xffffff801efafe13 
0xffffffa0cac55f60 : 0xffffff801efcd64a 
0xffffffa0cac55f80 : 0xffffff801efc3d6b 
0xffffffa0cac55fd0 : 0xffffff801ee31bdd 
0xffffffa16a90bda0 : 0xffffff801eee624e 
0xffffffa16a90be00 : 0xffffff801f44f33f 
0xffffffa16a90bf00 : 0xffffff801f44e3b6 
0xffffffa16a90bf40 : 0xffffff801f53f1de 
0xffffffa16a90bfa0 : 0xffffff801ee321f6 

Process name corresponding to current thread: Electron Helper (Renderer)

@hussa6
Copy link

@hussa6 hussa6 commented Oct 30, 2021

Sadly, I'm also seeing this. It causes my machine to lock up and fully reboot about 3x per day. I'm running electron in dev mode, and the crash is attributed to Electron Helper (Renderer):

Panic(CPU 2, time 19486006222819): NMIPI for spinlock acquisition timeout, spinlock: 0xffffff86d57aeb70, spinlock owner: 0xffffff86d79b3140, current_thread: 0xffffff86d79b3140, spinlock_owner_cpu: 0x2
...
Process name corresponding to current thread: Electron Helper (Renderer)

Full dump

I'm also facing this related to Electron Renderer, have you made any progress/insights on this?

@codingedgar
Copy link

@codingedgar codingedgar commented Feb 17, 2022

Today I was working with a simple https requests and sockets as @finnweiler and this error happened like 5 times in a row.

@xinaesthete
Copy link

@xinaesthete xinaesthete commented Feb 17, 2022

@codingedgar which version of electron are you using, for the record? Have you been able to reproduce in other versions?

@codingedgar
Copy link

@codingedgar codingedgar commented Feb 17, 2022

@codingedgar which version of electron are you using, for the record? Have you been able to reproduce in other versions?

Electron 11.0.1.

It started to happen right after I added this line:

/**
 * Promise based download file method
 */
function downloadFile(remoteFile: string, localFile: string) {
  return new Promise<void>((resolve, reject) => {
    let file: fs.WriteStream | undefined;
    const request = https.get(remoteFile, (response) => {
      if (response.statusCode === 200) {
        file = fs.createWriteStream(localFile);
        response.pipe(file);
        file.on('close', resolve);
        file.on('error', (err) => {
          fs.unlink(localFile, () => {
            reject(err);
          });
        });
      } else {
        reject(response);
      }
    });
    request.on('error', (e) => {
      reject(e);
    });
    request.setTimeout(5000, reject); // <<<<< culprit, before adding this line it never happened before
  });
}

Before adding that line, sometimes file.on('close') would never emit, the request would halt, for no reason; Now instead the kernel panics, idk if that helps. One of my interpretations is that something is wrong either in the WriteStream or the IncomingMessage (response) stream at low level, maybe the streams never close and somewhere in the setTimeout mechanism a reclaim is performed and it fails terribly.

I wonder if this is an issue that has been solved somewhere along the line and it is not present in other versions of electron. @Trafiz did the problem go away when you upgraded electron?

@xinaesthete
Copy link

@xinaesthete xinaesthete commented Feb 17, 2022

@codingedgar does that code run in the context of a BrowserWindow? If so, you might have better luck keeping any node code on the node side.

@codingedgar
Copy link

@codingedgar codingedgar commented Feb 17, 2022

@codingedgar does that code run in the context of a BrowserWindow? If so, you might have better luck keeping any node code on the node side.

It does, I'll try that.

Also, there have been several changes to how request.setTimeout works in each nodejs version. This issue might be solved somewhere, gonna upgrade and see.

@codingedgar
Copy link

@codingedgar codingedgar commented Feb 17, 2022

@codingedgar does that code run in the context of a BrowserWindow? If so, you might have better luck keeping any node code on the node side.

@xinaesthete, just to know more, why do you think if it runs on the node side it wouldn't crash?

  1. does the node side has another kind of failure mechanism?
  2. or does it perform nodejs-specific things differently?
  3. this is a kernel-level failure (which I think is due to bad resource management) would the resource management be any different?
  4. Does it mean the error might be in some Chrome error, and if it runs in plain nodejs it wouldn't happen?

@xinaesthete
Copy link

@xinaesthete xinaesthete commented Feb 19, 2022

@codingedgar yes, I think there is a very high probability that if it runs on the node side it won't crash. Hopefully it won't be too problematic to adapt your code, it can certainly lead to things getting more messy than they would otherwise be.

I'm not an Electron developer or anything, so I'm not familiar with all of the internal technical details, I was going to comment something like that the node & chromium event loops being merged could mean some odd edge-cases around memory access. Actually it seems I was thinking of nw.js rather than Electron for the two contexts as their event-loops / stacks being merged... But still, I'm fairly convinced that there is something about bringing node into the renderer execution environment that is at root here.

@codingedgar
Copy link

@codingedgar codingedgar commented Mar 1, 2022

I solved this by upgrading to macOS Monterey, it seems to be a known issue also in Obsidian https://forum.obsidian.md/t/kernel-panic-on-macos-crash-reboot/12020/142

@xinaesthete
Copy link

@xinaesthete xinaesthete commented Mar 2, 2022

Yes I became aware of it because of Obsidian which used to crash badly sometimes, I haven't observed it in my own app. Also haven't had Obsidian crash for a while and I'm not on Monterey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
17 participants