Issue 1:
Failed CHECK while running tests here https://mac-ci.electronjs.org/blue/organizations/jenkins/Electron%20org%2Felectron/detail/PR-11321/3/pipeline/

I'm not sure on what test exactly, and if the failure is stable.

ok 163 BrowserWindow module "webPreferences" option nativeWindowOpen option retains the original web preferences when window.location is changed to a new origin
[32195:1207/101313.842623:FATAL:wrappable.cc(27)] Check failed: !wrapper_.IsEmpty().
0 libbase.dylib 0x00000001081f6fee base::debug::StackTrace::StackTrace(unsigned long) + 174
1 libbase.dylib 0x00000001081f70bd base::debug::StackTrace::StackTrace(unsigned long) + 29
2 libbase.dylib 0x00000001081f543c base::debug::StackTrace::StackTrace() + 28
3 libbase.dylib 0x00000001082879af logging::LogMessage::~LogMessage() + 479
4 libbase.dylib 0x0000000108285325 logging::LogMessage::~LogMessage() + 21
5 Electron Framework 0x0000000104b3fd3f mate::WrappableBase::GetWrapper() + 175
6 Electron Framework 0x00000001047bbef5 mate::EventEmitter<atom::api::WebContents>::GetWrapper() + 21
7 Electron Framework 0x00000001047c3e62 bool mate::EventEmitter<atom::api::WebContents>::EmitWithSender<int>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, content::WebContents*, IPC::Message*, int const&) + 98
8 Electron Framework 0x00000001047aaecc bool mate::EventEmitter<atom::api::WebContents>::Emit<int>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, int const&) + 44
9 Electron Framework 0x00000001047aae8f atom::api::WebContents::RenderViewDeleted(content::RenderViewHost*) + 95
10 Electron Framework 0x00000001047a83a3 atom::api::WebContents::~WebContents() + 307
11 Electron Framework 0x00000001047a87b5 atom::api::WebContents::~WebContents() + 21
12 Electron Framework 0x00000001047a8899 atom::api::WebContents::~WebContents() + 25
13 Electron Framework 0x0000000104b40318 mate::WrappableBase::SecondWeakCallback(v8::WeakCallbackInfo<mate::WrappableBase> const&) + 56
14 libv8.dylib 0x000000010798586c v8::internal::FlagList::Hash() + 91916
15 libv8.dylib 0x00000001079863c3 v8::internal::FlagList::Hash() + 94819
16 libv8.dylib 0x000000010798645f v8::internal::FlagList::Hash() + 94975
17 libv8.dylib 0x000000010799c9fa v8::internal::Heap::CreateFillerObjectAt(unsigned char*, int, v8::internal::ClearRecordedSlots) + 3146
18 libv8.dylib 0x000000010799b694 v8::internal::GCTracer::NotifyIncrementalMarkingStart() + 30196
19 libv8.dylib 0x000000010799bb2b v8::internal::GCTracer::NotifyIncrementalMarkingStart() + 31371
20 libv8.dylib 0x000000010756789a v8::Isolate::LowMemoryNotification() + 314
21 Electron Framework 0x0000000104842b5d void base::internal::FunctorTraits<void (v8::Isolate::*)(), void>::Invoke<v8::Isolate*>(void (v8::Isolate::*)(), v8::Isolate*&&) + 125
22 Electron Framework 0x0000000104842aa4 void base::internal::InvokeHelper<false, void>::MakeItSo<void (v8::Isolate::* const&)(), v8::Isolate*>(void (v8::Isolate::* const&&&)(), v8::Isolate*&&) + 68
23 Electron Framework 0x0000000104842a55 void base::internal::Invoker<base::internal::BindState<void (v8::Isolate::*)(), base::internal::UnretainedWrapper<v8::Isolate> >, void ()>::RunImpl<void (v8::Isolate::* const&)(), std::__1::tuple<base::internal::UnretainedWrapper<v8::Isolate> > const&, 0ul>(void (v8::Isolate::* const&&&)(), std::__1::tuple<base::internal::UnretainedWrapper<v8::Isolate> > const&&&, base::IndexSequence<0ul>) + 85
24 Electron Framework 0x000000010484299c base::internal::Invoker<base::internal::BindState<void (v8::Isolate::*)(), base::internal::UnretainedWrapper<v8::Isolate> >, void ()>::Run(base::internal::BindStateBase*) + 44
25 libbase.dylib 0x000000010818f26d base::AtExitManager::RegisterTask(base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1>) + 333
26 libbase.dylib 0x00000001084cd4b6 base::Timer::RunScheduledTask() + 294
27 libbase.dylib 0x00000001084cd319 base::Timer::GetTaskRunner() + 329
28 libbase.dylib 0x00000001084cd80d base::Timer::RunScheduledTask() + 1149
29 libbase.dylib 0x00000001084cd754 base::Timer::RunScheduledTask() + 964
30 libbase.dylib 0x00000001084cd6e3 base::Timer::RunScheduledTask() + 851
31 libbase.dylib 0x00000001084cd629 base::Timer::RunScheduledTask() + 665
32 libbase.dylib 0x000000010819840f base::BarrierClosure(int, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>) + 703
33 libbase.dylib 0x00000001081f9590 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) + 1040
34 libbase.dylib 0x00000001082d6b96 base::MessageLoop::RunTask(base::PendingTask*) + 710
35 libbase.dylib 0x00000001082d7007 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) + 71
36 libbase.dylib 0x00000001082d88b2 base::MessageLoop::DoDelayedWork(base::TimeTicks*) + 2178
37 libbase.dylib 0x00000001082e6aad base::MessagePumpCFRunLoopBase::RunWork() + 157
38 libbase.dylib 0x00000001082e69fc base::MessagePumpCFRunLoopBase::CanInvalidateCFRunLoopTimers() + 716
39 libbase.dylib 0x000000010828fbca base::mac::CallWithEHFrame(void () block_pointer) + 10
40 libbase.dylib 0x00000001082e5f05 base::MessagePumpCFRunLoopBase::RunWorkSource(void*) + 101
41 CoreFoundation 0x00007fffd34cd3e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
42 CoreFoundation 0x00007fffd34ae65c __CFRunLoopDoSources0 + 556
43 CoreFoundation 0x00007fffd34adb46 __CFRunLoopRun + 934
44 CoreFoundation 0x00007fffd34ad544 CFRunLoopRunSpecific + 420
45 HIToolbox 0x00007fffd2a0cebc RunCurrentEventLoopInMode + 240
46 HIToolbox 0x00007fffd2a0ccf1 ReceiveNextEventCommon + 432
47 HIToolbox 0x00007fffd2a0cb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
48 AppKit 0x00007fffd0fa3a54 _DPSNextEvent + 1120
49 AppKit 0x00007fffd171f7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
50 AppKit 0x00007fffd0f983db -[NSApplication run] + 926
51 libbase.dylib 0x00000001082e773c base::MessagePumpNSRunLoop::Quit() + 604
52 libbase.dylib 0x00000001082e56ee base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 110
53 libbase.dylib 0x00000001082d650b base::MessageLoop::Run() + 299
54 libbase.dylib 0x00000001083bd9dd base::RunLoop::Run() + 125
55 libcontent.dylib 0x0000000110afdb97 content::BrowserMainLoop::MainMessageLoopRun() + 263
56 libcontent.dylib 0x0000000110afd948 content::BrowserMainLoop::RunMainMessageLoopParts() + 488
57 libcontent.dylib 0x0000000110b06fab content::BrowserMainRunner::ExitedMainMessageLoop() + 3339
58 libcontent.dylib 0x0000000110af1acd content::BrowserMain(content::MainFunctionParams const&) + 397
59 libcontent.dylib 0x0000000112f44125 content::ContentMain(content::ContentMainParams const&) + 741
60 libcontent.dylib 0x0000000112f4590c content::ContentMainRunner::Create() + 5772
61 libcontent.dylib 0x0000000112f4273d content::CreateInProcessUtilityThread(content::InProcessChildThreadParams const&) + 281821

Issue 2:
Electron version: 1.6.7

Operating system: Linux 4.9.0-2 x64

Expected behavior

webContents.create().executeJavaScript() should not hang and crash.

Actual behavior

Running the following code in a minimal electron app (nothing but the index.html, basic index.js and app.js results in a hang and crash.

How to reproduce

index.js

const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow

const path = require('path')
const url = require('url')

let mainWindow

function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600})
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
mainWindow.on('closed', () =>
mainWindow = null
)
}

app.on('ready', createWindow)

app.js

const { remote } = require('electron')

const contents = remote.webContents.create()
contents.executeJavaScript('console.log(this)')
.then(console.log)
.catch(console.error)

Wait approximately 15-20 seconds.

Crash:

> electron .

[32195:1207/101313.842623:FATAL:wrappable.cc(27)] Check failed: !wrapper_.IsEmpty().
0 libbase.dylib 0x00000001081f6fee base::debug::StackTrace::StackTrace(unsigned long) + 174
1 libbase.dylib 0x00000001081f70bd base::debug::StackTrace::StackTrace(unsigned long) + 29
2 libbase.dylib 0x00000001081f543c base::debug::StackTrace::StackTrace() + 28
3 libbase.dylib 0x00000001082879af logging::LogMessage::~LogMessage() + 479
4 libbase.dylib 0x0000000108285325 logging::LogMessage::~LogMessage() + 21
5 Electron Framework 0x0000000104b3fd3f mate::WrappableBase::GetWrapper() + 175
6 Electron Framework 0x00000001047bbef5 mate::EventEmitter<atom::api::WebContents>::GetWrapper() + 21
7 Electron Framework 0x00000001047c3e62 bool mate::EventEmitter<atom::api::WebContents>::EmitWithSender<int>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, content::WebContents*, IPC::Message*, int const&) + 98
8 Electron Framework 0x00000001047aaecc bool mate::EventEmitter<atom::api::WebContents>::Emit<int>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, int const&) + 44
9 Electron Framework 0x00000001047aae8f atom::api::WebContents::RenderViewDeleted(content::RenderViewHost*) + 95
10 Electron Framework 0x00000001047a83a3 atom::api::WebContents::~WebContents() + 307
11 Electron Framework 0x00000001047a87b5 atom::api::WebContents::~WebContents() + 21
12 Electron Framework 0x00000001047a8899 atom::api::WebContents::~WebContents() + 25
13 Electron Framework 0x0000000104b40318 mate::WrappableBase::SecondWeakCallback(v8::WeakCallbackInfo<mate::WrappableBase> const&) + 56
14 libv8.dylib 0x000000010798586c v8::internal::FlagList::Hash() + 91916
15 libv8.dylib 0x00000001079863c3 v8::internal::FlagList::Hash() + 94819
16 libv8.dylib 0x000000010798645f v8::internal::FlagList::Hash() + 94975
17 libv8.dylib 0x000000010799c9fa v8::internal::Heap::CreateFillerObjectAt(unsigned char*, int, v8::internal::ClearRecordedSlots) + 3146
18 libv8.dylib 0x000000010799b694 v8::internal::GCTracer::NotifyIncrementalMarkingStart() + 30196
19 libv8.dylib 0x000000010799bb2b v8::internal::GCTracer::NotifyIncrementalMarkingStart() + 31371
20 libv8.dylib 0x000000010756789a v8::Isolate::LowMemoryNotification() + 314
21 Electron Framework 0x0000000104842b5d void base::internal::FunctorTraits<void (v8::Isolate::*)(), void>::Invoke<v8::Isolate*>(void (v8::Isolate::*)(), v8::Isolate*&&) + 125
22 Electron Framework 0x0000000104842aa4 void base::internal::InvokeHelper<false, void>::MakeItSo<void (v8::Isolate::* const&)(), v8::Isolate*>(void (v8::Isolate::* const&&&)(), v8::Isolate*&&) + 68
23 Electron Framework 0x0000000104842a55 void base::internal::Invoker<base::internal::BindState<void (v8::Isolate::*)(), base::internal::UnretainedWrapper<v8::Isolate> >, void ()>::RunImpl<void (v8::Isolate::* const&)(), std::__1::tuple<base::internal::UnretainedWrapper<v8::Isolate> > const&, 0ul>(void (v8::Isolate::* const&&&)(), std::__1::tuple<base::internal::UnretainedWrapper<v8::Isolate> > const&&&, base::IndexSequence<0ul>) + 85
24 Electron Framework 0x000000010484299c base::internal::Invoker<base::internal::BindState<void (v8::Isolate::*)(), base::internal::UnretainedWrapper<v8::Isolate> >, void ()>::Run(base::internal::BindStateBase*) + 44
25 libbase.dylib 0x000000010818f26d base::AtExitManager::RegisterTask(base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1>) + 333
26 libbase.dylib 0x00000001084cd4b6 base::Timer::RunScheduledTask() + 294
27 libbase.dylib 0x00000001084cd319 base::Timer::GetTaskRunner() + 329
28 libbase.dylib 0x00000001084cd80d base::Timer::RunScheduledTask() + 1149
29 libbase.dylib 0x00000001084cd754 base::Timer::RunScheduledTask() + 964
30 libbase.dylib 0x00000001084cd6e3 base::Timer::RunScheduledTask() + 851
31 libbase.dylib 0x00000001084cd629 base::Timer::RunScheduledTask() + 665
32 libbase.dylib 0x000000010819840f base::BarrierClosure(int, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>) + 703
33 libbase.dylib 0x00000001081f9590 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) + 1040
34 libbase.dylib 0x00000001082d6b96 base::MessageLoop::RunTask(base::PendingTask*) + 710
35 libbase.dylib 0x00000001082d7007 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) + 71
36 libbase.dylib 0x00000001082d88b2 base::MessageLoop::DoDelayedWork(base::TimeTicks*) + 2178
37 libbase.dylib 0x00000001082e6aad base::MessagePumpCFRunLoopBase::RunWork() + 157
38 libbase.dylib 0x00000001082e69fc base::MessagePumpCFRunLoopBase::CanInvalidateCFRunLoopTimers() + 716
39 libbase.dylib 0x000000010828fbca base::mac::CallWithEHFrame(void () block_pointer) + 10
40 libbase.dylib 0x00000001082e5f05 base::MessagePumpCFRunLoopBase::RunWorkSource(void*) + 101
41 CoreFoundation 0x00007fffd34cd3e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
42 CoreFoundation 0x00007fffd34ae65c __CFRunLoopDoSources0 + 556
43 CoreFoundation 0x00007fffd34adb46 __CFRunLoopRun + 934
44 CoreFoundation 0x00007fffd34ad544 CFRunLoopRunSpecific + 420
45 HIToolbox 0x00007fffd2a0cebc RunCurrentEventLoopInMode + 240
46 HIToolbox 0x00007fffd2a0ccf1 ReceiveNextEventCommon + 432
47 HIToolbox 0x00007fffd2a0cb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
48 AppKit 0x00007fffd0fa3a54 _DPSNextEvent + 1120
49 AppKit 0x00007fffd171f7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
50 AppKit 0x00007fffd0f983db -[NSApplication run] + 926
51 libbase.dylib 0x00000001082e773c base::MessagePumpNSRunLoop::Quit() + 604
52 libbase.dylib 0x00000001082e56ee base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 110
53 libbase.dylib 0x00000001082d650b base::MessageLoop::Run() + 299
54 libbase.dylib 0x00000001083bd9dd base::RunLoop::Run() + 125
55 libcontent.dylib 0x0000000110afdb97 content::BrowserMainLoop::MainMessageLoopRun() + 263
56 libcontent.dylib 0x0000000110afd948 content::BrowserMainLoop::RunMainMessageLoopParts() + 488
57 libcontent.dylib 0x0000000110b06fab content::BrowserMainRunner::ExitedMainMessageLoop() + 3339
58 libcontent.dylib 0x0000000110af1acd content::BrowserMain(content::MainFunctionParams const&) + 397
59 libcontent.dylib 0x0000000112f44125 content::ContentMain(content::ContentMainParams const&) + 741
60 libcontent.dylib 0x0000000112f4590c content::ContentMainRunner::Create() + 5772
61 libcontent.dylib 0x0000000112f4273d content::CreateInProcessUtilityThread(content::InProcessChildThreadParams const&) + 281821

Reproducible repo: https://github.com/stevelacy/electron-bug-9487

$ git clone https://github.com/stevelacy/electron-bug-9487
$ npm install
$ npm start

alexeykuzmin: Added a more informative stacktrace from a debug build.