Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

4.0.4

Operating System:

Windows 7

Expected Behavior

Won't crash

Actual Behavior

Crashed while the app was on a page, and the user was not doing much except moving the mouse around.

To Reproduce

Not be able to reproduce yet.

Additional Information

Callstack attached below. Is this some kind of double delete again? The closest I can find is #16472, but 4.0.4 already has the fix for 16472 and the callstack looks different.

invalid-read

[ 00 ] base::ObserverListcontent::FrameTreeNode::Observer,0,1::RemoveObserver(content::FrameTreeNode::Observer const *) ( observer_list.h:253 )

[ 01 ] atom::api::BrowserWindow::~BrowserWindow() ( atom_api_browser_window.cc:100 )

[ 02 ] content::SessionStorageNamespaceImpl::~SessionStorageNamespaceImpl() ( session_storage_namespace_impl.cc:153 )

[ 03 ] base::internal::WeakReference::IsValid() ( weak_ptr.cc:50 )

[ 04 ] atom::api::BrowserWindow::~BrowserWindow() ( atom_api_browser_window.h:99 )

[ 05 ] base::ThreadLocalStorage::Slot::Get() ( thread_local_storage.cc:362 )

[ 06 ] base::debug::TaskAnnotator::RunTask(char const *,base::PendingTask *) ( task_annotator.cc:101 )

[ 07 ] RtlUnwindEx ( TeamLink.exe )

[ 08 ] GetChainHead() ( TeamLink.exe )

[ 09 ] ShimMalloc(unsigned __int64,void *) ( TeamLink.exe )

[ 10 ] malloc(unsigned __int64) ( allocator_shim_override_ucrt_symbols_win.h:53 )

[ 11 ] RtlUnwindEx ( TeamLink.exe )

[ 12 ] v8::internal::Isolate::Enter() ( isolate.cc:3113 )

[ 13 ] base::ObserverListbase::MessageLoopCurrent::DestructionObserver,0,1::Iter::Iter(base::ObserverListbase::MessageLoopCurrent::DestructionObserver,0,1 const *) ( observer_list.h:122 )

[ 14 ] RtlUnwindEx ( TeamLink.exe )

[ 15 ] atom::api::TopLevelWindow::OnWindowClosed() ( atom_api_top_level_window.cc:164 )

[ 16 ] base::MessageLoop::RunTask(base::PendingTask *) ( message_loop.cc:421 )

[ 17 ] base::circular_dequebase::PendingTask::MoveBuffer(base::internal::VectorBufferbase::PendingTask &,unsigned __int64,unsigned __int64,base::internal::VectorBufferbase::PendingTask *,unsigned __int64 *,unsigned __int64 *) ( circular_deque.h:920 )

[ 18 ] base::PendingTask::PendingTask(base::PendingTask &&) ( pending_task.cc:19 )

[ 19 ] RtlUnwindEx ( TeamLink.exe )

[ 20 ] base::MessageLoop::DoWork() ( message_loop.cc:480 )

[ 21 ] RtlUnwindEx ( TeamLink.exe )

[ 22 ] RtlUnwindEx ( TeamLink.exe )

[ 23 ] atom::api::TopLevelWindow::OnWindowClosed() ( atom_api_top_level_window.cc:164 )

[ 24 ] RtlUnwindEx ( TeamLink.exe )

[ 25 ] base::MessagePumpForUI::ProcessMessageHelper(tagMSG const &) ( message_pump_win.cc:375 )

[ 26 ] RtlUnwindEx ( TeamLink.exe )

[ 27 ] RtlUnwindEx ( TeamLink.exe )

[ 28 ] RtlUnwindEx ( TeamLink.exe )

[ 29 ] atom::api::TopLevelWindow::OnWindowClosed() ( atom_api_top_level_window.cc:164 )

[ 30 ] base::MessagePumpForUI::DoRunLoop() ( message_pump_win.cc:171 )

[ 31 ] base::MessagePumpWin::Run(base::MessagePump::Delegate *) ( message_pump_win.cc:52 )

[ 32 ] atom::Browser::SetMainMessageLoopQuitClosure(base::OnceCallback<void ()>) ( browser.cc:199 )

[ 33 ] base::RunLoop::Run() ( run_loop.cc:102 )

[ 34 ] content::BrowserMainLoop::MainMessageLoopRun() ( browser_main_loop.cc:1575 )

[ 35 ] atom::JavascriptEnvironment::OnMessageLoopCreated() ( javascript_environment.cc:69 )

[ 36 ] atom::AtomBrowserMainParts::MainMessageLoopRun(int *) ( atom_browser_main_parts.cc:256 )

[ 37 ] RtlUnwindEx ( TeamLink.exe )

[ 38 ] content::BrowserMainLoop::RunMainMessageLoopParts() ( browser_main_loop.cc:1037 )

[ 39 ] RtlUnwindEx ( TeamLink.exe )

[ 40 ] content::BrowserMainRunnerImpl::Run() ( browser_main_runner_impl.cc:162 )

[ 41 ] content::BrowserMain(content::MainFunctionParams const &) ( browser_main.cc:47 )

[ 42 ] RtlUnwindEx ( TeamLink.exe )

[ 43 ] base::ThreadLocalStorage::Slot::Set(void *) ( thread_local_storage.cc:377 )

[ 44 ] GetChainHead() ( TeamLink.exe )

[ 45 ] ShimMalloc(unsigned __int64,void *) ( TeamLink.exe )

[ 46 ] malloc(unsigned __int64) ( allocator_shim_override_ucrt_symbols_win.h:53 )

[ 47 ] RtlUnwindEx ( TeamLink.exe )

[ 48 ] std::basic_string<char,std::char_traits,std::allocator >::_Equal(char const * const) ( xstring:3769 )

[ 49 ] operator new(unsigned __int64) ( new_scalar.cpp:35 )

[ 50 ] content::RunBrowserProcessMain(content::MainFunctionParams const &,content::ContentMainDelegate *) ( content_main_runner_impl.cc:596 )

[ 51 ] base::MessageLoop::DoIdleWork() ( message_loop.cc:551 )

[ 52 ] content::ContentMainRunnerImpl::Run(bool) ( content_main_runner_impl.cc:947 )

[ 53 ] RtlUnwindEx ( TeamLink.exe )

[ 54 ] RtlUnwindEx ( TeamLink.exe )

[ 55 ] service_manager::Main(service_manager::MainParams const &) ( main.cc:472 )

[ 56 ] base::debug::ScopedLockAcquireActivity::ScopedLockAcquireActivity(void const *,base::internal::LockImpl const *) ( activity_tracker.cc:1793 )

[ 57 ] RtlUnwindEx ( TeamLink.exe )

[ 58 ] RtlUnwindEx ( TeamLink.exe )

[ 59 ] RtlUnwindEx ( TeamLink.exe )

[ 60 ] RtlUnwindEx ( TeamLink.exe )

[ 61 ] RtlUnwindEx ( TeamLink.exe )

[ 62 ] base::win::internal::ScopedHandleVerifier::ScopedHandleVerifier(bool) ( scoped_handle_verifier.cc:61 )

[ 63 ] RtlUnwindEx ( TeamLink.exe )

[ 64 ] RtlUnwindEx ( TeamLink.exe )

[ 65 ] RtlUnwindEx ( TeamLink.exe )

[ 66 ] GetChainHead() ( TeamLink.exe )

[ 67 ] ShimMalloc(unsigned __int64,void *) ( TeamLink.exe )

[ 68 ] malloc(unsigned __int64) ( allocator_shim_override_ucrt_symbols_win.h:53 )

[ 69 ] RtlUnwindEx ( TeamLink.exe )

[ 70 ] operator new(unsigned __int64) ( new_scalar.cpp:35 )

[ 71 ] GetChainHead() ( TeamLink.exe )

[ 72 ] ShimMalloc(unsigned _int64,void *) ( TeamLink.exe )

[ 73 ] malloc(unsigned int64) ( allocator_shim_override_ucrt_symbols_win.h:53 )

[ 74 ] content::ContentMainRunnerImpl::Create() ( content_main_runner_impl.cc:640 )

[ 75 ] content::ContentMain(content::ContentMainParams const &) ( content_main.cc:19 )

[ 76 ] RtlUnwindEx ( TeamLink.exe )

[ 77 ] std::vector<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >,std::allocator<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > >::Assign_range<wchar_t **>(wchar_t * *,wchar_t * *,std::forward_iterator_tag) ( vector:1373 )

[ 78 ] RtlUnwindEx ( TeamLink.exe )

[ 79 ] wWinMain(HINSTANCE *,HINSTANCE *,wchar_t *,int) ( atom_main.cc:175 )

[ 80 ] RtlUnwindEx ( TeamLink.exe )

[ 81 ] invoke_main() ( TeamLink.exe )

[ 82 ] __scrt_common_main_seh() ( exe_common.inl:288 )

Issue 2:
Electron version: 1.6.1

Operating system: MacOS Sierra 10.12.3 (16D32)

Expected behavior

Async request not block UI

Actual behavior

Async request completely block UI

How to reproduce

navigator.geolocation.getCurrentPosition() call block UI on MacOS. On Windows everything works fine.

geolocaiton block ui.zip