- Electron version: 1.4.2
- Operating system: macOS 10.12

STEPS:
1. Run in shell: `~/Downloads/electron-v1.4.2-darwin-x64/Elec
ron.app/Contents/MacOS/Electron .`
2. Click `click me` in the window.
3. Wait for 30-70 seconds for the app to crash.

index.js

```
const { BrowserWindow, app } = require('electron');
let win;
app.on('ready', () => {
    win = new BrowserWindow({ webPreferences: { sandbox: true } })
    win.loadURL(`file://${__dirname}/index.html`)
    win.webContents.on('new-window', (e, url) => e.preventDefault())
}
```

index.html

```
<!DOCTYPE html>
click here
<script>
document.onclick = () => window.open('second.html', '_blank', 'width=800,height=200,location=0,scrollbars=0,status=0')
</script>
```

Console text when crashed

```
[24501:1004/173223:FATAL:wrappable.cc(24)] Check failed: !wrapper_.IsEmpty(). 
0   Electron Framework                  0x0000000109b11cc3 _ZN4base8internal14NarrowingRangeIilE3minEv + 434723
1   Electron Framework                  0x0000000109b29577 _ZN4base8internal14NarrowingRangeIilE3minEv + 531159
2   Electron Framework                  0x0000000109a790f5 _ZN4mate13WrappableBase10GetWrapperEv + 101
3   Electron Framework                  0x000000010998a2b9 _ZN4mate12EventEmitterIN4atom3api11WebContentsEE10GetWrapperEv + 9
4   Electron Framework                  0x000000010998d009 _ZN4mate12EventEmitterIN4atom3api11WebContentsEE14EmitWithSenderIJiEEEbRKN4base16BasicStringPieceINSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEEEPN7content11WebContentsEPN3IPC7MessageEDpRKT_ + 89
5   Electron Framework                  0x0000000109983a13 _ZN4mate12EventEmitterIN4atom3api11WebContentsEE4EmitIJiEEEbRKN4base16BasicStringPieceINSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEEEDpRKT_ + 19
6   Electron Framework                  0x00000001099839f1 _ZN4atom3api11WebContents17RenderViewDeletedEPN7content14RenderViewHostE + 81
7   Electron Framework                  0x0000000109982727 _ZN4atom3api11WebContentsD2Ev + 199
8   Electron Framework                  0x0000000109982819 _ZN4atom3api11WebContentsD1Ev + 9
9   Electron Framework                  0x00000001099828ae _ZN4atom3api11WebContentsD0Ev + 14
10  Electron Framework                  0x00000001099828cd _ZThn48_N4atom3api11WebContentsD0Ev + 13
11  Electron Framework                  0x0000000109a79383 _ZN4mate13WrappableBase18SecondWeakCallbackERKN2v816WeakCallbackInfoIS0_EE + 19
12  libnode.dylib                       0x000000010dd8c396 _ZN2v88internal13GlobalHandles31DispatchPendingPhantomCallbacksEb + 854
13  libnode.dylib                       0x000000010dd8c42e _ZN2v88internal13GlobalHandles31PostGarbageCollectionProcessingENS0_16GarbageCollectorENS_15GCCallbackFlagsE + 46
14  libnode.dylib                       0x000000010dd9b8f8 _ZN2v88internal4Heap24PerformGarbageCollectionENS0_16GarbageCollectorENS_15GCCallbackFlagsE + 1768
15  libnode.dylib                       0x000000010dd9ad44 _ZN2v88internal4Heap14CollectGarbageENS0_16GarbageCollectorEPKcS4_NS_15GCCallbackFlagsE + 676
16  libnode.dylib                       0x000000010dd9aa48 _ZN2v88internal4Heap26CollectAllAvailableGarbageEPKc + 104
17  libnode.dylib                       0x000000010da30914 _ZN2v87Isolate21LowMemoryNotificationEv + 196
18  Electron Framework                  0x00000001099ba430 _ZNK4base8internal15RunnableAdapterIMN2v87IsolateEFvvEE3RunIPS3_JEEEvOT_DpOT0_ + 32
19  Electron Framework                  0x00000001099ba3f9 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKNS0_15RunnableAdapterIMN2v87IsolateEFvvEEEJPS6_EEEvOT_DpOT0_ + 9
20  Electron Framework                  0x00000001099ba3e1 _ZN4base8internal7InvokerINS0_9BindStateINS0_15RunnableAdapterIMN2v87IsolateEFvvEEEJNS0_17UnretainedWrapperIS5_EEEEEFvvEE7RunImplIRKS8_RKNSt3__15tupleIJSA_EEEJLm0EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE + 33
21  Electron Framework                  0x00000001099ba304 _ZN4base8internal7InvokerINS0_9BindStateINS0_15RunnableAdapterIMN2v87IsolateEFvvEEEJNS0_17UnretainedWrapperIS5_EEEEEFvvEE3RunEPNS0_13BindStateBaseE + 20
22  Electron Framework                  0x0000000109b6c269 _ZN4base8internal14NarrowingRangeIilE3minEv + 804809
23  Electron Framework                  0x0000000109b121bb _ZN4base8internal14NarrowingRangeIilE3minEv + 435995
24  Electron Framework                  0x0000000109b32f8c _ZN4base8internal14NarrowingRangeIilE3minEv + 570604
25  Electron Framework                  0x0000000109b3329c _ZN4base8internal14NarrowingRangeIilE3minEv + 571388
26  Electron Framework                  0x0000000109b3387b _ZN4base8internal14NarrowingRangeIilE3minEv + 572891
27  Electron Framework                  0x0000000109b07b49 _ZN4base8internal14NarrowingRangeIilE3minEv + 393385
28  Electron Framework                  0x0000000109b29f4a _ZN4base8internal14NarrowingRangeIilE3minEv + 533674
29  Electron Framework                  0x0000000109b07534 _ZN4base8internal14NarrowingRangeIilE3minEv + 391828
30  CoreFoundation                      0x00007fff832e6551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
31  CoreFoundation                      0x00007fff832c76bd __CFRunLoopDoSources0 + 557
32  CoreFoundation                      0x00007fff832c6bb6 __CFRunLoopRun + 934
33  CoreFoundation                      0x00007fff832c65b4 CFRunLoopRunSpecific + 420
34  HIToolbox                           0x00007fff82867f6c RunCurrentEventLoopInMode + 240
35  HIToolbox                           0x00007fff82867da1 ReceiveNextEventCommon + 432
36  HIToolbox                           0x00007fff82867bd6 _BlockUntilNextEventMatchingListInModeWithFilter + 71
37  AppKit                              0x00007fff80f5e5f5 _DPSNextEvent + 1093
38  AppKit                              0x00007fff8166e8eb -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
39  AppKit                              0x00007fff80f52fbd -[NSApplication run] + 926
40  Electron Framework                  0x0000000109b0837e _ZN4base8internal14NarrowingRangeIilE3minEv + 395486
41  Electron Framework                  0x0000000109b07984 _ZN4base8internal14NarrowingRangeIilE3minEv + 392932
42  Electron Framework                  0x0000000109b492d1 _ZN4base8internal14NarrowingRangeIilE3minEv + 661553
43  Electron Framework                  0x000000010a268f6b _ZN4base8internal14NarrowingRangeIilE3minEv + 8131787
44  Electron Framework                  0x000000010a268dc0 _ZN4base8internal14NarrowingRangeIilE3minEv + 8131360
45  Electron Framework                  0x000000010a26b2c2 _ZN4base8internal14NarrowingRangeIilE3minEv + 8140834
46  Electron Framework                  0x000000010a26530d _ZN4base8internal14NarrowingRangeIilE3minEv + 8116333
47  Electron Framework                  0x000000010a1ce100 _ZN4base8internal14NarrowingRangeIilE3minEv + 7497312
48  Electron Framework                  0x000000010a1cd2e6 _ZN4base8internal14NarrowingRangeIilE3minEv + 7493702
49  Electron Framework                  0x0000000109922d47 AtomMain + 71
50  Electron                            0x000000010991cf26 main + 38
51  libdyld.dylib                       0x00007fff98306255 start + 1
52  ???                                 0x0000000000000002 0x0 + 2

Trace/BPT trap: 5
```

atom/browser/api/atom_api_web_contents.cc
content::WebContents *web_contents,
                                            mate::Handle<api::Session> session,
                                            const mate::Dictionary& options) {
  Observe(web_contents);
  InitWithWebContents(web_contents, session->browser_context());
  managed_web_contents()->GetView()->SetDelegate(this);
  
  new WebContentsPreferences(web_contents, options);
  
  WebContentsPermissionHelper::CreateForWebContents(web_contents);
  
  AtomSecurityStateModelClient::CreateForWebContents(web_contents);
  web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
  if (IsGuest()) {
    guest_delegate_->Initialize(this);
    NativeWindow* owner_window = nullptr;
    if (options.Get("embedder", &embedder_) && embedder_) {
      
      auto relay =
          NativeWindowRelay::FromWebContents(embedder_->web_contents());
      if (relay)
        owner_window = relay->window.get();
    }
    if (owner_window)
      SetOwnerWindow(owner_window);
  }
  Init(isolate);
  AttachAsUserData(web_contents);
}
WebContents::~WebContents() {