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

Crash on reload window when any webview is open #102195

Closed
mjbvz opened this issue Jul 11, 2020 · 11 comments
Closed

Crash on reload window when any webview is open #102195

mjbvz opened this issue Jul 11, 2020 · 11 comments
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority upstream-issue-fixed The underlying upstream issue has been fixed verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jul 11, 2020

Issue Type: Bug

Repro

  1. Open the markdown preview (or any webview)
  2. Trigger Reload window

Bug
VS Code exits in what looks like a native crash. Here's the last output from --verbose:

[0710/220647.973692:WARNING:process_memory_mac.cc(93)] mach_vm_read(0x7ffee3cd6000, 0x2000): (os/kern) invalid address (1)
[0710/220648.074835:WARNING:system_snapshot_mac.cc(42)] sysctlbyname kern.nx: No such file or directory (2)
[0710/220648.083944:WARNING:crash_report_exception_handler.cc(239)] UniversalExceptionRaise: (os/kern) failure (5)

Here's the crash dump:

VSCode Crashes.zip

VS Code version: Code - Insiders 1.48.0-insider (e7920dc, 2020-07-10T11:55:11.286Z)
OS version: Darwin x64 19.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 32.00GB (1.55GB free)
Process Argv
Screen Reader no
VM 15%
@mjbvz mjbvz added this to the July 2020 milestone Jul 11, 2020
@mjbvz
Copy link
Contributor Author

mjbvz commented Jul 11, 2020

This first showed up with I updated from the 1.47 insiders to 1.48 insiders

@mjbvz mjbvz added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority webview Webview issues labels Jul 11, 2020
@mjbvz
Copy link
Contributor Author

mjbvz commented Jul 11, 2020

Marking as important since it I can easily and consistently hit this problem on MacOS

@deepak1556
Copy link
Contributor

Symbolicated trace

Thread 0 (crashed)
 0  Electron Framework!electron::WebContentsZoomController::SetZoomLevel(double) [web_contents_zoom_controller.cc : 45 + 0x0]
    rax = 0x0000000000000000   rdx = 0x0000000000000000
    rcx = 0x0000000107be6300   rbx = 0x00007ff89548b108
    rsi = 0x00007ff911833e00   rdi = 0x00007ff906e4e780
    rbp = 0x00007ffeee558f60   rsp = 0x00007ffeee558f00
     r8 = 0x0000000000008008    r9 = 0x0000000000000000
    r10 = 0x00000000000007ce   r11 = 0x00007ff8e5800000
    r12 = 0x00007ff906e4e780   r13 = 0x00007ff906b63ca8
    r14 = 0x00007ff8a63dfeb0   r15 = 0x0000000000000001
    rip = 0x00000001017fc57e
    Found by: given as instruction pointer in context
 1  Electron Framework!non-virtual thunk to electron::WebViewGuestDelegate::OnZoomLevelChanged(content::WebContents*, double, bool) [web_view_guest_delegate.cc : 77 + 0x5]
    rbp = 0x00007ffeee558f80   rsp = 0x00007ffeee558f70
    rip = 0x0000000101800656
    Found by: previous frame's frame pointer
 2  Electron Framework!electron::WebContentsZoomController::SetZoomLevel(double) [web_contents_zoom_controller.cc : 76 + 0x13]
    rbp = 0x00007ffeee558ff0   rsp = 0x00007ffeee558f90
    rip = 0x00000001017fc949
    Found by: previous frame's frame pointer
 3  Electron Framework!electron::WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded(GURL const&) [web_contents_zoom_controller.cc : 278 + 0xd]
    rbp = 0x00007ffeee559070   rsp = 0x00007ffeee559000
    rip = 0x00000001017fd316
    Found by: previous frame's frame pointer
 4  Electron Framework!content::WebContentsImpl::DidFinishNavigation(content::NavigationHandle*) [web_contents_impl.cc : 4498 + 0xc]
    rbp = 0x00007ffeee5590e0   rsp = 0x00007ffeee559080
    rip = 0x000000010281a085
    Found by: previous frame's frame pointer
 5  Electron Framework!content::NavigationRequest::~NavigationRequest() [navigation_request.cc : 1097 + 0xc]
    rbp = 0x00007ffeee559230   rsp = 0x00007ffeee5590f0
    rip = 0x00000001024f261e
    Found by: previous frame's frame pointer
 6  Electron Framework!content::NavigationRequest::~NavigationRequest() [navigation_request.cc : 1072 + 0x5]
    rbp = 0x00007ffeee559250   rsp = 0x00007ffeee559240
    rip = 0x00000001024f2e7e
    Found by: previous frame's frame pointer
 7  Electron Framework!content::NavigatorImpl::DidNavigate(content::RenderFrameHostImpl*, FrameHostMsg_DidCommitProvisionalLoad_Params const&, std::__1::unique_ptr<content::NavigationRequest, std::__1::default_delete<content::NavigationRequest> >, bool) [memory : 2378 + 0x6]
    rbp = 0x00007ffeee559360   rsp = 0x00007ffeee559260
    rip = 0x0000000102501f60
    Found by: previous frame's frame pointer
 8  Electron Framework!content::RenderFrameHostImpl::DidCommitNavigationInternal(std::__1::unique_ptr<content::NavigationRequest, std::__1::default_delete<content::NavigationRequest> >, std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >, bool) [render_frame_host_impl.cc : 7247 + 0x10]
    rbp = 0x00007ffeee559440   rsp = 0x00007ffeee559370
    rip = 0x0000000102514266
    Found by: previous frame's frame pointer
 9  Electron Framework!content::RenderFrameHostImpl::DidCommitNavigation(std::__1::unique_ptr<content::NavigationRequest, std::__1::default_delete<content::NavigationRequest> >, std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >, mojo::StructPtr<content::mojom::DidCommitProvisionalLoadInterfaceParams>) [render_frame_host_impl.cc : 7552 + 0xa]
    rbp = 0x00007ffeee559540   rsp = 0x00007ffeee559450
    rip = 0x00000001025138d1
    Found by: previous frame's frame pointer
10  Electron Framework!content::RenderFrameHostImpl::DidCommitPerNavigationMojoInterfaceNavigation(content::NavigationRequest*, std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >, mojo::StructPtr<content::mojom::DidCommitProvisionalLoadInterfaceParams>) [render_frame_host_impl.cc : 2710 + 0x8]
    rbp = 0x00007ffeee559590   rsp = 0x00007ffeee559550
    rip = 0x00000001025144db
    Found by: previous frame's frame pointer
11  Electron Framework!base::internal::Invoker<base::internal::BindState<void (content::RenderFrameHostImpl::*)(content::NavigationRequest*, std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >, mojo::StructPtr<content::mojom::DidCommitProvisionalLoadInterfaceParams>), base::internal::UnretainedWrapper<content::RenderFrameHostImpl>, content::NavigationRequest*>, void (std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >, mojo::StructPtr<content::mojom::DidCommitProvisionalLoadInterfaceParams>)>::RunOnce(base::internal::BindStateBase*, std::__1::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params, std::__1::default_delete<FrameHostMsg_DidCommitProvisionalLoad_Params> >&&, mojo::StructPtr<content::mojom::DidCommitProvisionalLoadInterfaceParams>&&) [bind_internal.h : 498 + 0x5]
    rbp = 0x00007ffeee5595c0   rsp = 0x00007ffeee5595a0
    rip = 0x000000010252dd02
    Found by: previous frame's frame pointer
12  Electron Framework!content::mojom::NavigationClient_CommitNavigation_ForwardToCallback::Accept(mojo::Message*) [callback.h : 98 + 0x3]
    rbp = 0x00007ffeee559660   rsp = 0x00007ffeee5595d0
    rip = 0x0000000101da3cec
    Found by: previous frame's frame pointer
13  Electron Framework!mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) [interface_endpoint_client.cc : 549 + 0xd]
    rbp = 0x00007ffeee5596f0   rsp = 0x00007ffeee559670
    rip = 0x0000000103b5ed00
    Found by: previous frame's frame pointer
14  Electron Framework!IPC::(anonymous namespace)::ChannelAssociatedGroupController::AcceptOnProxyThread(mojo::Message) [ipc_mojo_bootstrap.cc : 933 + 0xb]
    rbp = 0x00007ffeee559730   rsp = 0x00007ffeee559700
    rip = 0x0000000103ea24d5
    Found by: previous frame's frame pointer
15  Electron Framework!base::internal::Invoker<base::internal::BindState<void (IPC::(anonymous namespace)::ChannelAssociatedGroupController::*)(mojo::Message), scoped_refptr<IPC::(anonymous namespace)::ChannelAssociatedGroupController>, mojo::Message>, void ()>::RunOnce(base::internal::BindStateBase*) [bind_internal.h : 498 + 0x9]
    rbp = 0x00007ffeee5597d0   rsp = 0x00007ffeee559740
    rip = 0x0000000103ea25c3
    Found by: previous frame's frame pointer
16  Electron Framework!base::TaskAnnotator::RunTask(char const*, base::PendingTask*) [callback.h : 98 + 0x3]
    rbp = 0x00007ffeee559880   rsp = 0x00007ffeee5597e0
    rip = 0x000000010384f2bf
    Found by: previous frame's frame pointer
17  Electron Framework!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*, bool*) [thread_controller_with_message_pump_impl.cc : 365 + 0xf]
    rbp = 0x00007ffeee559950   rsp = 0x00007ffeee559890
    rip = 0x000000010385f63a
    Found by: previous frame's frame pointer
18  Electron Framework!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() [thread_controller_with_message_pump_impl.cc : 219 + 0xb]
    rbp = 0x00007ffeee5599a0   rsp = 0x00007ffeee559960
    rip = 0x000000010385f3d7
    Found by: previous frame's frame pointer
19  Electron Framework!___ZN4base24MessagePumpCFRunLoopBase13RunWorkSourceEPv_block_invoke [message_pump_mac.mm : 491 + 0x6]
    rbp = 0x00007ffeee5599c0   rsp = 0x00007ffeee5599b0
    rip = 0x00000001038adf01
    Found by: previous frame's frame pointer
20  Electron Framework!base::mac::CallWithEHFrame(void () block_pointer) + 0xa
    rbp = 0x00007ffeee5599d0   rsp = 0x00007ffeee5599d0
    rip = 0x00000001038a974a
    Found by: previous frame's frame pointer
21  Electron Framework!base::MessagePumpCFRunLoopBase::RunWorkSource(void*) [message_pump_mac.mm : 467 + 0x5]
    rbp = 0x00007ffeee559a10   rsp = 0x00007ffeee5599e0
    rip = 0x00000001038ad7df
    Found by: previous frame's frame pointer
22  CoreFoundation + 0x83de2
    rbp = 0x00007ffeee559a20   rsp = 0x00007ffeee559a20
    rip = 0x00007fff339b4de2
    Found by: previous frame's frame pointer
23  CoreFoundation + 0x83d81
    rbp = 0x00007ffeee559a50   rsp = 0x00007ffeee559a30
    rip = 0x00007fff339b4d81
    Found by: previous frame's frame pointer
24  CoreFoundation + 0x83b9b
    rbp = 0x00007ffeee559ac0   rsp = 0x00007ffeee559a60
    rip = 0x00007fff339b4b9b
    Found by: previous frame's frame pointer
25  CoreFoundation + 0x828ca
    rbp = 0x00007ffeee55a7d0   rsp = 0x00007ffeee559ad0
    rip = 0x00007fff339b38ca
    Found by: previous frame's frame pointer
26  CoreFoundation + 0x81ece
    rbp = 0x00007ffeee55a860   rsp = 0x00007ffeee55a7e0
    rip = 0x00007fff339b2ece
    Found by: previous frame's frame pointer
27  HIToolbox + 0x2fabd
    rbp = 0x00007ffeee55a8b0   rsp = 0x00007ffeee55a870
    rip = 0x00007fff325e1abd
    Found by: previous frame's frame pointer
28  HIToolbox + 0x2f7d5
    rbp = 0x00007ffeee55a930   rsp = 0x00007ffeee55a8c0
    rip = 0x00007fff325e17d5
    Found by: previous frame's frame pointer
29  HIToolbox + 0x2f579
    rbp = 0x00007ffeee55a950   rsp = 0x00007ffeee55a940
    rip = 0x00007fff325e1579
    Found by: previous frame's frame pointer
30  AppKit + 0x41829
    rbp = 0x00007ffeee55ad50   rsp = 0x00007ffeee55a960
    rip = 0x00007fff30c29829
    Found by: previous frame's frame pointer
31  AppKit + 0x40070
    rbp = 0x00007ffeee55afb0   rsp = 0x00007ffeee55ad60
    rip = 0x00007fff30c28070
    Found by: previous frame's frame pointer
32  AppKit + 0x31d7e
    rbp = 0x00007ffeee55b070   rsp = 0x00007ffeee55afc0
    rip = 0x00007fff30c19d7e
    Found by: previous frame's frame pointer
33  Electron Framework!base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) [message_pump_mac.mm : 827 + 0xd]
    rbp = 0x00007ffeee55b0d0   rsp = 0x00007ffeee55b080
    rip = 0x00000001038ae70c
    Found by: previous frame's frame pointer
34  Electron Framework!base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) [message_pump_mac.mm : 186 + 0xc]
    rbp = 0x00007ffeee55b110   rsp = 0x00007ffeee55b0e0
    rip = 0x00000001038ad172
    Found by: previous frame's frame pointer
35  Electron Framework!non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) [thread_controller_with_message_pump_impl.cc : 463 + 0x6]
    rbp = 0x00007ffeee55b140   rsp = 0x00007ffeee55b120
    rip = 0x000000010385fef7
    Found by: previous frame's frame pointer
36  Electron Framework!base::RunLoop::Run() [run_loop.cc : 156 + 0x13]
    rbp = 0x00007ffeee55b1d0   rsp = 0x00007ffeee55b150
    rip = 0x0000000103837db7
    Found by: previous frame's frame pointer
37  Electron Framework!content::BrowserMainLoop::RunMainMessageLoopParts() [browser_main_loop.cc : 1535 + 0x8]
    rbp = 0x00007ffeee55b240   rsp = 0x00007ffeee55b1e0
    rip = 0x0000000102390543
    Found by: previous frame's frame pointer
38  Electron Framework!content::BrowserMainRunnerImpl::Run() [browser_main_runner_impl.cc : 150 + 0x5]
    rbp = 0x00007ffeee55b260   rsp = 0x00007ffeee55b250
    rip = 0x0000000102391fd2
    Found by: previous frame's frame pointer
39  Electron Framework!content::BrowserMain(content::MainFunctionParams const&) [browser_main.cc : 47 + 0x6]
    rbp = 0x00007ffeee55b2b0   rsp = 0x00007ffeee55b270
    rip = 0x000000010238daba
    Found by: previous frame's frame pointer
40  Electron Framework!content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool) [content_main_runner_impl.cc : 527 + 0x8]
    rbp = 0x00007ffeee55b320   rsp = 0x00007ffeee55b2c0
    rip = 0x0000000102227f04
    Found by: previous frame's frame pointer
41  Electron Framework!content::ContentMainRunnerImpl::Run(bool) [content_main_runner_impl.cc : 868 + 0x10]
    rbp = 0x00007ffeee55b390   rsp = 0x00007ffeee55b330
    rip = 0x0000000102227c0e
    Found by: previous frame's frame pointer
42  Electron Framework!service_manager::Main(service_manager::MainParams const&) [main.cc : 423 + 0x9]
    rbp = 0x00007ffeee55b700   rsp = 0x00007ffeee55b3a0
    rip = 0x0000000105105e44
    Found by: previous frame's frame pointer
43  Electron Framework!content::ContentMain(content::ContentMainParams const&) [content_main.cc : 19 + 0x8]
    rbp = 0x00007ffeee55b790   rsp = 0x00007ffeee55b710
    rip = 0x00000001022272a4
    Found by: previous frame's frame pointer
44  Electron Framework!ElectronMain [electron_library_main.mm : 31 + 0x5]
    rbp = 0x00007ffeee55b820   rsp = 0x00007ffeee55b7a0
    rip = 0x00000001016de294
    Found by: previous frame's frame pointer
45  Electron + 0x9b0
    rbp = 0x00007ffeee55b8d0   rsp = 0x00007ffeee55b830
    rip = 0x00000001016a49b0
    Found by: previous frame's frame pointer
46  libdyld.dylib + 0x1acc9
    rbp = 0x00007ffeee55b8e8   rsp = 0x00007ffeee55b8e0
    rip = 0x00007fff6d816cc9
    Found by: previous frame's frame pointer
47  libdyld.dylib + 0x1acc9
    rbp = 0x00007ffeee55b8e8   rsp = 0x00007ffeee55b8e8
    rip = 0x00007fff6d816cc9
    Found by: stack scanning

@deepak1556
Copy link
Contributor

deepak1556 commented Jul 11, 2020

@mjbvz do you have any zoom setting configured ?

FWIW this has identified a possible crash case with webview due to the recent zoom changes c7fe3b4 . Whenever a navigation happens the default behavior is to check for the presence of zoom value in the preference file under user data dir and if the browser window explicitly sets a zoomfactor then that will take precendence, which will then propagate zoom changes to all the child webviews, it still shouldn't crash (which should be fixed). For more context electron/electron#8537

Can you share your Preferences file under the user data directory

@deepak1556
Copy link
Contributor

Repro:

  • set window.zoomlevel to some value than default
  • close the app
  • now Preferences file from electron will have the zoom level for the origin as 0 but the BrowserWindow we create will use the new setting value which will take precedence during navigation
  • open app
  • open webview page
  • reload window which is a navigation

@deepak1556
Copy link
Contributor

/cc @bpasero

a quick fix here would be to call webcontents.setZoomFactor which will persist the zoom changes to Preferences file as well.

@bpasero
Copy link
Member

bpasero commented Jul 11, 2020

Happy to look at a PR that fixes this if possible.

@deepak1556
Copy link
Contributor

Upstream fix electron/electron#24757

@deepak1556 deepak1556 added upstream-issue-linked This is an upstream issue that has been reported upstream upstream-issue-fixed The underlying upstream issue has been fixed and removed upstream-issue-linked This is an upstream issue that has been reported upstream labels Jul 28, 2020
@deepak1556 deepak1556 modified the milestones: July 2020, August 2020 Jul 29, 2020
@deepak1556
Copy link
Contributor

Fix will be available in tomorrow's insider, please verify.

@deepak1556 deepak1556 added the unreleased Patch has not yet been released in VS Code Insiders label Jul 30, 2020
@deepak1556
Copy link
Contributor

there is no commit to reference because of build change, please verify with insiders c9a2f78

@deepak1556 deepak1556 added verification-needed Verification of issue is requested and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 31, 2020
@isidorn isidorn added the verified Verification succeeded label Aug 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority upstream-issue-fixed The underlying upstream issue has been fixed verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

6 participants
@rebornix @bpasero @deepak1556 @isidorn @mjbvz and others