Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call <webview>.reload() on a crashed webview makes Electron crash #15366

Closed
alexstrat opened this issue Oct 24, 2018 · 7 comments
Closed

Call <webview>.reload() on a crashed webview makes Electron crash #15366

alexstrat opened this issue Oct 24, 2018 · 7 comments

Comments

@alexstrat
Copy link
Contributor

alexstrat commented Oct 24, 2018

  • Output of node_modules/.bin/electron --version: v3.0.5
  • Operating System (Platform and Version): MacOS
  • Output of node_modules/.bin/electron --version on last known working Electron version (if applicable): 2.0.12

Expected Behavior
Calling <webview>.reload() on a crashed webview should reload the webview.

Actual behavior
Calling <webview>.reload() on a crashed webview crashes Electron with this:

Process:               Electron [61049]
Path:                  /Users/USER/*/Electron.app/Contents/MacOS/Electron
Identifier:            com.github.electron
Version:               3.0.5 (3.0.5)
Code Type:             X86-64 (Native)
Parent Process:        ??? [61048]
Responsible:           Electron [61049]
User ID:               501

Date/Time:             2018-10-24 15:55:08.512 +0200
OS Version:            Mac OS X 10.14 (18A391)
Report Version:        12
Anonymous UUID:        C9425C42-9513-4D2D-FB94-D12A1DFAB9DD

Sleep/Wake UUID:       C747ED70-FBD9-4F7F-B52D-046F5F044413

Time Awake Since Boot: 100000 seconds
Time Since Wake:       4900 seconds

System Integrity Protection: enabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000100
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [61049]

VM Regions Near 0x100:
--> 
    __TEXT                 0000000100606000-0000000100607000 [    4K] r-x/rwx SM=COW  /Users/USER/*/Electron.app/Contents/MacOS/Electron

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   com.github.electron.framework 	0x0000000101bbe67a 0x101675000 + 5543546
1   com.github.electron.framework 	0x0000000101cad08c 0x101675000 + 6520972
2   com.github.electron.framework 	0x0000000101eeb6e0 0x101675000 + 8873696
3   com.github.electron.framework 	0x0000000101ee9db0 0x101675000 + 8867248
4   com.github.electron.framework 	0x0000000101ec89d1 0x101675000 + 8731089
5   com.github.electron.framework 	0x0000000101eb3cd5 0x101675000 + 8645845
6   com.github.electron.framework 	0x0000000101eccf66 0x101675000 + 8748902
7   com.github.electron.framework 	0x0000000101ecc984 0x101675000 + 8747396
8   com.github.electron.framework 	0x0000000101ecd0cb 0x101675000 + 8749259
9   com.github.electron.framework 	0x0000000101ebcc45 0x101675000 + 8682565
10  com.github.electron.framework 	0x0000000101eb7b72 0x101675000 + 8661874
11  com.github.electron.framework 	0x0000000101eb7f65 0x101675000 + 8662885
12  com.github.electron.framework 	0x0000000101eb8e92 0x101675000 + 8666770
13  com.github.electron.framework 	0x00000001016ee77f atom::api::WebContents::LoadURL(GURL const&, mate::Dictionary const&) + 831
14  com.github.electron.framework 	0x0000000101685821 0x101675000 + 67617
15  com.github.electron.framework 	0x00000001016857fc 0x101675000 + 67580
16  com.github.electron.framework 	0x0000000101698222 0x101675000 + 143906
17  com.github.electron.framework 	0x00000001016fcc26 base::internal::Invoker<base::internal::BindState<void (atom::api::WebContents::*)(GURL const&, mate::Dictionary const&)>, void (atom::api::WebContents*, GURL const&, mate::Dictionary const&)>::Run(base::internal::BindStateBase*, atom::api::WebContents*, GURL const&, mate::Dictionary const&) + 38
18  com.github.electron.framework 	0x0000000101688c59 0x101675000 + 80985
19  com.github.electron.framework 	0x00000001016fca06 0x101675000 + 555526
20  com.github.electron.framework 	0x00000001016fc8b5 mate::internal::Dispatcher<void (atom::api::WebContents*, GURL const&, mate::Dictionary const&)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 133
21  libnode.dylib                 	0x0000000106747dd4 0x1060b6000 + 6888916
22  libnode.dylib                 	0x000000010679a352 0x1060b6000 + 7226194
23  libnode.dylib                 	0x0000000106799a3c 0x1060b6000 + 7223868
24  ???                           	0x000039025a9041fd 0 + 62682272121341
25  ???                           	0x000039025a9145f7 0 + 62682272187895
26  ???                           	0x000039025a9145f7 0 + 62682272187895
27  ???                           	0x000039025a9145f7 0 + 62682272187895
28  ???                           	0x000039025a9145f7 0 + 62682272187895
29  ???                           	0x000039025a90cbe3 0 + 62682272156643
30  ???                           	0x000039025a9145f7 0 + 62682272187895
31  ???                           	0x000039025a9145f7 0 + 62682272187895
32  ???                           	0x000039025a90cbe3 0 + 62682272156643
33  ???                           	0x000039025a9119d5 0 + 62682272176597
34  ???                           	0x000039025a90b6c1 0 + 62682272151233
35  libnode.dylib                 	0x0000000106b51ed1 0x1060b6000 + 11124433
36  libnode.dylib                 	0x0000000106b30cf8 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>*) + 152
37  libnode.dylib                 	0x00000001065e5496 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 550
38  libnode.dylib                 	0x00000001061e2f15 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 261
39  libnode.dylib                 	0x00000001061e31bd node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 109
40  libnode.dylib                 	0x00000001061e313c node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*, node::async_context) + 92
41  libnode.dylib                 	0x00000001061e30bf node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, node::async_context) + 95
42  com.github.electron.framework 	0x000000010177e4ef mate::internal::CallMethodWithArgs(v8::Isolate*, v8::Local<v8::Object>, char const*, std::__1::vector<v8::Local<v8::Value>, std::__1::allocator<v8::Local<v8::Value> > >*) + 79
43  com.github.electron.framework 	0x000000010170645d 0x101675000 + 595037
44  com.github.electron.framework 	0x000000010170634e 0x101675000 + 594766
45  com.github.electron.framework 	0x00000001016f2c21 0x101675000 + 515105
46  com.github.electron.framework 	0x00000001016f2b86 atom::api::WebContents::OnRendererMessageSync(content::RenderFrameHost*, std::__1::basic_string<unsigned short, base::string16_internals::string16_char_traits, std::__1::allocator<unsigned short> > const&, base::ListValue const&, IPC::Message*) + 102
47  com.github.electron.framework 	0x00000001016ede6c atom::api::WebContents::FrameDispatchHelper::OnRendererMessageSync(std::__1::basic_string<unsigned short, base::string16_internals::string16_char_traits, std::__1::allocator<unsigned short> > const&, base::ListValue const&, IPC::Message*) + 28
48  com.github.electron.framework 	0x00000001016f9e9b 0x101675000 + 544411
49  com.github.electron.framework 	0x00000001016f9e69 0x101675000 + 544361
50  com.github.electron.framework 	0x00000001016eddb8 0x101675000 + 495032
51  com.github.electron.framework 	0x00000001016eda9f atom::api::WebContents::OnMessageReceived(IPC::Message const&, content::RenderFrameHost*) + 127
52  com.github.electron.framework 	0x00000001016ee0f0 non-virtual thunk to atom::api::WebContents::OnMessageReceived(IPC::Message const&, content::RenderFrameHost*) + 16
53  com.github.electron.framework 	0x0000000101c96e87 0x101675000 + 6430343
54  com.github.electron.framework 	0x0000000101ed28ae 0x101675000 + 8771758
55  com.github.electron.framework 	0x000000010257480b 0x101675000 + 15726603
56  com.github.electron.framework 	0x0000000101892ab1 0x101675000 + 2218673
57  com.github.electron.framework 	0x00000001018b405c 0x101675000 + 2355292
58  com.github.electron.framework 	0x00000001018b47c8 0x101675000 + 2357192
59  com.github.electron.framework 	0x000000010194ab1a 0x101675000 + 2972442
60  com.github.electron.framework 	0x000000010194d84a 0x101675000 + 2984010
61  com.github.electron.framework 	0x000000010194a43f 0x101675000 + 2970687
62  com.apple.CoreFoundation      	0x00007fff31992405 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
63  com.apple.CoreFoundation      	0x00007fff319923ab __CFRunLoopDoSource0 + 108
64  com.apple.CoreFoundation      	0x00007fff31975e51 __CFRunLoopDoSources0 + 195
65  com.apple.CoreFoundation      	0x00007fff319753fa __CFRunLoopRun + 1219
66  com.apple.CoreFoundation      	0x00007fff31974ce4 CFRunLoopRunSpecific + 463
67  com.apple.HIToolbox           	0x00007fff30c0e895 RunCurrentEventLoopInMode + 293
68  com.apple.HIToolbox           	0x00007fff30c0e5cb ReceiveNextEventCommon + 618
69  com.apple.HIToolbox           	0x00007fff30c0e348 _BlockUntilNextEventMatchingListInModeWithFilter + 64
70  com.apple.AppKit              	0x00007fff2eecb95b _DPSNextEvent + 997
71  com.apple.AppKit              	0x00007fff2eeca6fa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
72  com.apple.AppKit              	0x00007fff2eec475d -[NSApplication run] + 699
73  com.github.electron.framework 	0x000000010194b27c 0x101675000 + 2974332
74  com.github.electron.framework 	0x0000000101949f5e 0x101675000 + 2969438
75  com.github.electron.framework 	0x00000001018d8f25 0x101675000 + 2506533
76  com.github.electron.framework 	0x0000000101da07e0 0x101675000 + 7518176
77  com.github.electron.framework 	0x0000000101da0610 0x101675000 + 7517712
78  com.github.electron.framework 	0x0000000101dcbac2 0x101675000 + 7695042
79  com.github.electron.framework 	0x0000000101d9c919 0x101675000 + 7502105
80  com.github.electron.framework 	0x0000000101a922a9 0x101675000 + 4313769
81  com.github.electron.framework 	0x000000010373bba2 0x101675000 + 34368418
82  com.github.electron.framework 	0x0000000101a90ec4 0x101675000 + 4308676
83  com.github.electron.framework 	0x0000000101677184 AtomMain + 68
84  com.github.electron           	0x0000000100606f16 main + 38
85  libdyld.dylib                 	0x00007fff5ea0a085 start + 1

To Reproduce

  • Clone electron-quick-start
  • add a random webview to index.html (<webview src='https://google.com'/> )
  • kill the webview process (take the biggest PID of your running eletron app and kill it)
  • in dev tool, call $('webview').reload()
  • => the app crashes

Other observation
Probably a regression from 2 to 3.

@alexstrat alexstrat changed the title Call <webview>.reload() on a crashed webview make Electron crash Call <webview>.reload() on a crashed webview makes Electron crash Oct 24, 2018
@sofianguy sofianguy added this to Needs Review in 3.0.x / 3.1.x Oct 25, 2018
@skyline1341
Copy link

skyline1341 commented Jan 30, 2019

got the same in Electron 4.0.1 on Windows 10

@xingyibiao
Copy link

I resolve it. clone a new webview, remove old webview, appendChild new webview, can work!

@sofianguy sofianguy added the 4-2-x label Aug 9, 2019
@alexstrat
Copy link
Contributor Author

Still reproduced in 6.0.4

@miniak
Copy link
Contributor

miniak commented Oct 27, 2019

it still reproduces with master

[64686:1027/234124.688892:FATAL:web_contents_impl.cc(1959)] Check failed: view. 
0   libbase.dylib                       0x0000000104e2708f base::debug::CollectStackTrace(void**, unsigned long) + 31
1   libbase.dylib                       0x0000000104abcb4b base::debug::StackTrace::StackTrace(unsigned long) + 75
2   libbase.dylib                       0x0000000104abcb9d base::debug::StackTrace::StackTrace(unsigned long) + 29
3   libbase.dylib                       0x0000000104ab0f28 base::debug::StackTrace::StackTrace() + 40
4   libbase.dylib                       0x0000000104adbc13 logging::LogMessage::~LogMessage() + 131
5   libbase.dylib                       0x0000000104aa29f5 logging::LogMessage::~LogMessage() + 21
6   libcontent.dylib                    0x0000000124cc0aee content::WebContentsImpl::RecursivelyRegisterFrameSinkIds() + 206
7   libcontent.dylib                    0x0000000124cc05fa content::WebContentsImpl::ReattachToOuterWebContentsFrame() + 314
8   libcontent.dylib                    0x0000000124cdcfa4 content::WebContentsImpl::CreateRenderViewForRenderManager(content::RenderViewHost*, int, int, base::UnguessableToken const&, content::FrameReplicationState const&) + 596
9   libcontent.dylib                    0x0000000123ee1ebc content::RenderFrameHostManager::InitRenderView(content::RenderViewHostImpl*, content::RenderFrameProxyHost*) + 284
10  libcontent.dylib                    0x0000000123ee1b59 content::RenderFrameHostManager::CreateRenderFrame(content::SiteInstance*) + 1081
11  libcontent.dylib                    0x0000000123edcc62 content::RenderFrameHostManager::CreateSpeculativeRenderFrameHost(content::SiteInstance*, content::SiteInstance*) + 466
12  libcontent.dylib                    0x0000000123e77ac9 content::RenderFrameHostManager::GetFrameHostForNavigation(content::NavigationRequest*) + 1705
13  libcontent.dylib                    0x0000000123edc567 content::RenderFrameHostManager::DidCreateNavigationRequest(content::NavigationRequest*) + 119
14  libcontent.dylib                    0x0000000123d62311 content::FrameTreeNode::CreatedNavigationRequest(std::__1::unique_ptr<content::NavigationRequest, std::__1::default_delete<content::NavigationRequest> >) + 577
15  libcontent.dylib                    0x0000000123e9806e content::NavigatorImpl::Navigate(std::__1::unique_ptr<content::NavigationRequest, std::__1::default_delete<content::NavigationRequest> >, content::ReloadType, content::RestoreType) + 1166
16  libcontent.dylib                    0x0000000123e58c37 content::NavigationControllerImpl::NavigateWithoutEntry(content::NavigationController::LoadURLParams const&) + 2263
17  libcontent.dylib                    0x0000000123e581ac content::NavigationControllerImpl::LoadURLWithParams(content::NavigationController::LoadURLParams const&) + 1052
18  Electron Framework                  0x000000011285b645 electron::api::WebContents::LoadURL(GURL const&, gin_helper::Dictionary const&) + 1029
19  Electron Framework                  0x000000011289a160 void base::internal::FunctorTraits<void (electron::api::WebContents::*)(GURL const&, gin_helper::Dictionary const&), void>::Invoke<void (electron::api::WebContents::*)(GURL const&, gin_helper::Dictionary const&), electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&>(void (electron::api::WebContents::*)(GURL const&, gin_helper::Dictionary const&), electron::api::WebContents*&&, GURL const&, gin_helper::Dictionary const&) + 176
20  Electron Framework                  0x000000011289a08b void base::internal::InvokeHelper<false, void>::MakeItSo<void (electron::api::WebContents::* const&)(GURL const&, gin_helper::Dictionary const&), electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&>(void (electron::api::WebContents::* const&)(GURL const&, gin_helper::Dictionary const&), electron::api::WebContents*&&, GURL const&, gin_helper::Dictionary const&) + 123
21  Electron Framework                  0x000000011289a000 void base::internal::Invoker<base::internal::BindState<void (electron::api::WebContents::*)(GURL const&, gin_helper::Dictionary const&)>, void (electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&)>::RunImpl<void (electron::api::WebContents::* const&)(GURL const&, gin_helper::Dictionary const&), std::__1::tuple<> const&>(void (electron::api::WebContents::* const&)(GURL const&, gin_helper::Dictionary const&), std::__1::tuple<> const&, std::__1::integer_sequence<unsigned long>, electron::api::WebContents*&&, GURL const&, gin_helper::Dictionary const&) + 96
22  Electron Framework                  0x0000000112899ef6 base::internal::Invoker<base::internal::BindState<void (electron::api::WebContents::*)(GURL const&, gin_helper::Dictionary const&)>, void (electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&)>::Run(base::internal::BindStateBase*, electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&) + 134
23  Electron Framework                  0x0000000112899d90 base::RepeatingCallback<void (electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&)>::Run(electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&) const & + 144
24  Electron Framework                  0x0000000112899b24 gin_helper::Invoker<gin_helper::IndicesHolder<0ul, 1ul, 2ul>, electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&>::DispatchToCallback(base::RepeatingCallback<void (electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&)>) + 100
25  Electron Framework                  0x000000011289987d gin_helper::Dispatcher<void (electron::api::WebContents*, GURL const&, gin_helper::Dictionary const&)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 221
26  libv8.dylib                         0x000000017ab4508e v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 1198
27  libv8.dylib                         0x000000017aad8224 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 1348
28  libv8.dylib                         0x000000017aad6603 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 835
29  libv8.dylib                         0x000000017aad602f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) + 127
30  libv8.dylib                         0x000000017babb640 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 64
Task trace:
0   libmojo_public_system_cpp.dylib     0x0000000106f69818 mojo::SimpleWatcher::Context::Notify(unsigned int, MojoHandleSignalsState, unsigned int) + 376
IPC message handler context: 0xC7631627

@yafp
Copy link

yafp commented Apr 27, 2020

I am realizing electron crashes on Windows 8.1 if i either do

  • loadUrl(url) or
  • reload()

on a previously crashed webview using electron 7.1.2.

Is that really supposed to be fixed?

@yafp
Copy link

yafp commented Apr 27, 2020

I resolve it. clone a new webview, remove old webview, appendChild new webview, can work!

Could you give us an example?

@electron-triage
Copy link

The Electron version reported on this issue is no longer supported. See our supported versions documentation.

If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.

Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3.0.x / 3.1.x
Unsorted Issues
Development

No branches or pull requests

7 participants