-
Notifications
You must be signed in to change notification settings - Fork 802
Closed
Closed
Copy link
Labels
area-WebViewbugSomething isn't workingSomething isn't workingfix-releasedThe fix has been in a release (experimental, preview, stable, or servicing).The fix has been in a release (experimental, preview, stable, or servicing).team-ControlsIssue for the Controls teamIssue for the Controls team
Milestone
Description
Describe the bug
When using WebView2 from XAML, there is an intermittent crash due to re-entrancy. This results when calling CoreWebView2Controller::IsVisible, which calls ShowWindow, which pumps messages.
Steps to reproduce the bug
I don't have a minimal repro, but can share the relevant part of the stack:
ntdll!KiUserCallbackDispatcherContinue
win32u!ZwUserShowWindow+0x14
EmbeddedBrowserWebView!embedded_browser_webview_current::Controller::SyncVisibility+0x64
EmbeddedBrowserWebView!embedded_browser_webview_current::Controller::put_IsVisible+0xb7
Microsoft_Web_WebView2_Core!winrt::Microsoft::Web::WebView2::Core::implementation::CoreWebView2Controller::IsVisible+0x57
Microsoft_Web_WebView2_Core!winrt::impl::produce<winrt::Microsoft::Web::WebView2::Core::implementation::CoreWebView2Controller,winrt::Microsoft::Web::WebView2::Core::ICoreWebView2Controller>::put_IsVisible+0x60
Microsoft_UI_Xaml_Controls!winrt::impl::consume_Microsoft_UI_Xaml_IUIElementOverrides<winrt::Microsoft::UI::Xaml::IUIElementOverrides>::OnDisconnectVisualChildren+0x14
Microsoft_UI_Xaml_Controls!WebView2::UpdateCoreWebViewVisibility::__l10::<lambda_2>::operator()+0x12
Microsoft_UI_Xaml_Controls!WebView2::CoreWebView2RunIgnoreInvalidStateSync<`WebView2::UpdateCoreWebViewVisibility'::`10'::<lambda_2> >+0x16
Microsoft_UI_Xaml_Controls!WebView2::UpdateCoreWebViewVisibility+0xed
Per @codendone, the fix here is to add a PauseNewDispatch around the call to m_coreWebViewController.IsVisible(...).
Expected behavior
The application should not crash.
Screenshots
No response
NuGet package version
None
Windows version
Windows 11 (23H2): Build 22631
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-WebViewbugSomething isn't workingSomething isn't workingfix-releasedThe fix has been in a release (experimental, preview, stable, or servicing).The fix has been in a release (experimental, preview, stable, or servicing).team-ControlsIssue for the Controls teamIssue for the Controls team