nodejs / nodejs/nan

Support for Electron 9

Open
#898 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.4k
Forks
531
Avg merge
21m
Merged PRs (30d)
1

Description

Environment

Tech stack:

  • nan 2.14.0
  • electron 9.1.2
  • cmake-js 6.0.0
  • cmake 3.17.0

Environment:

  • Mac OS 10.15.5 (Reproduced on Windows 10 as well)
Premise

We're trying to update from Electron 5 to 9 and we have a native module that is causing issues. The module builds successfully with the following setup:

// Package.json
{
  "scripts": {
    "build": "cmake-js build -l verbose",
  },
  "cmake-js": {
    "runtime": "electron",
    "runtimeVersion": "9.1.2"
  }
}

But when our Electron app launches it crashes after trying to access the native module with the following crash report:

Process:               Electron [47212]
Path:                  /Users/USER/*/Electron.app/Contents/MacOS/Electron
Identifier:            com.github.Electron
Version:               9.1.2 (9.1.2)
Code Type:             X86-64 (Native)
Parent Process:        ??? [47206]
Responsible:           iTerm2 [80766]
User ID:               502

Date/Time:             2020-08-11 11:12:28.213 -0400
OS Version:            Mac OS X 10.15.5 (19F101)
Report Version:        12
Bridge OS Version:     4.5 (17P5300)

...

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [47212]

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   license.node                  	0x0000000113c57a9f Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) + 31
1   com.github.Electron.framework 	0x00000001070a86df v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 16815
2   com.github.Electron.framework 	0x00000001070a7c01 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 14033
3   com.github.Electron.framework 	0x00000001070a7292 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 11618
4   com.github.Electron.framework 	0x0000000107ada558 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 484152

...

After further testing we realized the nan's TravisCI config file only included Electron versions up to 8.2.3. After testing our app with this version everything ran flawlessly. So basically we're wondering what could cause this issue. Could anyone provide insight or perhaps confirm this is a nan issue?

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with nan's TravisCI configuration, the Electron 8.2.3 versus 9.1.2 setup, and the provided native-module crash report. Reproduce the Electron 9 failure using the package.json cmake-js settings and compare it with Electron 8.2.3. Done means identifying whether nan supports Electron 9 and documenting or resolving the compatibility issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, electron
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.