- Electron version: 0.37.6, also current master (8d08c3241dda53753be3e612133df96ceb8ab885)
- Operating system: Mac OS X 10.11.4

If the devtools are already open in a window when it is navigating, trying to access `event.sender.devToolsWebContents.hostWebContents` in the `did-get-response-details` event can sometimes crash Electron at [`atom_api_web_contents:1161`](https://github.com/electron/electron/blob/master/atom/browser/api/atom_api_web_contents.cc#L1161)

I ran into this in the wild when [Nightmare’s](https://github.com/segmentio/nightmare) test suite started intermittently crashing. ~~I have not seen the crash on Linux, so I’m not sure if it is specific to OS X.~~ This happens in Nightmare when some events get forwarded across process boundaries using `JSON.stringify()`, which tries to access `devToolsWebContents.hostWebContents`. I’m guessing the dev tools are in the middle of reloading here and not all references are still (or yet?) valid.

Minimal test case electron script:

``` js
var electron = require('electron');
var mainWindow = null;

electron.app.on('ready', function() {
  mainWindow = new electron.BrowserWindow({
    width: 1000,
    height: 800,
    show: true
  });
  mainWindow.webContents.openDevTools();
  setTimeout(navigate, 500);

  function navigate() {
    mainWindow.webContents.on('did-get-response-details', function(event) {
      console.log('did-get-response-details', [].slice.call(arguments, 1));
      // the next line crashes intermittently
      event.sender.devToolsWebContents && event.sender.devToolsWebContents.hostWebContents;
    });
    mainWindow.webContents.loadURL('http://example.com');
  }
});
```

Crash report (from debug build, so more details):

```
Process:               Electron [92065]
Path:                  /Users/USER/*/Electron-dev.app/Contents/MacOS/Electron
Identifier:            com.github.electron
Version:               0.37.6 (0.37.6)
Code Type:             X86-64 (Native)
Parent Process:        node [92064]
Responsible:           Terminal [261]
User ID:               501

Date/Time:             2016-04-15 15:23:20.084 -0700
OS Version:            Mac OS X 10.11.4 (15E65)

System Integrity Protection: enabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   libcontent.dylib                0x0000000106f3b544 content::WebContentsObserver::web_contents() const + 4
1   com.github.electron.framework   0x00000001032b99a9 atom::api::WebContents::HostWebContents() + 73 (atom_api_web_contents.cc:1161)
2   com.github.electron.framework   0x00000001032e59b9 base::internal::RunnableAdapter<content::WebContents* (atom::api::WebContents::*)()>::Run(atom::api::WebContents*) + 105 (bind_internal.h:178)
3   com.github.electron.framework   0x00000001032e5949 base::internal::InvokeHelper<false, content::WebContents*, base::internal::RunnableAdapter<content::WebContents* (atom::api::WebContents::*)()>, base::internal::TypeList<atom::api::WebContents* const&> >::MakeItSo(base::internal::RunnableAdapter<content::WebContents* (atom::api::WebContents::*)()>, atom::api::WebContents* const&) + 41 (bind_internal.h:290)
4   com.github.electron.framework   0x00000001032e5915 base::internal::Invoker<base::IndexSequence<>, base::internal::BindState<base::internal::RunnableAdapter<content::WebContents* (atom::api::WebContents::*)()>, content::WebContents* (atom::api::WebContents*)>, base::internal::TypeList<>, base::internal::InvokeHelper<false, content::WebContents*, base::internal::RunnableAdapter<content::WebContents* (atom::api::WebContents::*)()>, base::internal::TypeList<atom::api::WebContents* const&> >, content::WebContents* (atom::api::WebContents* const&)>::Run(base::internal::BindStateBase*, atom::api::WebContents* const&) + 69 (bind_internal.h:347)
5   com.github.electron.framework   0x00000001032e5656 base::Callback<content::WebContents* (atom::api::WebContents*)>::Run(atom::api::WebContents* const&) const + 70 (callback.h:394)
6   com.github.electron.framework   0x00000001032e55a8 void mate::internal::Invoker<mate::internal::IndicesHolder<0ul>, atom::api::WebContents*>::DispatchToCallback<content::WebContents*>(base::Callback<content::WebContents* (atom::api::WebContents*)>) + 40 (function_template.h:187)
7   com.github.electron.framework   0x00000001032e53e9 mate::internal::Dispatcher<content::WebContents* (atom::api::WebContents*)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 313 (function_template.h:228)
8   libv8.dylib                     0x0000000104c26ca3 v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) + 163
9   libv8.dylib                     0x0000000104c5dc3e 0x104bef000 + 453694
10  libv8.dylib                     0x0000000104c5d7db v8::internal::Builtins::InvokeApiFunction(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 411
11  libv8.dylib                     0x0000000104ea0fe8 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 520
12  libv8.dylib                     0x0000000104f969e4 v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::LanguageMode) + 644
13  libv8.dylib                     0x0000000104f95e45 v8::internal::Object::GetProperty(v8::internal::LookupIterator*, v8::internal::LanguageMode) + 245
14  libv8.dylib                     0x0000000104f3b7f2 v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>) + 978
15  libv8.dylib                     0x0000000104f42253 v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) + 771
16  ???                             0x00001a6f79b0c1fb 0 + 29066085319163
17  ???                             0x00001a6f79cbe8ac 0 + 29066087098540
18  ???                             0x00001a6f79b0f6b7 0 + 29066085332663
19  ???                             0x00001a6f79cbe490 0 + 29066087097488
20  ???                             0x00001a6f79c3aea6 0 + 29066086559398
21  ???                             0x00001a6f79b0f6b7 0 + 29066085332663
22  ???                             0x00001a6f79b36e64 0 + 29066085494372
23  ???                             0x00001a6f79b19a62 0 + 29066085374562
24  libv8.dylib                     0x0000000104ea12b0 0x104bef000 + 2826928
25  libv8.dylib                     0x0000000104ea0fa8 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 456
26  libv8.dylib                     0x0000000104c0d13c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 300
27  libnode.dylib                   0x00000001041f1dcd node::MakeCallback(node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*) + 1357 (node.cc:1198)
28  libnode.dylib                   0x00000001041f267e node::MakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*) + 174 (node.cc:1276)
29  libnode.dylib                   0x00000001041f26f1 node::MakeCallback(node::Environment*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*) + 97 (node.cc:1286)
30  libnode.dylib                   0x00000001041f27a1 node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*) + 161 (node.cc:1300)
31  com.github.electron.framework   0x00000001033e21ca mate::internal::CallEmitWithArgs(v8::Isolate*, v8::Local<v8::Object>, std::__1::vector<v8::Local<v8::Value>, std::__1::allocator<v8::Local<v8::Value> > >*) + 170 (event_emitter_caller.cc:25)
32  com.github.electron.framework   0x00000001032c92ab v8::Local<v8::Value> mate::EmitEvent<base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, v8::Local<v8::Object>, bool, GURL, GURL, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, net::HttpResponseHeaders*, char const*>(v8::Isolate*, v8::Local<v8::Object>, base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, v8::Local<v8::Object> const&, bool const&, GURL const&, GURL const&, int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, net::HttpResponseHeaders* const&, char const* const&) + 907 (event_emitter_caller.h:48)
33  com.github.electron.framework   0x00000001032c8e43 bool mate::EventEmitter::EmitWithEvent<bool, GURL, GURL, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, net::HttpResponseHeaders*, char const*>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, v8::Local<v8::Object>, bool const&, GURL const&, GURL const&, int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, net::HttpResponseHeaders* const&, char const* const&) + 339 (event_emitter.h:65)
34  com.github.electron.framework   0x00000001032c8cb7 bool mate::EventEmitter::EmitWithSender<bool, GURL, GURL, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, net::HttpResponseHeaders*, char const*>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, content::WebContents*, IPC::Message*, bool const&, GURL const&, GURL const&, int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, net::HttpResponseHeaders* const&, char const* const&) + 327 (event_emitter.h:51)
35  com.github.electron.framework   0x00000001032bd36e bool mate::EventEmitter::Emit<bool, GURL, GURL, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, net::HttpResponseHeaders*, char const*>(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, bool const&, GURL const&, GURL const&, int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, net::HttpResponseHeaders* const&, char const* const&) + 174 (event_emitter.h:39)
36  com.github.electron.framework   0x00000001032b5e3d atom::api::WebContents::DidGetResourceResponseStart(content::ResourceRequestDetails const&) + 269 (atom_api_web_contents.cc:590)
37  libcontent.dylib                0x00000001072df0f6 content::WebContentsImpl::DidGetResourceResponseStart(content::ResourceRequestDetails const&) + 342
38  libcontent.dylib                0x000000010715073e 0x106f2c000 + 2246462
39  libbase.dylib                   0x000000010565293a base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) + 202
40  libbase.dylib                   0x000000010567c1c9 base::MessageLoop::RunTask(base::PendingTask const&) + 489
41  libbase.dylib                   0x000000010567c818 base::MessageLoop::DoWork() + 632
42  libbase.dylib                   0x0000000105643cf1 0x105641000 + 11505
43  libbase.dylib                   0x000000010566fa5a base::mac::CallWithEHFrame(void () block_pointer) + 10
44  libbase.dylib                   0x00000001056436f4 0x105641000 + 9972
45  com.apple.CoreFoundation        0x00007fff9ad26881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
46  com.apple.CoreFoundation        0x00007fff9ad05fbc __CFRunLoopDoSources0 + 556
47  com.apple.CoreFoundation        0x00007fff9ad054df __CFRunLoopRun + 927
48  com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
49  com.apple.HIToolbox             0x00007fff8ea8f935 RunCurrentEventLoopInMode + 235
50  com.apple.HIToolbox             0x00007fff8ea8f76f ReceiveNextEventCommon + 432
51  com.apple.HIToolbox             0x00007fff8ea8f5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
52  com.apple.AppKit                0x00007fff8b250efa _DPSNextEvent + 1067
53  com.apple.AppKit                0x00007fff8b25032a -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
54  com.apple.AppKit                0x00007fff8b244e84 -[NSApplication run] + 682
55  libbase.dylib                   0x000000010564464f 0x105641000 + 13903
56  libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
57  libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
58  libcontent.dylib                0x0000000106fcb75b content::BrowserMainLoop::MainMessageLoopRun() + 155
59  libcontent.dylib                0x0000000106fcb573 content::BrowserMainLoop::RunMainMessageLoopParts() + 67
60  libcontent.dylib                0x0000000106fcdd82 0x106f2c000 + 662914
61  libcontent.dylib                0x0000000106fc73dd content::BrowserMain(content::MainFunctionParams const&) + 173
62  libcontent.dylib                0x0000000106f311ec 0x106f2c000 + 20972
63  libcontent.dylib                0x0000000106f306e6 content::ContentMain(content::ContentMainParams const&) + 54
64  com.github.electron.framework   0x00000001031fa4a8 AtomMain + 104 (atom_library_main.mm:24)
65  com.github.electron             0x00000001031f1e08 main + 72 (atom_main.cc:194)
66  libdyld.dylib                   0x00007fff92f6f5ad start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff93a6d5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff9a2b5578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff9a2b3341 start_wqthread + 13

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff93a6defa kevent_qos + 10
1   libdispatch.dylib               0x00007fff9f68a165 _dispatch_mgr_invoke + 216
2   libdispatch.dylib               0x00007fff9f689dcd _dispatch_mgr_thread + 52

Thread 3:
0   libsystem_kernel.dylib          0x00007fff93a6d5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff9a2b5578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff9a2b3341 start_wqthread + 13

Thread 4:: WorkerPool/14595
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b675e _pthread_cond_wait + 821
2   libbase.dylib                   0x00000001056aa25b base::ConditionVariable::TimedWait(base::TimeDelta const&) + 91
3   libbase.dylib                   0x00000001056c19ed base::PosixDynamicThreadPool::WaitForTask() + 205
4   libbase.dylib                   0x00000001056c1ea4 0x105641000 + 528036
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 5:: WorkerPool/14095
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b675e _pthread_cond_wait + 821
2   libbase.dylib                   0x00000001056aa25b base::ConditionVariable::TimedWait(base::TimeDelta const&) + 91
3   libbase.dylib                   0x00000001056c19ed base::PosixDynamicThreadPool::WaitForTask() + 205
4   libbase.dylib                   0x00000001056c1ea4 0x105641000 + 528036
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 6:: WorkerPool/12807
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b675e _pthread_cond_wait + 821
2   libbase.dylib                   0x00000001056aa25b base::ConditionVariable::TimedWait(base::TimeDelta const&) + 91
3   libbase.dylib                   0x00000001056c19ed base::PosixDynamicThreadPool::WaitForTask() + 205
4   libbase.dylib                   0x00000001056c1ea4 0x105641000 + 528036
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 7:
0   libsystem_kernel.dylib          0x00007fff93a6d07a __select + 10
1   libnode.dylib                   0x000000010446b883 uv__stream_osx_select + 659 (stream.c:169)
2   libnode.dylib                   0x000000010446f48d uv__thread_start + 61 (thread.c:49)
3   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
5   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff93a6d07a __select + 10
1   libnode.dylib                   0x000000010446b883 uv__stream_osx_select + 659 (stream.c:169)
2   libnode.dylib                   0x000000010446f48d uv__thread_start + 61 (thread.c:49)
3   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
5   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 9:
0   libsystem_kernel.dylib          0x00007fff93a6d5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff9a2b5578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff9a2b3341 start_wqthread + 13

Thread 10:
0   libsystem_kernel.dylib          0x00007fff93a6d5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff9a2b5578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff9a2b3341 start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib          0x00007fff93a6d5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff9a2b5578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff9a2b3341 start_wqthread + 13

Thread 12:: NetworkConfigWatcher
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   com.apple.Foundation            0x00007fff97053dd9 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
6   libbase.dylib                   0x000000010564446e base::MessagePumpNSRunLoop::DoRun(base::MessagePump::Delegate*) + 126
7   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
8   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
9   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
10  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
11  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
12  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
13  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
14  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 13:: DnsConfigService
0   libsystem_kernel.dylib          0x00007fff93a6deca kevent + 10
1   libbase.dylib                   0x00000001056f3207 0x105641000 + 729607
2   libbase.dylib                   0x00000001056f0b4b 0x105641000 + 719691
3   libbase.dylib                   0x0000000105643001 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 417
4   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
5   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
6   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
7   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
8   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
9   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
10  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 14:: CrShutdownDetector
0   libsystem_kernel.dylib          0x00007fff93a6e362 read + 10
1   com.github.electron.framework   0x0000000103322c44 atom::(anonymous namespace)::ShutdownDetector::ThreadMain() + 228 (atom_browser_main_parts_posix.cc:124)
2   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
3   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
5   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 15:: Chrome_DBThread
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   libbase.dylib                   0x00000001056440ff base::MessagePumpCFRunLoop::DoRun(base::MessagePump::Delegate*) + 79
6   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
7   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
8   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
9   libcontent.dylib                0x0000000106fd52a8 content::BrowserThreadImpl::DBThreadRun(base::MessageLoop*) + 24
10  libcontent.dylib                0x0000000106fd55f6 content::BrowserThreadImpl::Run(base::MessageLoop*) + 102
11  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
12  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
13  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
14  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
15  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 16:: Chrome_FileThread
0   libsystem_kernel.dylib          0x00007fff93a6deca kevent + 10
1   libbase.dylib                   0x00000001056f3207 0x105641000 + 729607
2   libbase.dylib                   0x00000001056f0b4b 0x105641000 + 719691
3   libbase.dylib                   0x0000000105642fe9 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 393
4   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
5   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
6   libcontent.dylib                0x0000000106fd5328 content::BrowserThreadImpl::FileThreadRun(base::MessageLoop*) + 24
7   libcontent.dylib                0x0000000106fd5603 content::BrowserThreadImpl::Run(base::MessageLoop*) + 115
8   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
9   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
10  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
11  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
12  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 17:: Chrome_FileUserBlockingThread
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   libbase.dylib                   0x00000001056440ff base::MessagePumpCFRunLoop::DoRun(base::MessagePump::Delegate*) + 79
6   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
7   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
8   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
9   libcontent.dylib                0x0000000106fd53a8 content::BrowserThreadImpl::FileUserBlockingThreadRun(base::MessageLoop*) + 24
10  libcontent.dylib                0x0000000106fd5610 content::BrowserThreadImpl::Run(base::MessageLoop*) + 128
11  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
12  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
13  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
14  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
15  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 18:: Chrome_ProcessLauncherThread
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   libbase.dylib                   0x00000001056440ff base::MessagePumpCFRunLoop::DoRun(base::MessagePump::Delegate*) + 79
6   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
7   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
8   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
9   libcontent.dylib                0x0000000106fd5428 content::BrowserThreadImpl::ProcessLauncherThreadRun(base::MessageLoop*) + 24
10  libcontent.dylib                0x0000000106fd561d content::BrowserThreadImpl::Run(base::MessageLoop*) + 141
11  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
12  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
13  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
14  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
15  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 19:: Chrome_CacheThread
0   libsystem_kernel.dylib          0x00007fff93a6deca kevent + 10
1   libbase.dylib                   0x00000001056f3207 0x105641000 + 729607
2   libbase.dylib                   0x00000001056f0b4b 0x105641000 + 719691
3   libbase.dylib                   0x0000000105642fe9 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 393
4   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
5   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
6   libcontent.dylib                0x0000000106fd54a8 content::BrowserThreadImpl::CacheThreadRun(base::MessageLoop*) + 24
7   libcontent.dylib                0x0000000106fd562a content::BrowserThreadImpl::Run(base::MessageLoop*) + 154
8   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
9   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
10  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
11  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
12  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 20:: Chrome_IOThread
0   libsystem_kernel.dylib          0x00007fff93a6deca kevent + 10
1   libbase.dylib                   0x00000001056f3207 0x105641000 + 729607
2   libbase.dylib                   0x00000001056f0b4b 0x105641000 + 719691
3   libbase.dylib                   0x0000000105642fe9 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 393
4   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
5   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
6   libcontent.dylib                0x0000000106fd5528 content::BrowserThreadImpl::IOThreadRun(base::MessageLoop*) + 24
7   libcontent.dylib                0x0000000106fd5637 content::BrowserThreadImpl::Run(base::MessageLoop*) + 167
8   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
9   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
10  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
11  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
12  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 21:: IndexedDB
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   libbase.dylib                   0x00000001056440ff base::MessagePumpCFRunLoop::DoRun(base::MessagePump::Delegate*) + 79
6   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
7   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
8   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
9   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
10  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
11  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
12  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
13  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 22:: CompositorTileWorker1/37123
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b6728 _pthread_cond_wait + 767
2   libcc.dylib                     0x0000000106b76ff8 non-virtual thunk to cc::SingleThreadTaskGraphRunner::Run() + 56
3   libbase.dylib                   0x00000001056bd6e3 base::DelegateSimpleThread::Run() + 19
4   libbase.dylib                   0x00000001056bd3dd base::SimpleThread::ThreadMain() + 125
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 23:: handle-watcher-thread
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b6728 _pthread_cond_wait + 767
2   libmojo_system_impl.dylib       0x00000001098aca38 mojo::system::Waiter::Wait(unsigned long long, unsigned long*) + 216
3   libmojo_system_impl.dylib       0x000000010988e3e9 mojo::system::Core::WaitManyInternal(unsigned int const*, unsigned int const*, unsigned int, unsigned long long, unsigned int*, mojo::system::HandleSignalsState*) + 505
4   libmojo_system_impl.dylib       0x000000010988e1bf mojo::system::Core::Wait(unsigned int, unsigned int, unsigned long long, mojo::system::UserPointer<MojoHandleSignalsState>) + 79
5   libmojo_system_impl.dylib       0x0000000109883d7b MojoWait + 155
6   libmojo_message_pump_lib.dylib  0x0000000109874c99 mojo::common::MessagePumpMojo::WaitForReadyHandles(mojo::common::MessagePumpMojo::RunState const&) const + 41
7   libmojo_message_pump_lib.dylib  0x00000001098749eb mojo::common::MessagePumpMojo::DoRunLoop(mojo::common::MessagePumpMojo::RunState*, base::MessagePump::Delegate*) + 139
8   libmojo_message_pump_lib.dylib  0x0000000109874931 mojo::common::MessagePumpMojo::Run(base::MessagePump::Delegate*) + 81
9   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
10  libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
11  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
12  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
13  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
14  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
15  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 24:
0   libsystem_kernel.dylib          0x00007fff93a66fae semaphore_wait_trap + 10
1   libnode.dylib                   0x000000010446f957 uv_sem_wait + 23 (thread.c:246)
2   com.github.electron.framework   0x0000000103431166 atom::NodeBindings::EmbedThreadRunner(void*) + 38 (node_bindings.cc:258)
3   libnode.dylib                   0x000000010446f48d uv__thread_start + 61 (thread.c:49)
4   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
5   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
6   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 25:: AudioThread
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   libbase.dylib                   0x00000001056440ff base::MessagePumpCFRunLoop::DoRun(base::MessagePump::Delegate*) + 79
6   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
7   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
8   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
9   libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
10  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
11  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
12  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
13  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 26:: BrowserBlockingWorker1/52535
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b6728 _pthread_cond_wait + 767
2   libbase.dylib                   0x00000001056b9c1d base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) + 2333
3   libbase.dylib                   0x00000001056b92bd base::SequencedWorkerPool::Worker::Run() + 125
4   libbase.dylib                   0x00000001056bd3dd base::SimpleThread::ThreadMain() + 125
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 27:: NetworkConfigWatcher
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   com.apple.Foundation            0x00007fff97053dd9 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
6   libbase.dylib                   0x000000010564446e base::MessagePumpNSRunLoop::DoRun(base::MessagePump::Delegate*) + 126
7   libbase.dylib                   0x0000000105643b44 0x105641000 + 11076
8   libbase.dylib                   0x00000001056941e3 base::RunLoop::Run() + 99
9   libbase.dylib                   0x000000010567b8fd base::MessageLoop::Run() + 29
10  libbase.dylib                   0x00000001056bf218 base::Thread::ThreadMain() + 248
11  libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
12  libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
13  libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
14  libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 28:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff93a66f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff93a663b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff9ad061c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff9ad0568c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff9ad04ed8 CFRunLoopRunSpecific + 296
5   com.apple.AppKit                0x00007fff8b3a6e99 _NSEventThread + 149
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 29:: CachePoolWorker1/73751
0   libsystem_kernel.dylib          0x00007fff93a6cdb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff9a2b6728 _pthread_cond_wait + 767
2   libbase.dylib                   0x00000001056b9c1d base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) + 2333
3   libbase.dylib                   0x00000001056b92bd base::SequencedWorkerPool::Worker::Run() + 125
4   libbase.dylib                   0x00000001056bd3dd base::SimpleThread::ThreadMain() + 125
5   libbase.dylib                   0x00000001056b8b1c 0x105641000 + 490268
6   libsystem_pthread.dylib         0x00007fff9a2b599d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9a2b591a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9a2b3351 thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00007f9078e48d50  rbx: 0x00007fff5ca0aba8  rcx: 0x78325f7368707a2c  rdx: 0x00007fff5ca0a968
  rdi: 0x78325f7368707a2c  rsi: 0x0000000000000000  rbp: 0x00007fff5ca0a7f0  rsp: 0x00007fff5ca0a7f0
   r8: 0x00007fff5ca0ac88   r9: 0x0000000000000000  r10: 0x0000000000007d23  r11: 0x00000ff344704299
  r12: 0x0000000000000000  r13: 0x000000010538e05f  r14: 0x00000001032e52b0  r15: 0x00007f9079838c00
  rip: 0x0000000106f3b544  rfl: 0x0000000000010202  cr2: 0x000021878e36d000

Logical CPU:     2
Error Code:      0x00000000
Trap Number:     13
```

atom/browser/api/atom_api_web_contents.cc
if (guest_delegate_)
    guest_delegate_->SetSize(params);
}
bool WebContents::IsGuest() const {
  return type_ == WEB_VIEW;
}
v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
  WebContentsPreferences* web_preferences =
      WebContentsPreferences::FromWebContents(web_contents());
  return mate::ConvertToV8(isolate, *web_preferences->web_preferences());
}
v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow() {
  if (owner_window())
    return Window::From(isolate(), owner_window());
  else
    return v8::Null(isolate());
}
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
  return v8::Local<v8::Value>::New(isolate, session_);
}
content::WebContents* WebContents::HostWebContents() {