<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>4.0.4</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 7</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Won't crash</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Crashed while the app was on a page, and the user was not doing much except moving the mouse around.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Not be able to reproduce yet.</p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Callstack attached below. Is this some kind of double delete again? The closest I can find is <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="401171103" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/16472" data-hovercard-type="pull_request" data-hovercard-url="/electron/electron/pull/16472/hovercard" href="https://github.com/electron/electron/pull/16472">#16472</a>, but 4.0.4 already has the fix for 16472 and the callstack looks different.</p>
<p dir="auto">invalid-read<br>
[ 00 ] base::ObserverListcontent::FrameTreeNode::Observer,0,1::RemoveObserver(content::FrameTreeNode::Observer const *)                                                                                                                                                        ( observer_list.h:253 )<br>
[ 01 ] atom::api::BrowserWindow::~BrowserWindow()                                                                                                                                                                                                                                ( atom_api_browser_window.cc:100 )<br>
[ 02 ] content::SessionStorageNamespaceImpl::~SessionStorageNamespaceImpl()                                                                                                                                                                                                      ( session_storage_namespace_impl.cc:153 )<br>
[ 03 ] base::internal::WeakReference::IsValid()                                                                                                                                                                                                                                  ( weak_ptr.cc:50 )<br>
[ 04 ] atom::api::BrowserWindow::~BrowserWindow()                                                                                                                                                                                                                                ( atom_api_browser_window.h:99 )<br>
[ 05 ] base::ThreadLocalStorage::Slot::Get()                                                                                                                                                                                                                                     ( thread_local_storage.cc:362 )<br>
[ 06 ] base::debug::TaskAnnotator::RunTask(char const *,base::PendingTask *)                                                                                                                                                                                                     ( task_annotator.cc:101 )<br>
[ 07 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 08 ] GetChainHead()                                                                                                                                                                                                                                                            ( TeamLink.exe )<br>
[ 09 ] ShimMalloc(unsigned __int64,void *)                                                                                                                                                                                                                                       ( TeamLink.exe )<br>
[ 10 ] malloc(unsigned __int64)                                                                                                                                                                                                                                                  ( allocator_shim_override_ucrt_symbols_win.h:53 )<br>
[ 11 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 12 ] v8::internal::Isolate::Enter()                                                                                                                                                                                                                                            ( isolate.cc:3113 )<br>
[ 13 ] base::ObserverListbase::MessageLoopCurrent::DestructionObserver,0,1::Iter::Iter(base::ObserverListbase::MessageLoopCurrent::DestructionObserver,0,1 const *)                                                                                                          ( observer_list.h:122 )<br>
[ 14 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 15 ] atom::api::TopLevelWindow::OnWindowClosed()                                                                                                                                                                                                                               ( atom_api_top_level_window.cc:164 )<br>
[ 16 ] base::MessageLoop::RunTask(base::PendingTask *)                                                                                                                                                                                                                           ( message_loop.cc:421 )<br>
[ 17 ] base::circular_dequebase::PendingTask::MoveBuffer(base::internal::VectorBufferbase::PendingTask &amp;,unsigned __int64,unsigned __int64,base::internal::VectorBufferbase::PendingTask *,unsigned __int64 *,unsigned __int64 *)                                          ( circular_deque.h:920 )<br>
[ 18 ] base::PendingTask::PendingTask(base::PendingTask &amp;&amp;)                                                                                                                                                                                                                      ( pending_task.cc:19 )<br>
[ 19 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 20 ] base::MessageLoop::DoWork()                                                                                                                                                                                                                                               ( message_loop.cc:480 )<br>
[ 21 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 22 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 23 ] atom::api::TopLevelWindow::OnWindowClosed()                                                                                                                                                                                                                               ( atom_api_top_level_window.cc:164 )<br>
[ 24 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 25 ] base::MessagePumpForUI::ProcessMessageHelper(tagMSG const &amp;)                                                                                                                                                                                                              ( message_pump_win.cc:375 )<br>
[ 26 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 27 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 28 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 29 ] atom::api::TopLevelWindow::OnWindowClosed()                                                                                                                                                                                                                               ( atom_api_top_level_window.cc:164 )<br>
[ 30 ] base::MessagePumpForUI::DoRunLoop()                                                                                                                                                                                                                                       ( message_pump_win.cc:171 )<br>
[ 31 ] base::MessagePumpWin::Run(base::MessagePump::Delegate *)                                                                                                                                                                                                                  ( message_pump_win.cc:52 )<br>
[ 32 ] atom::Browser::SetMainMessageLoopQuitClosure(base::OnceCallback&lt;void ()&gt;)                                                                                                                                                                                                 ( browser.cc:199 )<br>
[ 33 ] base::RunLoop::Run()                                                                                                                                                                                                                                                      ( run_loop.cc:102 )<br>
[ 34 ] content::BrowserMainLoop::MainMessageLoopRun()                                                                                                                                                                                                                            ( browser_main_loop.cc:1575 )<br>
[ 35 ] atom::JavascriptEnvironment::OnMessageLoopCreated()                                                                                                                                                                                                                       ( javascript_environment.cc:69 )<br>
[ 36 ] atom::AtomBrowserMainParts::MainMessageLoopRun(int *)                                                                                                                                                                                                                     ( atom_browser_main_parts.cc:256 )<br>
[ 37 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 38 ] content::BrowserMainLoop::RunMainMessageLoopParts()                                                                                                                                                                                                                       ( browser_main_loop.cc:1037 )<br>
[ 39 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 40 ] content::BrowserMainRunnerImpl::Run()                                                                                                                                                                                                                                     ( browser_main_runner_impl.cc:162 )<br>
[ 41 ] content::BrowserMain(content::MainFunctionParams const &amp;)                                                                                                                                                                                                                 ( browser_main.cc:47 )<br>
[ 42 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 43 ] base::ThreadLocalStorage::Slot::Set(void *)                                                                                                                                                                                                                               ( thread_local_storage.cc:377 )<br>
[ 44 ] GetChainHead()                                                                                                                                                                                                                                                            ( TeamLink.exe )<br>
[ 45 ] ShimMalloc(unsigned __int64,void *)                                                                                                                                                                                                                                       ( TeamLink.exe )<br>
[ 46 ] malloc(unsigned __int64)                                                                                                                                                                                                                                                  ( allocator_shim_override_ucrt_symbols_win.h:53 )<br>
[ 47 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 48 ] std::basic_string&lt;char,std::char_traits,std::allocator &gt;::_Equal(char const * const)                                                                                                                                                                          ( xstring:3769 )<br>
[ 49 ] operator new(unsigned __int64)                                                                                                                                                                                                                                            ( new_scalar.cpp:35 )<br>
[ 50 ] content::RunBrowserProcessMain(content::MainFunctionParams const &amp;,content::ContentMainDelegate *)                                                                                                                                                                        ( content_main_runner_impl.cc:596 )<br>
[ 51 ] base::MessageLoop::DoIdleWork()                                                                                                                                                                                                                                           ( message_loop.cc:551 )<br>
[ 52 ] content::ContentMainRunnerImpl::Run(bool)                                                                                                                                                                                                                                 ( content_main_runner_impl.cc:947 )<br>
[ 53 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 54 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 55 ] service_manager::Main(service_manager::MainParams const &amp;)                                                                                                                                                                                                                ( main.cc:472 )<br>
[ 56 ] base::debug::ScopedLockAcquireActivity::ScopedLockAcquireActivity(void const *,base::internal::LockImpl const *)                                                                                                                                                          ( activity_tracker.cc:1793 )<br>
[ 57 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 58 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 59 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 60 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 61 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 62 ] base::win::internal::ScopedHandleVerifier::ScopedHandleVerifier(bool)                                                                                                                                                                                                     ( scoped_handle_verifier.cc:61 )<br>
[ 63 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 64 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 65 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 66 ] GetChainHead()                                                                                                                                                                                                                                                            ( TeamLink.exe )<br>
[ 67 ] ShimMalloc(unsigned __int64,void *)                                                                                                                                                                                                                                       ( TeamLink.exe )<br>
[ 68 ] malloc(unsigned __int64)                                                                                                                                                                                                                                                  ( allocator_shim_override_ucrt_symbols_win.h:53 )<br>
[ 69 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 70 ] operator new(unsigned __int64)                                                                                                                                                                                                                                            ( new_scalar.cpp:35 )<br>
[ 71 ] GetChainHead()                                                                                                                                                                                                                                                            ( TeamLink.exe )<br>
[ 72 ] ShimMalloc(unsigned _<em>int64,void *)                                                                                                                                                                                                                                       ( TeamLink.exe )<br>
[ 73 ] malloc(unsigned <em><em>int64)                                                                                                                                                                                                                                                  ( allocator_shim_override_ucrt_symbols_win.h:53 )<br>
[ 74 ] content::ContentMainRunnerImpl::Create()                                                                                                                                                                                                                                  ( content_main_runner_impl.cc:640 )<br>
[ 75 ] content::ContentMain(content::ContentMainParams const &amp;)                                                                                                                                                                                                                  ( content_main.cc:19 )<br>
[ 76 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 77 ] std::vector&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt; &gt;,std::allocator&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt; &gt; &gt; &gt;::<em>Assign_range&lt;wchar_t **&gt;(wchar_t * *,wchar_t * *,std::forward_iterator_tag)  ( vector:1373 )<br>
[ 78 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 79 ] wWinMain(HINSTANCE</em></em> *,HINSTANCE</em></em> *,wchar_t *,int)                                                                                                                                                                                                                       ( atom_main.cc:175 )<br>
[ 80 ] RtlUnwindEx                                                                                                                                                                                                                                                               ( TeamLink.exe )<br>
[ 81 ] invoke_main()                                                                                                                                                                                                                                                             ( TeamLink.exe )<br>
[ 82 ] __scrt_common_main_seh()                                                                                                                                                                                                                                                  ( exe_common.inl:288 )</p>
<ul dir="auto">
<li>Electron version: 1.6.1</li>
<li>Operating system: MacOS Sierra 10.12.3 (16D32)</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Async request not block UI</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Async request completely block UI</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">navigator.geolocation.getCurrentPosition() call block UI on MacOS. On Windows everything works fine.<br>
<a href="https://github.com/electron/electron/files/813394/geolocaiton.block.ui.zip">geolocaiton block ui.zip</a></p>